Search in sources :

Example 6 with EditPolicy

use of org.eclipse.gef.EditPolicy in project whole by wholeplatform.

the class TextualSelectionTool method handleCaretMove.

protected boolean handleCaretMove(int positions, int direction) {
    EditPart target = getFocusedPart();
    if (target == null)
        return false;
    EditPolicy editPolicy = target.getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
    if (editPolicy instanceof TextualHilightEditPolicy) {
        if (direction == HORIZONTAL && ((TextualHilightEditPolicy) editPolicy).moveCaretHorizontally(positions)) {
            resetTransactionCommand();
            return true;
        }
        if (direction == VERTICAL && ((TextualHilightEditPolicy) editPolicy).moveCaretVertically(positions)) {
            resetTransactionCommand();
            return true;
        }
    }
    return false;
}
Also used : EditPart(org.eclipse.gef.EditPart) TextualHilightEditPolicy(org.whole.lang.ui.editpolicies.TextualHilightEditPolicy) EditPolicy(org.eclipse.gef.EditPolicy) TextualHilightEditPolicy(org.whole.lang.ui.editpolicies.TextualHilightEditPolicy)

Aggregations

EditPolicy (org.eclipse.gef.EditPolicy)6 EditPart (org.eclipse.gef.EditPart)3 Command (org.eclipse.gef.commands.Command)3 TextualHilightEditPolicy (org.whole.lang.ui.editpolicies.TextualHilightEditPolicy)2 ConnectionDeleteCommand (org.csstudio.opibuilder.commands.ConnectionDeleteCommand)1 ManhattanBendpointEditPolicy (org.csstudio.opibuilder.editpolicies.ManhattanBendpointEditPolicy)1 ConnectionRouter (org.eclipse.draw2d.ConnectionRouter)1 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)1 XYLayout (org.eclipse.draw2d.XYLayout)1 CommandStack (org.eclipse.gef.commands.CommandStack)1 ConnectionEditPolicy (org.eclipse.gef.editpolicies.ConnectionEditPolicy)1 ConnectionEndpointEditPolicy (org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy)1 LayoutEditPolicy (org.eclipse.gef.editpolicies.LayoutEditPolicy)1 NonResizableEditPolicy (org.eclipse.gef.editpolicies.NonResizableEditPolicy)1 ResizableEditPolicy (org.eclipse.gef.editpolicies.ResizableEditPolicy)1 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)1 CreateRequest (org.eclipse.gef.requests.CreateRequest)1 GroupRequest (org.eclipse.gef.requests.GroupRequest)1 ReconnectRequest (org.eclipse.gef.requests.ReconnectRequest)1 WholeComponentEditPolicy (org.whole.lang.ui.editpolicies.WholeComponentEditPolicy)1