Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/DoubleClickEvent.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.DoubleClickEvent; | |
14 | |
15 import dwtx.jface.viewers.ISelection; | |
16 import dwtx.jface.viewers.Viewer; | |
17 | |
18 import dwtx.core.runtime.Assert; | |
19 | |
20 import dwt.dwthelper.utils; | |
21 | |
22 /** | |
23 * Event object describing a double-click. The source of these | |
24 * events is a viewer. | |
25 * | |
26 * @see IDoubleClickListener | |
27 */ | |
28 public class DoubleClickEvent : EventObject { | |
29 | |
30 /** | |
31 * Generated serial version UID for this class. | |
32 * @since 3.1 | |
33 */ | |
34 private static const long serialVersionUID = 3258408443605038133L; | |
35 | |
36 /** | |
37 * The selection. | |
38 */ | |
39 protected ISelection selection; | |
40 | |
41 /** | |
42 * Creates a new event for the given source and selection. | |
43 * | |
44 * @param source the viewer | |
45 * @param selection the selection | |
46 */ | |
47 public this(Viewer source, ISelection selection) { | |
48 super(source); | |
49 Assert.isNotNull(cast(Object)selection); | |
50 this.selection = selection; | |
51 } | |
52 | |
53 /** | |
54 * Returns the selection. | |
55 * | |
56 * @return the selection | |
57 */ | |
58 public ISelection getSelection() { | |
59 return selection; | |
60 } | |
61 | |
62 /** | |
63 * Returns the viewer that is the source of this event. | |
64 * | |
65 * @return the originating viewer | |
66 */ | |
67 public Viewer getViewer() { | |
68 return cast(Viewer) getSource(); | |
69 } | |
70 } |