sk.uniba.euromath.editor.textEditor.policies
Class TextEditPolicy

java.lang.Object
  extended by org.eclipse.gef.editpolicies.AbstractEditPolicy
      extended by sk.uniba.euromath.editor.textEditor.policies.AbstractTextEditPolicy
          extended by sk.uniba.euromath.editor.textEditor.policies.TextEditPolicy
All Implemented Interfaces:
org.eclipse.gef.EditPolicy, org.eclipse.gef.RequestConstants

public class TextEditPolicy
extends AbstractTextEditPolicy

Policy for handling requests to edit piece of text managed by piece keeper and activation of text editing.

Author:
Tomáš Studva, Martin Kollar 30.9.2005

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
TextEditPolicy(XMLAccess xmlAccess, CaretManager cManager)
          Constructor.
 
Method Summary
protected  org.eclipse.gef.commands.Command createActivationCommand(ActivateTextEditingRequest req)
          Creates SwitchEditModeCommand as response to ActivateTextEditingRequest.
protected  org.eclipse.gef.commands.Command createInsertTextCommand(InsertTextRequest request)
          Creates InsertTextCommand as response to InsertTextRequest.
protected  org.eclipse.gef.commands.Command createTextDeleteCommand(DeleteTextRequest req)
          Creates TextDeleteCommand as response to DeleteTextRequest.
 org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request)
           
 TextEditPart getHost()
           
 org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
           
protected  XMLAccess getXmlAccess()
           
 
Methods inherited from class sk.uniba.euromath.editor.textEditor.policies.AbstractTextEditPolicy
understandsRequest
 
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
activate, deactivate, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, setHost, showSourceFeedback, showTargetFeedback, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextEditPolicy

public TextEditPolicy(XMLAccess xmlAccess,
                      CaretManager cManager)
Constructor.

Parameters:
xmlAccess - access to XML data
cManager - CaretManager
Method Detail

createActivationCommand

protected org.eclipse.gef.commands.Command createActivationCommand(ActivateTextEditingRequest req)
Creates SwitchEditModeCommand as response to ActivateTextEditingRequest.

Parameters:
req - for activation of text editing
Returns:
command able to activate text editing

createInsertTextCommand

protected org.eclipse.gef.commands.Command createInsertTextCommand(InsertTextRequest request)
Creates InsertTextCommand as response to InsertTextRequest.

Parameters:
request - for insertion of text
Returns:
command able to execute insertion of text

createTextDeleteCommand

protected org.eclipse.gef.commands.Command createTextDeleteCommand(DeleteTextRequest req)
Creates TextDeleteCommand as response to DeleteTextRequest.

Parameters:
req - request to delete text
Returns:
command able to delete text

getCommand

public org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request)
Specified by:
getCommand in interface org.eclipse.gef.EditPolicy
Overrides:
getCommand in class org.eclipse.gef.editpolicies.AbstractEditPolicy
Returns:
SwitchEditModeCommand or TextInputCommand or DeleteTextCommand or null
See Also:
EditPolicy.getCommand(org.eclipse.gef.Request)

getHost

public TextEditPart getHost()
Specified by:
getHost in interface org.eclipse.gef.EditPolicy
Overrides:
getHost in class org.eclipse.gef.editpolicies.AbstractEditPolicy

getTargetEditPart

public org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
Specified by:
getTargetEditPart in interface org.eclipse.gef.EditPolicy
Overrides:
getTargetEditPart in class org.eclipse.gef.editpolicies.AbstractEditPolicy
Returns:
host if understands the request else returns null
See Also:
EditPolicy.getTargetEditPart(org.eclipse.gef.Request)

getXmlAccess

protected XMLAccess getXmlAccess()
Returns:
Returns the xmlAccess.


Copyright © 2003-2006 null. All Rights Reserved.