Package org.eclipse.gef.zest.fx.operations

## 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

The `NavigateOperation` is a `ReverseUndoCompositeOperation` that combines a `ChangeContentsOperation` and an `ChangeViewportOperation` to navigate between nested and parent `Graph`s.

### Constructor Summary

Constructors
`NavigateOperation​(IViewer viewer)` Creates a new `NavigateOperation` that saves the layout and viewport for the currently displayed `Graph`.
`NavigateOperation​(IViewer viewer, Graph targetGraph, boolean isNestedGraph)` Creates a new `NavigateOperation` that saves the layout and viewport for the currently displayed `Graph`, loads the layout and viewport of the finalGraph, and changes the viewer contents.

### Method Summary

All Methods Instance Methods Concrete Methods
`IStatus` `execute​(IProgressMonitor monitor, IAdaptable info)`
`ChangeViewportOperation` `getChangeViewportOperation()` Returns the `ChangeViewportOperation` that is used by this `NavigateOperation` to update the viewport.
`void` `setFinalState​(Graph targetGraph, boolean isNestedGraph)` Changes this `NavigateOperation`'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 new `NavigateOperation` that saves the layout and viewport for the currently displayed `Graph`. The final state for the operation can later be set using `setFinalState(Graph, boolean)`.

Parameters:
  `viewer` - The `InfiniteCanvasViewer` of which the contents and viewport are manipulated.

#### NavigateOperation

    public NavigateOperation​(IViewer viewer,
                             Graph targetGraph,
                             boolean isNestedGraph)

Creates a new `NavigateOperation` that saves the layout and viewport for the currently displayed `Graph`, loads the layout and viewport of the finalGraph, and changes the viewer contents. If the isNestedGraph flag is set to `true`, then the viewport that was saved for finalGraph will not be restored, but instead it will be reset.

Parameters:
  `viewer` - The `InfiniteCanvasViewer` of which the contents and viewport are manipulated.
  `targetGraph` - The final `Graph` to be displayed within the given `InfiniteCanvasViewer`.
  `isNestedGraph` - Specifies whether or not the given finalGraph is a nested `Graph`.

### Method Detail

#### execute

    public IStatus execute​(IProgressMonitor monitor,
                           IAdaptable info)
                    throws ExecutionException

Specified by:
  `execute` in interface `IUndoableOperation`
Overrides:
  `execute` in class `AbstractCompositeOperation`
Throws:
  `ExecutionException`

#### getChangeViewportOperation

    public ChangeViewportOperation getChangeViewportOperation()

Returns the `ChangeViewportOperation` that is used by this `NavigateOperation` to update the viewport.

Returns:
  The `ChangeViewportOperation` that is used by this `NavigateOperation` to update the viewport.

#### setFinalState

    public void setFinalState​(Graph targetGraph,
                              boolean isNestedGraph)

Changes this `NavigateOperation`'s final state so that the given finalGraph is opened. If the isNestedGraph flag is set to `true`, then the viewport that was saved for finalGraph will not be restored, but instead it will be reset.

Parameters:
  `targetGraph` - The `Graph` that is to be displayed.
  `isNestedGraph` - Specifies whether or not the given finalGraph is a nested `Graph`.