Search in sources :

Example 1 with TextualHilightEditPolicy

use of org.whole.lang.ui.editpolicies.TextualHilightEditPolicy in project whole by wholeplatform.

the class AbstractTextualFreeformNodePart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new TextualHilightEditPolicy());
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new TextualDirectEditEditPolicy(getCommandFactory()));
}
Also used : TextualDirectEditEditPolicy(org.whole.lang.ui.editpolicies.TextualDirectEditEditPolicy) TextualHilightEditPolicy(org.whole.lang.ui.editpolicies.TextualHilightEditPolicy)

Example 2 with TextualHilightEditPolicy

use of org.whole.lang.ui.editpolicies.TextualHilightEditPolicy in project whole by wholeplatform.

the class TextualSelectionTool method mouseDown.

@Override
public void mouseDown(MouseEvent e, EditPartViewer viewer) {
    super.mouseDown(e, viewer);
    EditPart targetEditPart = getTargetEditPart();
    if (targetEditPart == null || e.button != 1)
        return;
    EditPolicy editPolicy = targetEditPart.getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
    if (editPolicy instanceof TextualHilightEditPolicy)
        performSelectionLocationUpdate((TextualHilightEditPolicy) editPolicy);
}
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)

Example 3 with TextualHilightEditPolicy

use of org.whole.lang.ui.editpolicies.TextualHilightEditPolicy in project whole by wholeplatform.

the class AbstractTextualEntityPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new TextualHilightEditPolicy());
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new TextualDirectEditEditPolicy(getCommandFactory()));
}
Also used : TextualDirectEditEditPolicy(org.whole.lang.ui.editpolicies.TextualDirectEditEditPolicy) TextualHilightEditPolicy(org.whole.lang.ui.editpolicies.TextualHilightEditPolicy)

Example 4 with TextualHilightEditPolicy

use of org.whole.lang.ui.editpolicies.TextualHilightEditPolicy 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

TextualHilightEditPolicy (org.whole.lang.ui.editpolicies.TextualHilightEditPolicy)4 EditPart (org.eclipse.gef.EditPart)2 EditPolicy (org.eclipse.gef.EditPolicy)2 TextualDirectEditEditPolicy (org.whole.lang.ui.editpolicies.TextualDirectEditEditPolicy)2