|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ISelectionService
A selection service tracks the selection within an object.
A listener that wants to be notified when the selection becomes
null must implement the INullSelectionListener
interface.
This service can be acquired from your service locator:
ISelectionService service = (ISelectionService) getSite().getService(ISelectionService.class);
ISelectionListener,
INullSelectionListener,
IServiceLocator.getService(Class)| Method Summary | |
|---|---|
void |
addPostSelectionListener(ISelectionListener listener)
Adds the given post selection listener.It is equivalent to selection changed if the selection was triggered by the mouse but it has a delay if the selection is triggered by the keyboard arrows. |
void |
addPostSelectionListener(java.lang.String partId,
ISelectionListener listener)
Adds a part-specific selection listener which is notified when selection changes in the part with the given id. |
void |
addSelectionListener(ISelectionListener listener)
Adds the given selection listener. |
void |
addSelectionListener(java.lang.String partId,
ISelectionListener listener)
Adds a part-specific selection listener which is notified when selection changes in the part with the given id. |
ISelection |
getSelection()
Returns the current selection in the active part. |
ISelection |
getSelection(java.lang.String partId)
Returns the current selection in the part with the given id. |
void |
removePostSelectionListener(ISelectionListener listener)
Removes the given post selection listener. |
void |
removePostSelectionListener(java.lang.String partId,
ISelectionListener listener)
Removes the given part-specific post selection listener. |
void |
removeSelectionListener(ISelectionListener listener)
Removes the given selection listener. |
void |
removeSelectionListener(java.lang.String partId,
ISelectionListener listener)
Removes the given part-specific selection listener. |
| Method Detail |
|---|
void addSelectionListener(ISelectionListener listener)
Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
listener - a selection listenerremoveSelectionListener(ISelectionListener)
void addSelectionListener(java.lang.String partId,
ISelectionListener listener)
When the part is created, the listener is passed the part's initial selection.
When the part is disposed, the listener is passed a null selection,
but only if the listener implements INullSelectionListener.
Note: This will not correctly track editor parts as each editor does not have a unique partId.
Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
partId - the id of the part to tracklistener - a selection listenerremoveSelectionListener(String, ISelectionListener)void addPostSelectionListener(ISelectionListener listener)
Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
listener - a selection listenerremovePostSelectionListener(ISelectionListener)
void addPostSelectionListener(java.lang.String partId,
ISelectionListener listener)
When the part is created, the listener is passed the part's initial selection.
When the part is disposed, the listener is passed a null selection,
but only if the listener implements INullSelectionListener.
Note: This will not correctly track editor parts as each editor does not have a unique partId.
Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
partId - the id of the part to tracklistener - a selection listenerremovePostSelectionListener(String, ISelectionListener)ISelection getSelection()
null.
null if undefinedISelection getSelection(java.lang.String partId)
null.
partId - the id of the part
null if undefinedvoid removeSelectionListener(ISelectionListener listener)
listener - a selection listener
void removeSelectionListener(java.lang.String partId,
ISelectionListener listener)
partId - the id of the part to tracklistener - a selection listenervoid removePostSelectionListener(ISelectionListener listener)
listener - a selection listener
void removePostSelectionListener(java.lang.String partId,
ISelectionListener listener)
partId - the id of the part to tracklistener - a selection listener
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.