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
TheNavigateOperation
is aReverseUndoCompositeOperation
that combines aChangeContentsOperation
and anChangeViewportOperation
to navigate between nested and parentGraph
s.
-
-
Constructor Summary
Constructors Constructor Description NavigateOperation(IViewer viewer)
Creates a newNavigateOperation
that saves the layout and viewport for the currently displayedGraph
.NavigateOperation(IViewer viewer, Graph targetGraph, boolean isNestedGraph)
Creates a newNavigateOperation
that 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 IStatus
execute(IProgressMonitor monitor, IAdaptable info)
ChangeViewportOperation
getChangeViewportOperation()
Returns theChangeViewportOperation
that is used by thisNavigateOperation
to update the viewport.void
setFinalState(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 newNavigateOperation
that saves the layout and viewport for the currently displayedGraph
. The final state for the operation can later be set usingsetFinalState(Graph, boolean)
.- Parameters:
viewer
- TheInfiniteCanvasViewer
of which the contents and viewport are manipulated.
-
NavigateOperation
public NavigateOperation(IViewer viewer, Graph targetGraph, boolean isNestedGraph)
Creates a newNavigateOperation
that 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
- TheInfiniteCanvasViewer
of which the contents and viewport are manipulated.targetGraph
- The finalGraph
to 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:
execute
in interfaceIUndoableOperation
- Overrides:
execute
in classAbstractCompositeOperation
- Throws:
ExecutionException
-
getChangeViewportOperation
public ChangeViewportOperation getChangeViewportOperation()
Returns theChangeViewportOperation
that is used by thisNavigateOperation
to update the viewport.- Returns:
- The
ChangeViewportOperation
that is used by thisNavigateOperation
to 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.
-
-