Runtime

org.eclipse.gmf.runtime.diagram.ui.editpolicies
Class ConstrainedToolbarLayoutEditPolicy

java.lang.Object
  extended byorg.eclipse.gef.editpolicies.AbstractEditPolicy
      extended byorg.eclipse.gef.editpolicies.GraphicalEditPolicy
          extended byorg.eclipse.gef.editpolicies.LayoutEditPolicy
              extended byorg.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy
                  extended byorg.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy
All Implemented Interfaces:
EditPolicy, RequestConstants

public class ConstrainedToolbarLayoutEditPolicy
extends ConstrainedLayoutEditPolicy

A layout editpolicy for containers with constrained toolbar layout manager


Field Summary
 
Fields inherited from interface org.eclipse.gef.EditPolicy
COMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLE
 
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
ConstrainedToolbarLayoutEditPolicy()
          Creates a new vertical ConstrainedFlowLayoutEditPolicy
ConstrainedToolbarLayoutEditPolicy(boolean horizontal)
          Creates a new ConstrainedFlowLayoutEditPolicy with the given orientation
 
Method Summary
protected  Command createAddCommand(EditPart child, java.lang.Object constraint)
           
protected  Command createChangeConstraintCommand(EditPart child, java.lang.Object constraint)
           
protected  EditPolicy createChildEditPolicy(EditPart child)
           
protected  Command getAutoSizeCommand(Request request)
          Creates and returns an autosize command that reverts the layout constraints
 Command getCommand(Request request)
           
protected  java.lang.Object getConstraintFor(Point point)
           
protected  java.lang.Object getConstraintFor(Rectangle rect)
           
protected  Command getCreateCommand(CreateRequest request)
           
protected  Command getDeleteDependantCommand(Request request)
           
protected  Command getResizeChildrenCommand(ChangeBoundsRequest req)
           
 EditPart getTargetEditPart(Request request)
           
protected  boolean isHorizontal()
           
 boolean understandsRequest(Request req)
           
 
Methods inherited from class org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy
createChangeConstraintCommand, getAddCommand, getAlignChildrenCommand, getConstraintFor, getConstraintFor, getConstraintForClone, getLayoutOrigin, getMoveChildrenCommand, translateToModelConstraint
 
Methods inherited from class org.eclipse.gef.editpolicies.LayoutEditPolicy
activate, createListener, createSizeOnDropFeedback, deactivate, decorateChild, decorateChildren, eraseLayoutTargetFeedback, eraseSizeOnDropFeedback, eraseTargetFeedback, getCloneCommand, getCreationFeedbackOffset, getLayoutContainer, getOrphanChildrenCommand, getSizeOnDropFeedback, getSizeOnDropFeedback, setListener, showLayoutTargetFeedback, showSizeOnDropFeedback, showTargetFeedback, undecorateChild, undecorateChildren
 
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedback
 
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstrainedToolbarLayoutEditPolicy

public ConstrainedToolbarLayoutEditPolicy()
Creates a new vertical ConstrainedFlowLayoutEditPolicy


ConstrainedToolbarLayoutEditPolicy

public ConstrainedToolbarLayoutEditPolicy(boolean horizontal)
Creates a new ConstrainedFlowLayoutEditPolicy with the given orientation

Parameters:
horizontal -
Method Detail

isHorizontal

protected boolean isHorizontal()
Returns:
Whether the editpolicy is horizontal

createChildEditPolicy

protected EditPolicy createChildEditPolicy(EditPart child)
See Also:
LayoutEditPolicy.createChildEditPolicy(org.eclipse.gef.EditPart)

getCommand

public Command getCommand(Request request)
See Also:
EditPolicy.getCommand(org.eclipse.gef.Request)

getTargetEditPart

public EditPart getTargetEditPart(Request request)
See Also:
EditPolicy.getTargetEditPart(org.eclipse.gef.Request)

understandsRequest

public boolean understandsRequest(Request req)
See Also:
EditPolicy.understandsRequest(org.eclipse.gef.Request)

getAutoSizeCommand

protected Command getAutoSizeCommand(Request request)
Creates and returns an autosize command that reverts the layout constraints

Parameters:
request - teh request
Returns:
command

getResizeChildrenCommand

protected Command getResizeChildrenCommand(ChangeBoundsRequest req)
See Also:
ConstrainedLayoutEditPolicy.getResizeChildrenCommand(org.eclipse.gef.requests.ChangeBoundsRequest)

createAddCommand

protected Command createAddCommand(EditPart child,
                                   java.lang.Object constraint)
See Also:
ConstrainedLayoutEditPolicy.createAddCommand(org.eclipse.gef.EditPart, java.lang.Object)

createChangeConstraintCommand

protected Command createChangeConstraintCommand(EditPart child,
                                                java.lang.Object constraint)
See Also:
ConstrainedLayoutEditPolicy.createChangeConstraintCommand(org.eclipse.gef.EditPart, java.lang.Object)

getConstraintFor

protected java.lang.Object getConstraintFor(Point point)
See Also:
ConstrainedLayoutEditPolicy.getConstraintFor(org.eclipse.draw2d.geometry.Point)

getConstraintFor

protected java.lang.Object getConstraintFor(Rectangle rect)
See Also:
ConstrainedLayoutEditPolicy.getConstraintFor(org.eclipse.draw2d.geometry.Rectangle)

getCreateCommand

protected Command getCreateCommand(CreateRequest request)
See Also:
LayoutEditPolicy.getCreateCommand(org.eclipse.gef.requests.CreateRequest)

getDeleteDependantCommand

protected Command getDeleteDependantCommand(Request request)
See Also:
LayoutEditPolicy.getDeleteDependantCommand(org.eclipse.gef.Request)

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.