Skip to main content



      Home
Home » Eclipse Projects » GEF » IAction vs. EditorActionDelegate
IAction vs. EditorActionDelegate [message #166529] Tue, 01 February 2005 09:31 Go to next message
Eclipse UserFriend
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 02:41 Go to previous message
Eclipse UserFriend
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: Sat Jun 14 01:47:29 EDT 2025

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

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

Back to the top