Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » dynamic actions
dynamic actions [message #13971] Thu, 18 July 2002 13:24 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:Adding captions for a flow(continue)
Next Topic:Redo/Undo in GEF and Eclipse
Goto Forum:
  


Current Time: Sat Apr 20 00:57:18 GMT 2024

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

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

Back to the top