org.eclipse.gef.internal.ui.rulers
Class RulerRootEditPart

java.lang.Object
  extended byorg.eclipse.gef.editparts.AbstractEditPart
      extended byorg.eclipse.gef.editparts.AbstractGraphicalEditPart
          extended byorg.eclipse.gef.internal.ui.rulers.RulerRootEditPart
All Implemented Interfaces:
EditPart, GraphicalEditPart, org.eclipse.core.runtime.IAdaptable, RequestConstants, RootEditPart

public class RulerRootEditPart
extends AbstractGraphicalEditPart
implements RootEditPart

RootEditPart for a ruler.

Since:
3.0

Nested Class Summary
 class RulerRootEditPart.RulerViewport
          A RulerViewport shares a RangeModel with that of the primary GraphicalViewer.
 
Nested classes inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
 
Nested classes 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
RulerRootEditPart(boolean isHorzontal)
          Constructor
 
Method Summary
protected  void addChildVisual(EditPart childEditPart, int index)
          Adds the child's Figure to the contentPane.
protected  void createEditPolicies()
          Creates the initial EditPolicies and/or reserves slots for dynamic ones.
protected  org.eclipse.draw2d.IFigure createFigure()
          Creates the Figure to be used as this part's visuals.
 java.lang.Object getAdapter(java.lang.Class adapter)
          Extends AbstractEditPart#getAdapter(Class) to handle additional adapter types.
 EditPart getContents()
          Returns the contents EditPart.
 RootEditPart getRoot()
          Returns the RootEditPart.
 EditPartViewer getViewer()
          Returns the root's EditPartViewer.
protected  org.eclipse.draw2d.Viewport getViewport()
          Convenience method to get to the viewport
protected  void removeChildVisual(EditPart childEditPart)
          Adds the child's Figure to the contentPane.
 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, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getDragTracker, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refresh, refreshSourceConnections, refreshTargetConnections, registerVisuals, 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, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refreshChildren, 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, getCommand, getDragTracker, getEditPolicy, getModel, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 

Constructor Detail

RulerRootEditPart

public RulerRootEditPart(boolean isHorzontal)
Constructor

Parameters:
isHorzontal - whether or not the corresponding model ruler is horizontal
Method Detail

addChildVisual

protected void addChildVisual(EditPart childEditPart,
                              int index)
Description copied from class: AbstractGraphicalEditPart
Adds the child's Figure to the contentPane.

Overrides:
addChildVisual in class AbstractGraphicalEditPart
See Also:
AbstractEditPart.addChildVisual(org.eclipse.gef.EditPart, int)

createEditPolicies

protected void createEditPolicies()
Description copied from class: AbstractEditPart
Creates the initial EditPolicies and/or reserves slots for dynamic ones. Should be implemented to install the inital EditPolicies based on the model's initial state. null can be used to reserve a "slot", should there be some desire to guarantee the ordering of EditPolcies.

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

createFigure

protected org.eclipse.draw2d.IFigure createFigure()
Description copied from class: AbstractGraphicalEditPart
Creates the Figure to be used as this part's visuals. This is called from AbstractGraphicalEditPart.getFigure() if the figure has not been created.

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

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Description copied from class: AbstractGraphicalEditPart
Extends AbstractEditPart.getAdapter(Class) to handle additional adapter types. Currently, these types include AccessibleHandleProvider and AccessibleAnchorProvider. Subclasses should extend this method to support additional adapter types, or to replace the default provided adapaters.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class AbstractGraphicalEditPart
See Also:
IAdaptable.getAdapter(java.lang.Class)

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
See Also:
EditPart.getRoot()

getViewer

public EditPartViewer getViewer()
Description copied from interface: RootEditPart
Returns the root's EditPartViewer.

Specified by:
getViewer in interface RootEditPart
Overrides:
getViewer in class AbstractEditPart
See Also:
EditPart.getViewer()

getViewport

protected org.eclipse.draw2d.Viewport getViewport()
Convenience method to get to the viewport

Returns:
the figure cast as a viewport

removeChildVisual

protected void removeChildVisual(EditPart childEditPart)
Description copied from class: AbstractGraphicalEditPart
Adds the child's Figure to the contentPane.

Overrides:
removeChildVisual in class AbstractGraphicalEditPart
See Also:
AbstractEditPart.removeChildVisual(org.eclipse.gef.EditPart)

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(org.eclipse.gef.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(org.eclipse.gef.EditPartViewer)