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: * Tom Schindl <tom.schindl@bestsolution.at> - bugfixes in issues: 41
12: *******************************************************************************/package net.mygwt.ui.client.viewer;
13:
14: /**
15: * Interface common to all objects that provide a selection.
16: */
17: public interface ISelectionProvider {
18:
19: /**
20: * Returns the current selection for this provider.
21: *
22: * @return the current selection
23: */
24: public ISelection getSelection();
25:
26: /**
27: * Adds a listener for selection changes in this selection provider. Has no
28: * effect if an identical listener is already registered.
29: *
30: * @param listener a selection changed listener
31: */
32: public void addSelectionListener(ISelectionChangedListener listener);
33:
34: /**
35: * Removes the given selection change listener from this selection provider.
36: * Has no affect if an identical listener is not registered.
37: *
38: * @param listener a selection changed listener
39: */
40: public void removeSelectionListener(
41: ISelectionChangedListener listener);
42:
43: /**
44: * Sets the current selection for this selection provider.
45: *
46: * @param selection the new selection
47: */
48: public void setSelection(ISelection selection);
49:
50: }
|