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()));
}
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);
}
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()));
}
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;
}
Aggregations