|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.part.MultiPageSelectionProvider
org.eclipse.gmt.umlx.editor.MultiViewerSelectionSupervisor
public class MultiViewerSelectionSupervisor
MultiViewerSelectionSupervisor supervises the selection to and from an EditPartViewer. Supervision recognises that at most one EditPartViewer is in-focus and not all are necessarily visible. Selections emanating from out-of-focus EditPartViewers are ignored, except to remember the associated selection should it become in-focus. Selections to invisible EditPartViewers are suppressed untiol such time as the EditPartViewer becomes visible. These suppressions substantially reduce the redundant multi-way selection cross-notifications. Additionally the supervised selection is in model objects, which are mapped to and from appropriate EditPartViewer-specific objects before the selection is propagated. This ensures that selections can consistently prtopgate between different classes of viewer, some EditPartViewer-based and others using standard Platform protocols. The supervisor inherits from MultiPageSelectionProvider to avoid limitations in the use of MultiPageSelectionProvider from MultiPageEditorPart. The supervisor may nonethelerss be used with a single page editor
Constructor Summary | |
---|---|
MultiViewerSelectionSupervisor(ActiveEditDomain editDomain)
|
Method Summary | |
---|---|
void |
addViewer(org.eclipse.gef.EditPartViewer viewer)
Configure the supervisor to interact with a further EditPartViewer. |
void |
firePostSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
|
void |
fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent modelEvent)
Fires a selection changed event to notify all selection changed listeners of the changed selection of model objects. |
org.eclipse.jface.viewers.ISelection |
getSelection()
Get the list of currently selected model objects. |
boolean |
isInFocus(ViewerSupervisor viewerSupervisor)
|
void |
removeViewer(org.eclipse.gef.EditPartViewer viewer)
Configure the supervisor to stop interacting with a given EditPartViewer. |
void |
selectionChanged(org.eclipse.ui.IWorkbenchPart part,
org.eclipse.jface.viewers.ISelection modelSelection)
Respond to a selection change notification from the WorkbenchPart. |
void |
setInFocusViewer(org.eclipse.gef.EditPartViewer viewer)
Configure the supervisor to accept selections from and direct selections to a particular viewer, that must have been previously defined by addViewer(). |
void |
setInvisible(org.eclipse.gef.EditPartViewer viewer)
Configure viewer as invisible and therefore not to be given selections. |
void |
setPageSite(org.eclipse.ui.IWorkbenchSite site)
Configure the supervisor to interact with a given workbenchSite. |
void |
setSelection(org.eclipse.jface.viewers.ISelection modelSelection)
Define the selection from the WorkbenchPart model object domain. |
void |
setVisible(org.eclipse.gef.EditPartViewer viewer)
Configure viewer as visible and requiring up-to-date selections. |
static java.lang.String |
toString(org.eclipse.jface.viewers.ISelection modelSelection)
Define the selection from the WorkbenchPart model object domain. |
void |
unsetPageSite(org.eclipse.ui.IWorkbenchSite site)
Cancel the configuration for a given workbenchSite. |
Methods inherited from class org.eclipse.ui.part.MultiPageSelectionProvider |
---|
addPostSelectionChangedListener, addSelectionChangedListener, getMultiPageEditor, removePostSelectionChangedListener, removeSelectionChangedListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider |
---|
addSelectionChangedListener, removeSelectionChangedListener |
Constructor Detail |
---|
public MultiViewerSelectionSupervisor(ActiveEditDomain editDomain)
Method Detail |
---|
public static java.lang.String toString(org.eclipse.jface.viewers.ISelection modelSelection)
public void addViewer(org.eclipse.gef.EditPartViewer viewer)
addViewer
in interface ISelectionSupervisor
viewer
- the additional viewerpublic void firePostSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
firePostSelectionChanged
in class org.eclipse.ui.part.MultiPageSelectionProvider
public void fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent modelEvent)
fireSelectionChanged
in interface ISelectionSupervisor
fireSelectionChanged
in class org.eclipse.ui.part.MultiPageSelectionProvider
modelEvent
- the selection change eventpublic org.eclipse.jface.viewers.ISelection getSelection()
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
getSelection
in class org.eclipse.ui.part.MultiPageSelectionProvider
public boolean isInFocus(ViewerSupervisor viewerSupervisor)
isInFocus
in interface ISelectionSupervisor
public void removeViewer(org.eclipse.gef.EditPartViewer viewer)
removeViewer
in interface ISelectionSupervisor
viewer
- the obsolete viewerpublic void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection modelSelection)
selectionChanged
in interface org.eclipse.ui.ISelectionListener
public void setInFocusViewer(org.eclipse.gef.EditPartViewer viewer)
setInFocusViewer
in interface ISelectionSupervisor
viewer
- the viewerpublic void setInvisible(org.eclipse.gef.EditPartViewer viewer)
setInvisible
in interface ISelectionSupervisor
public void setPageSite(org.eclipse.ui.IWorkbenchSite site)
setPageSite
in interface ISelectionSupervisor
site
- the workbench sitepublic void setSelection(org.eclipse.jface.viewers.ISelection modelSelection)
setSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
setSelection
in class org.eclipse.ui.part.MultiPageSelectionProvider
public void setVisible(org.eclipse.gef.EditPartViewer viewer)
setVisible
in interface ISelectionSupervisor
public void unsetPageSite(org.eclipse.ui.IWorkbenchSite site)
unsetPageSite
in interface ISelectionSupervisor
site
- the workbench site
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |