|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.amp.axf.view.SelectionSynchronizer
public class SelectionSynchronizer
A utility for synchronizing the selection of multiple EditPartViewers. Copied from
org.eclipse.gef.ui.parts.SelectionSynchronizer and modified to allow conversion from SelectionProvider.
This class performs selection synchronization by taking the selection from one viewer, and mapping it to the
selection in another viewer. The mapping is performed by matching the models of the selected EditParts from one
viewer to the EditParts with the same models in another. The can be customized by overriding the
#convert(EditPartViewer, EditPart)
method.
Constructor Summary | |
---|---|
SelectionSynchronizer()
|
Method Summary | |
---|---|
void |
addViewer(org.eclipse.jface.viewers.ISelectionProvider viewer)
Adds a viewer to the set of synchronized viewers. |
protected java.lang.Object |
convert(org.eclipse.jface.viewers.ISelectionProvider viewer,
java.lang.Object object)
Maps the given editpart from one viewer to an editpart in another viewer. |
void |
removeViewer(org.eclipse.jface.viewers.ISelectionProvider viewer)
Removes the viewer from the set of synchronized viewers. |
void |
replace(SelectionSynchronizer old)
Replace. |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Receives notification from one viewer, and maps selection to all other members. |
void |
setEnabled(boolean value)
Enables or disabled synchronization between viewers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectionSynchronizer()
Method Detail |
---|
public void addViewer(org.eclipse.jface.viewers.ISelectionProvider viewer)
viewer
- the viewerprotected java.lang.Object convert(org.eclipse.jface.viewers.ISelectionProvider viewer, java.lang.Object object)
null
if there
is no corresponding part. This method can be overridden to provide custom mapping.
viewer
- the viewer being mapped toobject
- the object
null
or a corresponding editpartpublic void removeViewer(org.eclipse.jface.viewers.ISelectionProvider viewer)
viewer
- the viewer to removepublic void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
selectionChanged
in interface org.eclipse.jface.viewers.ISelectionChangedListener
event
- the selection eventpublic void setEnabled(boolean value)
value
- true
if synchronization should occurpublic void replace(SelectionSynchronizer old)
old
- the old
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |