Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.editpolicies
Class TreeContainerEditPolicy

java.lang.Object
  extended by

org.eclipse.gef.editpolicies.AbstractEditPolicy
      extended by
org.eclipse.gef.editpolicies.TreeContainerEditPolicy
All Implemented Interfaces:
EditPolicy, RequestConstants
Direct Known Subclasses:
AbstractTreeContainerEditPolicy

public abstract class TreeContainerEditPolicy
extends AbstractEditPolicy

An EditPolicy for handling ADDS, MOVES, and CREATES on a TreeEditPart.

This EditPolicy is responsible for displaying the insertion feedback in the Tree during the appropriate interactions.

This EditPolicy factors the getCommand(Request) into three different abstract methods which subclasses must implement.

Since:
2.0

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
TreeContainerEditPolicy ()
           
 
Method Summary
 void eraseTargetFeedback ( Request req)
          Does nothing by default.
protected  int findIndexOfTreeItemAt ( Point pt)
          Calculates the index of the TreeItem at given point.
protected  TreeItem findTreeItemAt ( Point pt)
          Calculates the TreeItem at a specified Point.
protected abstract   Command getAddCommand ( ChangeBoundsRequest request)
          Returns a Command for adding the children to the container.
  Command getCommand ( Request req)
          Returns null by default.
protected abstract   Command getCreateCommand ( CreateRequest request)
          Returns a Command for creating the object inside the container.
protected abstract   Command getMoveChildrenCommand ( ChangeBoundsRequest request)
          Returns a Command for moving the children within the container.
  EditPart getTargetEditPart ( Request req)
          Returns the host EditPart when appropriate.
 void showTargetFeedback ( Request req)
          Does nothing by default.
 
Methods inherited from class org.eclipse.gef.editpolicies. AbstractEditPolicy
activate, deactivate, debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString, understandsRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeContainerEditPolicy

public TreeContainerEditPolicy()
Method Detail

getAddCommand

protected abstract 
Command getAddCommand(
ChangeBoundsRequest request)
Returns a Command for adding the children to the container.

Parameters:
request - the Request to add.
Returns:
Command null or a Command to perform the add

getCreateCommand

protected abstract 
Command getCreateCommand(
CreateRequest request)
Returns a Command for creating the object inside the container.

Parameters:
request - the CreateRequest
Returns:
Command null or a Command to perform the create

getMoveChildrenCommand

protected abstract 
Command getMoveChildrenCommand(
ChangeBoundsRequest request)
Returns a Command for moving the children within the container.

Parameters:
request - the Request to move
Returns:
Command null or a Command to perform the move

eraseTargetFeedback

public void eraseTargetFeedback(
Request req)
Description copied from class: AbstractEditPolicy
Does nothing by default.

Specified by:
eraseTargetFeedback in interface EditPolicy
Overrides:
eraseTargetFeedback in class AbstractEditPolicy
See Also:
EditPolicy.eraseTargetFeedback(Request)

findIndexOfTreeItemAt

protected final int findIndexOfTreeItemAt(
Point pt)
Calculates the index of the TreeItem at given point.

Parameters:
pt - the Point in the Viewer
Returns:
the index of the TreeItem

findTreeItemAt

protected final TreeItem findTreeItemAt(
Point pt)
Calculates the TreeItem at a specified Point.

Parameters:
pt - the draw2d Point
Returns:
null or the TreeItem

getCommand

public 
Command getCommand(
Request req)
Description copied from class: AbstractEditPolicy
Returns null by default. null is used to indicate that the EditPolicy does not contribute to the specified Request.

Specified by:
getCommand in interface EditPolicy
Overrides:
getCommand in class AbstractEditPolicy
See Also:
EditPolicy.getCommand(Request)

getTargetEditPart

public 
EditPart getTargetEditPart(
Request req)
Returns the host EditPart when appropriate. Targeting is done by checking if the mouse is clearly over the host's TreeItem.

Specified by:
getTargetEditPart in interface EditPolicy
Overrides:
getTargetEditPart in class AbstractEditPolicy
See Also:
EditPolicy.getTargetEditPart(Request)

showTargetFeedback

public void showTargetFeedback(
Request req)
Description copied from class: AbstractEditPolicy
Does nothing by default.

Specified by:
showTargetFeedback in interface EditPolicy
Overrides:
showTargetFeedback in class AbstractEditPolicy
See Also:
EditPolicy.showTargetFeedback(Request)

Eclipse GEF
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire