01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: * Darrell Meyer <darrell@mygwt.net> - derived implementation
11: *******************************************************************************/package net.mygwt.ui.client.viewer;
12:
13: import java.util.EventObject;
14:
15: /**
16: * Event object describing a selection change. The source of these events is a
17: * selection provider.
18: */
19: public class SelectionChangedEvent extends EventObject {
20:
21: /**
22: * The selection.
23: */
24: protected ISelection selection;
25:
26: /**
27: * Creates a new event for the given source and selection.
28: *
29: * @param source the selection provider
30: * @param selection the selection
31: */
32: public SelectionChangedEvent(ISelectionProvider source,
33: ISelection selection) {
34: super (source);
35: this .selection = selection;
36: }
37:
38: /**
39: * Returns the selection.
40: *
41: * @return the selection
42: */
43: public ISelection getSelection() {
44: return selection;
45: }
46:
47: /**
48: * Returns the selection provider that is the source of this event.
49: *
50: * @return the originating selection provider
51: */
52: public ISelectionProvider getSelectionProvider() {
53: return (ISelectionProvider) getSource();
54: }
55:
56: }
|