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