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