dynamic actions [message #13971] |
Thu, 18 July 2002 13:24 |
Eclipse User |
|
|
|
Originally posted by: g.wagenknecht.intershop.de
Hi!
There is something I don't understand in the Logic Example.
You have IncrementDecrementAction, which inherits from
com.ibm.etools.gef.ui.actions.SelectionAction. The constructor of
IncrementDecrementActions creates a DYNAMIC action. Dynamic actions (as
defined by com.ibm.etools.gef.ui.actions.EditorPartAction) are actions that
determines its enable state through #isEnabled.
IncrementDecrementAction doesn't use #isEnable to determines its state. It
overwrites #calculateEnabled.
Now I'm confused because the API doc of EditorPartAction explicitly tells to
overwrite #calculateEnabled if it's NOT a dynamic action.
???
Cu, Gunnar
|
|
|
Re: dynamic actions [message #13977 is a reply to message #13971] |
Thu, 18 July 2002 13:53 |
Eclipse User |
|
|
|
Originally posted by: none.ibm.com
In Action, isEnabled() is a query of the cached enabled flag, which you
might update dynamically as your enabled state change. In fact, you must do
this if your action is on the Toolbar and always visible.
calculateEnabled is a calculation for Actions which don't use the flag at
all. But, isEnabled is the only way to get to calculateEnabled() because it
is on the IAction interface.
"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:ah6dgn$ls7$1@rogue.oti.com...
> Hi!
>
> There is something I don't understand in the Logic Example.
>
> You have IncrementDecrementAction, which inherits from
> com.ibm.etools.gef.ui.actions.SelectionAction. The constructor of
> IncrementDecrementActions creates a DYNAMIC action. Dynamic actions (as
> defined by com.ibm.etools.gef.ui.actions.EditorPartAction) are actions
that
> determines its enable state through #isEnabled.
>
> IncrementDecrementAction doesn't use #isEnable to determines its state. It
> overwrites #calculateEnabled.
>
> Now I'm confused because the API doc of EditorPartAction explicitly tells
to
> overwrite #calculateEnabled if it's NOT a dynamic action.
>
> ???
>
> Cu, Gunnar
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02730 seconds