Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » IAction vs. EditorActionDelegate
IAction vs. EditorActionDelegate [message #166529] Tue, 01 February 2005 14:31 Go to next message
Florian Georg is currently offline Florian GeorgFriend
Messages: 22
Registered: July 2009
Junior Member
I'm wondering about the different roles of IActions and ActionDelegates.
GEF Editors seem to use an ActionRegistry that contains IAction instances.
However, I tried to add EditorActionDelegates via the corresponding
extension point to my Editor.

However, the editor seem to eat e.g. the key accelerators, so that the
commands/ActionDelegates that are associated with the editor actions are
never executed.

Only IActions in an ActionRegistry can be attached to acceleretors - at
least that's what I got working by now....
Do I have to re-implement (or adapt somehow) IAction classes w.r.t. my
editor actions ?

So, what's the best practice here ? Where to use IAction vs.
EditorActionDelegates ?

I'm a bit confused about that, sorry.

thanks
Florian
Re: IAction vs. EditorActionDelegate [message #167160 is a reply to message #166529] Sun, 06 February 2005 07:41 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Hmm, I had never heard of this class before. Had to look it up when I saw
this post. You should be able to use this class. If GEF is consuming the
keystrokes, you might want to take a look at what's going on. Set a
breakpoint in DomainEventDispatcher.dispatchKeyPressed(). However, you
should realize that ActionDelegates are only updated when selection changes,
and so you won't be able to update them at other incidents (such as command
stack change).

I guess the general rule is that stick with the tried and true methods
whenever you can. BTW, you can use key bindings to register actions (or
commands, it seems). That's how GEF registers Ctrl + =/- with the zoom
actions. Look at GEF plugin's plugin.xml.

"Florian Georg" <FGeorg@gmx.de> wrote in message
news:cto3sv$i09$1@www.eclipse.org...
> I'm wondering about the different roles of IActions and ActionDelegates.
> GEF Editors seem to use an ActionRegistry that contains IAction instances.
> However, I tried to add EditorActionDelegates via the corresponding
> extension point to my Editor.
>
> However, the editor seem to eat e.g. the key accelerators, so that the
> commands/ActionDelegates that are associated with the editor actions are
> never executed.
>
> Only IActions in an ActionRegistry can be attached to acceleretors - at
> least that's what I got working by now....
> Do I have to re-implement (or adapt somehow) IAction classes w.r.t. my
> editor actions ?
>
> So, what's the best practice here ? Where to use IAction vs.
> EditorActionDelegates ?
>
> I'm a bit confused about that, sorry.
>
> thanks
> Florian
Previous Topic:ContentPane and layout problems/questions
Next Topic:is draw2d too heavy for a image process application
Goto Forum:
  


Current Time: Fri Apr 26 01:01:46 GMT 2024

Powered by FUDForum. Page generated in 0.02757 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top