Package org.eclipse.gef.ui.parts

# Class ScrollingGraphicalViewer

java.lang.Object
org.eclipse.gef.ui.parts.AbstractEditPartViewer
org.eclipse.gef.ui.parts.GraphicalViewerImpl
org.eclipse.gef.ui.parts.ScrollingGraphicalViewer

All Implemented Interfaces:
  `EditPartViewer`, `GraphicalViewer`, `ISelectionProvider`

Direct Known Subclasses:
  `PaletteViewer`

public class ScrollingGraphicalViewer extends GraphicalViewerImpl
A Graphical Viewer implementation which uses a `FigureCanvas` for native scrolling. Because the scrolling is handled natively, the root editpart should not contain a `ScrollPane` figure. Do not use root editparts which provide scrollpane figures, such as `GraphicalRootEditPart`.

The RootEditPart for a ScrollingGraphicalViewer may contain a Viewport. If it does, that viewport will be set as the FigureCanvas' viewport. FigureCanvas has certain requirements on the viewport figure, see `FigureCanvas.setViewport(Viewport)`.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.gef.EditPartViewer

`EditPartViewer.Conditional`

## Field Summary

### Fields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer

`constantSelection, focusPart, selection, selectionListeners`

## Constructor Summary

Constructors
Constructor
Description
`ScrollingGraphicalViewer()`
Constructs a ScrollingGraphicalViewer;

## Method Summary

Modifier and Type
Method
Description
`final Control`
`createControl(Composite parent)`
Optionally creates the default `Control` using the default style.
`protected org.eclipse.draw2d.FigureCanvas`
`getFigureCanvas()`
Convenience method which types the control as a `FigureCanvas` .
`protected void`
`hookRootFigure()`
If the figure is a viewport, set the canvas' viewport, otherwise, set its contents.
`void`
`reveal(EditPart part)`
Extends the superclass implementation to scroll the native Canvas control after the super's implementation has completed.

### Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerImpl

`createDefaultRoot, createLightweightSystem, findHandleAt, findObjectAtExcluding, flush, getEventDispatcher, getLayerManager, getLightweightSystem, getRootFigure, handleDispose, handleFocusGained, handleFocusLost, hookControl, hookDropTarget, registerAccessibleEditPart, setContextMenu, setCursor, setDragSource, setEditDomain, setRootEditPart, setRootFigure, setRouteEventsToEditDomain, unhookControl, unregisterAccessibleEditPart`

### Methods inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer

`addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, addSelectionChangedListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, fireSelectionChanged, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getResourceManager, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, hookDragSource, init, primGetSelectedEditParts, refreshDragSourceAdapter, refreshDropTargetAdapter, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, removeSelectionChangedListener, select, setContents, setContents, setControl, setDropTarget, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelection, setSelectionManager`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.gef.EditPartViewer

`addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getResourceManager, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, select, setContents, setContents, setControl, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelectionManager`

### Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider

`addSelectionChangedListener, removeSelectionChangedListener, setSelection`

## Constructor Details

### ScrollingGraphicalViewer

public ScrollingGraphicalViewer()
Constructs a ScrollingGraphicalViewer;

## Method Details

### createControl

public final Control createControl(Composite parent)
Description copied from interface: `EditPartViewer`
Optionally creates the default `Control` using the default style. The Control can also be created externally and then set into the Viewer.

Specified by:
  `createControl` in interface `EditPartViewer`
Overrides:
  `createControl` in class `GraphicalViewerImpl`
Parameters:
  `parent` - the parent in which create the SWT `Control`
Returns:
  the created Control for convenience
See Also:
  - `EditPartViewer.createControl(org.eclipse.swt.widgets.Composite)`

### getFigureCanvas

protected org.eclipse.draw2d.FigureCanvas getFigureCanvas()
Convenience method which types the control as a `FigureCanvas` . This method returns `null` whenever the control is null.

Returns:
  `null` or the Control as a FigureCanvas

### reveal

public void reveal(EditPart part)
Extends the superclass implementation to scroll the native Canvas control after the super's implementation has completed.

Specified by:
  `reveal` in interface `EditPartViewer`
Overrides:
  `reveal` in class `GraphicalViewerImpl`
Parameters:
  `part` - the EditPart to reveal
See Also:
  - `EditPartViewer.reveal(org.eclipse.gef.EditPart)`

### hookRootFigure

protected void hookRootFigure()
If the figure is a viewport, set the canvas' viewport, otherwise, set its contents.

Overrides:
  `hookRootFigure` in class `GraphicalViewerImpl`