Key binding with command framework in a dialog [message #696217] |
Wed, 13 July 2011 10:19  |
Eclipse User |
|
|
|
Hi all,
I try to get a key binding to work in a dialog which extends FormDialog. Binding works fine in the view opening the dialog but not in the dialog itself.
Here are hopefully the relevant extracts of my code:
The command
<extension
point="org.eclipse.ui.commands">
<command
id="my.test.command"
name="Abort an Action">
</command>
</extension>
The handler
<extension
point="org.eclipse.ui.handlers">
<handler
class="mypackage.MyDialog$AbortHandler"
commandId="my.test.command">
</handler>
</extension>
The binding:
<extension
point="org.eclipse.ui.bindings">
<key
commandId="my.test.command"
contextId="org.eclipse.ui.contexts.dialogAndWindow"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="F4">
</key>
</extension>
Handler
...
public static class AbortHandler extends org.eclipse.core.commands.AbstractHandler{
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
System.out.println("Hello World");
return null;
}
}
Best Regards
Sebastian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03986 seconds