key listener problem in editor [message #243329] |
Tue, 03 June 2008 01:55  |
Eclipse User |
|
|
|
Originally posted by: shady_86.sify.com
hello i have created a GraphicalEditorwithFlyoutPalette, i have used some ActionFactory actions to get key control for delete, undo, redo etc....
now when i open more than one instance of the editor then the keys will work on the latest editor which is open...
i think the reason is that i am doing it in the following way:
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
ActionRegistry actionRegistry = getActionRegistry();
IActionBars bars = site.getActionBars();
String id = ActionFactory.UNDO.getId();
bars.setGlobalActionHandler(id, actionRegistry.getAction(id));
<b> ------------------------------------------------------------ ---- </b>
here i am setting action handler globally so the problem might be coming,
what can be the other way to have the keyboard assistance where all the instance will have the keyboard functionality?..,
|
|
|
|
Re: key listener problem in editor [message #243374 is a reply to message #243334] |
Wed, 04 June 2008 07:21  |
Eclipse User |
|
|
|
Originally posted by: shady_86.sify.com
well i found a very simple solution to this,
we can resolve this issue by simply making the contributor class and then setting it in the contributor class field of the editor in the plugin.xml file.
the contributor class will be extended with the GEF ActionBarContributor. then we just have to simply fill the implemented methods with any action that we want.
|
|
|
Powered by
FUDForum. Page generated in 0.06806 seconds