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