use of org.whole.lang.ui.keys.IKeyHandler in project whole by wholeplatform.
the class TextualDragTracker method handleTripleClick.
protected boolean handleTripleClick(int button) {
ITextualEntityPart textualEntityPart = getTextualEntityPart();
if (button == 1 && textualEntityPart != null) {
IGEFEditorKit editorkit = (IGEFEditorKit) textualEntityPart.getModelEntity().wGetEditorKit();
EditPoint editPoint = new EditPoint(textualEntityPart, textualEntityPart.getCaretPosition());
IKeyHandler keyHandler = editorkit.getKeyHandler();
IWholeSelection selection = keyHandler.calculateTripleClickSelection(editPoint);
performSelectionUpdate(selection, true);
return true;
}
return false;
}
use of org.whole.lang.ui.keys.IKeyHandler in project whole by wholeplatform.
the class E4NavigationKeyHandler method navigateView.
public boolean navigateView(KeyEvent event, int direction) {
EditPoint focusPoint = getEditPoint();
IGEFEditorKit editorKit = (IGEFEditorKit) focusPoint.focus.getModelEntity().wGetEditorKit();
IKeyHandler keyHandler = editorKit.getKeyHandler();
// FIXME workaround for a bug in navigation actions
if (focusPoint.focus instanceof ITextualEntityPart) {
ITextualEntityPart part = (ITextualEntityPart) focusPoint.focus;
int start = part.getSelectionStart();
int end = part.getSelectionEnd();
if (start != -1 && end != -1) {
CaretUpdater.sheduleSyncUpdate(part.getViewer(), part.getModelTextEntity(), direction == PositionConstants.WEST ? start : end, true);
return true;
} else {
CaretUpdater.sheduleSyncUpdate(part.getViewer(), part.getModelTextEntity(), part.getCaretPosition(), true);
}
}
editPoint = keyHandler.findNeighbour(this, focusPoint, direction);
if (editPoint == null)
return navigateNextSibling(event, direction);
navigateTo(editPoint.focus, event);
return true;
}
use of org.whole.lang.ui.keys.IKeyHandler in project whole by wholeplatform.
the class TextualDragTracker method handleDoubleClick.
@Override
protected boolean handleDoubleClick(int button) {
ITextualEntityPart textualEntityPart = getTextualEntityPart();
if (button == 1 && textualEntityPart != null) {
IGEFEditorKit editorkit = (IGEFEditorKit) textualEntityPart.getModelEntity().wGetEditorKit();
EditPoint editPoint = new EditPoint(textualEntityPart, textualEntityPart.getCaretPosition());
IKeyHandler keyHandler = editorkit.getKeyHandler();
IWholeSelection selection = keyHandler.calculateDoubleClickSelection(editPoint);
performSelectionUpdate(selection, true);
return true;
}
return super.handleDoubleClick(button);
}
Aggregations