Mercurial > projects > dwt2
comparison org.eclipse.jface/src/org/eclipse/jface/viewers/OpenEvent.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module org.eclipse.jface.viewers.OpenEvent; | |
14 | |
15 import org.eclipse.jface.viewers.ISelection; | |
16 import org.eclipse.jface.viewers.Viewer; | |
17 | |
18 // import java.util.EventObject; | |
19 | |
20 import org.eclipse.core.runtime.Assert; | |
21 | |
22 import java.lang.all; | |
23 import java.util.EventObject; | |
24 | |
25 /** | |
26 * Event object describing an open which may be generated from a | |
27 * selection or default selection event. The source of these | |
28 * events is a viewer. | |
29 * | |
30 * @see IOpenListener | |
31 */ | |
32 public class OpenEvent : EventObject { | |
33 | |
34 /** | |
35 * Generated serial version UID for this class. | |
36 * @since 3.1 | |
37 */ | |
38 private static const long serialVersionUID = 3761972652973176117L; | |
39 | |
40 /** | |
41 * The selection. | |
42 */ | |
43 protected ISelection selection; | |
44 | |
45 /** | |
46 * Creates a new event for the given source and selection. | |
47 * | |
48 * @param source the viewer | |
49 * @param selection the selection | |
50 */ | |
51 public this(Viewer source, ISelection selection) { | |
52 super(source); | |
53 Assert.isNotNull(cast(Object)selection); | |
54 this.selection = selection; | |
55 } | |
56 | |
57 /** | |
58 * Returns the selection. | |
59 * | |
60 * @return the selection | |
61 */ | |
62 public ISelection getSelection() { | |
63 return selection; | |
64 } | |
65 | |
66 /** | |
67 * Returns the viewer that is the source of this event. | |
68 * | |
69 * @return the originating viewer | |
70 */ | |
71 public Viewer getViewer() { | |
72 return cast(Viewer) getSource(); | |
73 } | |
74 } |