<extension point="org.eclipse.ui.handlers">
<handler commandId="org.eclipse.mylyn.wikitext.ui.editor.showCheatSheetCommand"
class="org.eclipse.mylyn.wikitext.ui.editor.internal.commands.ShowCheatSheetCommand">
<activeWhen>
<with variable="activeFocusControlId">
<equals value="org.eclipse.mylyn.wikitext.ui.editor.sourceViewer">
</equals>
</with>
</activeWhen>
</handler>
</extension>
In my ITaskEditorExtension I can do this:
IFocusService focusService = (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
if (focusService != null) {
focusService.addFocusTracker(viewer.getTextWidget(), "org.eclipse.mylyn.wikitext.ui.editor.sourceViewer");
}
viewer.getTextWidget().setData(MarkupLanguage.class.getName(), markupLanguage);
Providing that the editor sets the right context, everything should just work. Here's the question:
I'm wondering how I can access the activeFocusControl in the AbstractHandler. This will give the handler access to the markupLanguage. Any ideas?
Thanks in advance,
David