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
public class NavigateOperation extends ForwardUndoCompositeOperation
TheNavigateOperationis aReverseUndoCompositeOperationthat combines aChangeContentsOperationand anChangeViewportOperationto navigate between nested and parentGraphs.
-
-
Constructor Summary
Constructors Constructor Description NavigateOperation(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IStatusexecute(IProgressMonitor monitor, IAdaptable info)ChangeViewportOperationgetChangeViewportOperation()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, unwrap
-
Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation
dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation
dispose, getContexts, getLabel, hasContext, removeContext
-
-
-
-
Constructor Detail
-
NavigateOperation
public NavigateOperation(IViewer viewer)
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
public 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. 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 Detail
-
execute
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException
- Specified by:
executein interfaceIUndoableOperation- Overrides:
executein classAbstractCompositeOperation- Throws:
ExecutionException
-
getChangeViewportOperation
public ChangeViewportOperation getChangeViewportOperation()
Returns theChangeViewportOperationthat is used by thisNavigateOperationto update the viewport.- Returns:
- The
ChangeViewportOperationthat is used by thisNavigateOperationto update the viewport.
-
setFinalState
public void setFinalState(Graph targetGraph, boolean isNestedGraph)
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.
-
-