use of org.whole.lang.ui.actions.IUpdatableAction 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.actions.IUpdatableAction in project whole by wholeplatform.
the class ActionRegistry method getSelectNotationAction.
public IUpdatableAction getSelectNotationAction(IEditorKit editorKit) {
String editorKitId = editorKit.getId();
IUpdatableAction action = selectNotationActions.get(editorKitId);
if (action == null) {
String label = editorKit.getName();
Map<String, Object> parameters = Collections.singletonMap(EDITORKIT_ID_PARAMETER_ID, editorKitId);
selectNotationActions.put(editorKitId, action = actionFactory.createE4ActionAdapter(label, null, SELECT_NOTATION_COMMAND_ID, parameters, IAction.AS_RADIO_BUTTON));
}
return action;
}
Aggregations