KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > ISelectionProvider


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  *******************************************************************************/

11 package org.eclipse.jface.viewers;
12
13 /**
14  * Interface common to all objects that provide a selection.
15  *
16  * @see ISelection
17  * @see ISelectionChangedListener
18  * @see SelectionChangedEvent
19  */

20 public interface ISelectionProvider {
21     /**
22      * Adds a listener for selection changes in this selection provider.
23      * Has no effect if an identical listener is already registered.
24      *
25      * @param listener a selection changed listener
26      */

27     public void addSelectionChangedListener(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 }
52
Popular Tags