Package org.eclipse.gef.editparts

# Class SimpleRootEditPart

java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gef.editparts.SimpleRootEditPart

All Implemented Interfaces:
  `IAdaptable`, `EditPart`, `GraphicalEditPart`, `RequestConstants`, `RootEditPart`

Direct Known Subclasses:
  `FreeformGraphicalRootEditPart`, `ScalableRootEditPart`

public class SimpleRootEditPart extends AbstractGraphicalEditPart implements RootEditPart
Default implementation of RootEditPart for GraphicalViewers.

Since:
  3.2

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart

`AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider`

## Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart

`AbstractEditPart.EditPolicyIterator`

## Field Summary

### Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart

`figure, sourceConnections, targetConnections`

### Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart

`children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG`

### Fields inherited from interface org.eclipse.gef.EditPart

`SELECTED, SELECTED_NONE, SELECTED_PRIMARY`

### Fields inherited from interface org.eclipse.gef.RequestConstants

`REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER`

## Constructor Summary

Constructors
Constructor
Description
`SimpleRootEditPart()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`createEditPolicies()`
No editpolicies are installed on a RootEditPart by default.
`protected org.eclipse.draw2d.IFigure`
`createFigure()`
The default root figure is a figure with a stack layout.
`Command`
`getCommand(Request req)`
The RootEditPart should never be asked for a command.
`EditPart`
`getContents()`
Returns the contents EditPart.
`RootEditPart`
`getRoot()`
Returns the `RootEditPart`.
`EditPartViewer`
`getViewer()`
Convenience method for returning the `EditPartViewer` for this part.
`protected void`
`refreshChildren()`
Overridden to do nothing, child is set using setContents(EditPart)
`void`
`setContents(EditPart editpart)`
Sets the contents EditPart.
`void`
`setViewer(EditPartViewer newViewer)`
Sets the root's EditPartViewer.

### Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart

`activate, addChildVisual, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getAdapter, getContentPane, getDragTracker, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, isSelectable, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refresh, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeNotify, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals`

### Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart

`activateEditPolicies, addChild, addEditPartListener, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, performRequest, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, unregisterAccessibility, unregisterModel`

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

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

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

`activate, addEditPartListener, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getDragTracker, getEditPolicy, getModel, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

## Constructor Details

### SimpleRootEditPart

public SimpleRootEditPart()

## Method Details

### createEditPolicies

protected void createEditPolicies()
No editpolicies are installed on a RootEditPart by default.

Specified by:
  `createEditPolicies` in class `AbstractEditPart`
See Also:
  - `AbstractEditPart.createEditPolicies()`

### createFigure

protected org.eclipse.draw2d.IFigure createFigure()
The default root figure is a figure with a stack layout.

Specified by:
  `createFigure` in class `AbstractGraphicalEditPart`
Returns:
  a Figure
See Also:
  - `AbstractGraphicalEditPart.createFigure()`

### getCommand

public Command getCommand(Request req)
The RootEditPart should never be asked for a command. This implementation returns an unexecutable command.

Specified by:
  `getCommand` in interface `EditPart`
Overrides:
  `getCommand` in class `AbstractEditPart`
Parameters:
  `req` - the Request
Returns:
  a Command
See Also:
  - `EditPart.getCommand(Request)`

### getContents

public EditPart getContents()
Description copied from interface: `RootEditPart`
Returns the contents EditPart. A RootEditPart only has a single child, called its contents.

Specified by:
  `getContents` in interface `RootEditPart`
Returns:
  the contents.
See Also:
  - `RootEditPart.getContents()`

### getRoot

public RootEditPart getRoot()
Description copied from interface: `EditPart`
Returns the `RootEditPart`. This method should only be called internally or by helpers such as edit policies. The root can be used to get the viewer.

Specified by:
  `getRoot` in interface `EditPart`
Overrides:
  `getRoot` in class `AbstractEditPart`
Returns:
  `null` or the `RootEditPart`
See Also:
  - `EditPart.getRoot()`

### getViewer

public EditPartViewer getViewer()
Description copied from interface: `EditPart`
Convenience method for returning the `EditPartViewer` for this part.

Specified by:
  `getViewer` in interface `EditPart`
Specified by:
  `getViewer` in interface `RootEditPart`
Overrides:
  `getViewer` in class `AbstractEditPart`
Returns:
  the `EditPartViewer` or `null`
See Also:
  - `EditPart.getViewer()`

### refreshChildren

protected void refreshChildren()
Overridden to do nothing, child is set using setContents(EditPart)

Overrides:
  `refreshChildren` in class `AbstractEditPart`
See Also:
  - `AbstractEditPart.refreshChildren()`

### setContents

public void setContents(EditPart editpart)
Description copied from interface: `RootEditPart`
Sets the contents EditPart. A RootEditPart only has a single child, called its contents.

Specified by:
  `setContents` in interface `RootEditPart`
Parameters:
  `editpart` - the contents
See Also:
  - `RootEditPart.setContents(EditPart)`

### setViewer

public void setViewer(EditPartViewer newViewer)
Description copied from interface: `RootEditPart`
Sets the root's EditPartViewer.

Specified by:
  `setViewer` in interface `RootEditPart`
Parameters:
  `newViewer` - the EditPartViewer
See Also:
  - `RootEditPart.setViewer(EditPartViewer)`