|Re: Ping - is anyone home? Anthony? any of the people [message #235165 is a reply to message #235138]
||Wed, 06 June 2007 10:32
Originally posted by: modica.cs.tu-berlin.deNOSPAM|
I don't claim to be an expert but this is how I believe RetargetActions
> 1) What is a retargetActions?
I can not express it clearlier than the JavaDoc:
* A <code>RetargetAction</code> tracks the active part in the workbench.
* Each RetargetAction has an ID. If the active part provides an action
* handler for the ID the enable and check state of the RetargetAction
* is determined from the enable and check state of the handler. If the
* active part does not provide an action handler then this action is
> 2) How do they differ from IAction's
RetargetActions implement IAction but they are just a kind of
placeholder that call concrete action that does something.
> 4) Why do some actions require retarget actions (cut, copy and paste)
> and others not (print).
Actually it seems that CopyRetargetAction is deprecated and refers to
ActionFactory that builds all kinds of RetargetActiosn including one for
> 5) When I implement my own actions when do I need a retargetAction? When
> don't I?
As you mentioned copy, cut, paste: It can be useful that a single button
(which is representing an IAction) in the top action bar can be shared
by different views, editors, etc. So a textual editor can tell this RA
that it shoulc C/C/P text. If you switch to a GEF editor the handle of
the RA is updated, so it would call the handling action provided by the
I think global actions with overloaded notions like copy, cut, paste or
all the other stuff in ActionFactory should indeed be RAs while specific
actions of a single editor should be normal actions as it is unefficient
to set up two actions (the RA and the handle) when one is sufficient.
Powered by FUDForum
. Page generated in 0.02038 seconds