use of org.whole.lang.ui.editor.IGEFEditorKit in project whole by wholeplatform.
the class ActionRegistry method registerKeyActions.
public void registerKeyActions(AbstractKeyHandler keyHandler) {
keyHandler.put(KeySequence.getInstance(KeyStroke.getInstance(SWT.F2)), true, actionFactory.createDirectEditAction());
for (IEditorKit editorKit : ReflectionFactory.getEditorKits()) {
for (ILanguageKit lk : ReflectionFactory.getLanguageKits(false)) {
if (!editorKit.canApply(lk))
continue;
for (Object[] textAction : E4Utils.textActionsFor(lk, ((IGEFEditorKit) editorKit).getActionFactory().textActions())) {
KeySequence keySequence = (KeySequence) textAction[0];
Class<IUpdatableAction> actionClass = (Class<IUpdatableAction>) textAction[2];
try {
IUpdatableAction action = actionClass.getConstructor(IEclipseContext.class).newInstance(context);
keyHandler.put(editorKit, keySequence, true, action);
} catch (Exception e) {
}
}
}
}
}
use of org.whole.lang.ui.editor.IGEFEditorKit in project whole by wholeplatform.
the class ClipboardUtils method createEditPart.
public static IEntityPart createEditPart(EditPartFactory factory, IEntity entity) {
IGEFEditorKit commonsEditorKit = (IGEFEditorKit) ReflectionFactory.getEditorKit("org.whole.lang.commons.ui.CommonsEditorKit");
RootFragment rootFragment = CommonsEntityFactory.instance.createRootFragment(entity.wGetAdapter(CommonsEntityDescriptorEnum.Any));
EditPart rootFragmentPart = commonsEditorKit.getPartFactory().createEditPart(null, rootFragment);
IEntityPart entityPart = (IEntityPart) factory.createEditPart(rootFragmentPart, entity);
EntityUtils.remove(entity);
return entityPart;
}
use of org.whole.lang.ui.editor.IGEFEditorKit 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