Class NavigateOperation
java.lang.Object
org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.gef.mvc.fx.operations.AbstractCompositeOperation
org.eclipse.gef.mvc.fx.operations.ForwardUndoCompositeOperation
org.eclipse.gef.zest.fx.operations.NavigateOperation
- All Implemented Interfaces:
ICompositeOperation,IUndoableOperation,ITransactionalOperation
The
NavigateOperation is a ReverseUndoCompositeOperation that
combines a ChangeContentsOperation and an
ChangeViewportOperation to navigate between nested and parent
Graphs.-
Constructor Summary
ConstructorsConstructorDescriptionNavigateOperation(IViewer viewer) Creates a newNavigateOperationthat saves the layout and viewport for the currently displayedGraph.NavigateOperation(IViewer viewer, Graph targetGraph, boolean isNestedGraph) Creates a newNavigateOperationthat saves the layout and viewport for the currently displayedGraph, loads the layout and viewport of the finalGraph, and changes the viewer contents. -
Method Summary
Modifier and TypeMethodDescriptionexecute(IProgressMonitor monitor, IAdaptable info) Returns theChangeViewportOperationthat is used by thisNavigateOperationto update the viewport.voidsetFinalState(Graph targetGraph, boolean isNestedGraph) Changes thisNavigateOperation's final state so that the given finalGraph is opened.Methods inherited from class org.eclipse.gef.mvc.fx.operations.AbstractCompositeOperation
add, addAll, addContext, canExecute, canRedo, canUndo, combine, getOperations, isContentRelevant, isEmpty, isNoOp, redo, remove, undo, unwrapMethods inherited from class org.eclipse.core.commands.operations.AbstractOperation
dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation
dispose, getContexts, getLabel, hasContext, removeContext
-
Constructor Details
-
NavigateOperation
Creates a newNavigateOperationthat saves the layout and viewport for the currently displayedGraph. The final state for the operation can later be set usingsetFinalState(Graph, boolean).- Parameters:
viewer- TheInfiniteCanvasViewerof which the contents and viewport are manipulated.
-
NavigateOperation
Creates a newNavigateOperationthat saves the layout and viewport for the currently displayedGraph, loads the layout and viewport of the finalGraph, and changes the viewer contents. If the isNestedGraph flag is set totrue, then the viewport that was saved for finalGraph will not be restored, but instead it will be reset.- Parameters:
viewer- TheInfiniteCanvasViewerof which the contents and viewport are manipulated.targetGraph- The finalGraphto be displayed within the givenInfiniteCanvasViewer.isNestedGraph- Specifies whether or not the given finalGraph is a nestedGraph.
-
-
Method Details
-
execute
- Specified by:
executein interfaceIUndoableOperation- Overrides:
executein classAbstractCompositeOperation- Throws:
ExecutionException
-
getChangeViewportOperation
Returns theChangeViewportOperationthat is used by thisNavigateOperationto update the viewport.- Returns:
- The
ChangeViewportOperationthat is used by thisNavigateOperationto update the viewport.
-
setFinalState
Changes thisNavigateOperation's final state so that the given finalGraph is opened. If the isNestedGraph flag is set totrue, then the viewport that was saved for finalGraph will not be restored, but instead it will be reset.
-