comparison dwtx/jface/viewers/OpenEvent.d @ 10:b6c35faf97c8

Viewers
author Frank Benoit <benoit@tionex.de>
date Mon, 31 Mar 2008 00:47:19 +0200
parents
children
comparison
equal deleted inserted replaced
9:6c14e54dfc11 10:b6c35faf97c8
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 dwtx.jface.viewers.OpenEvent;
14
15 import dwtx.jface.viewers.ISelection;
16 import dwtx.jface.viewers.Viewer;
17
18 // import java.util.EventObject;
19
20 import dwtx.core.runtime.Assert;
21
22 import dwt.dwthelper.utils;
23
24 /**
25 * Event object describing an open which may be generated from a
26 * selection or default selection event. The source of these
27 * events is a viewer.
28 *
29 * @see IOpenListener
30 */
31 public class OpenEvent : EventObject {
32
33 /**
34 * Generated serial version UID for this class.
35 * @since 3.1
36 */
37 private static const long serialVersionUID = 3761972652973176117L;
38
39 /**
40 * The selection.
41 */
42 protected ISelection selection;
43
44 /**
45 * Creates a new event for the given source and selection.
46 *
47 * @param source the viewer
48 * @param selection the selection
49 */
50 public this(Viewer source, ISelection selection) {
51 super(source);
52 Assert.isNotNull(cast(Object)selection);
53 this.selection = selection;
54 }
55
56 /**
57 * Returns the selection.
58 *
59 * @return the selection
60 */
61 public ISelection getSelection() {
62 return selection;
63 }
64
65 /**
66 * Returns the viewer that is the source of this event.
67 *
68 * @return the originating viewer
69 */
70 public Viewer getViewer() {
71 return cast(Viewer) getSource();
72 }
73 }