How can i change enable/disable state of actions defined by ActionSet extension? [message #30535] |
Wed, 14 May 2003 03:08  |
Eclipse User |
|
|
|
Originally posted by: kostyal.mirasoft.com.ua
Hello All!
I met a problem with actions enablement!
I have several actions which are grouped into "action set" by coresponding
extension in plugin.xml. Logically this actions don't relate to any view
or editor, they correspond to my own self-defined perspective.These
actions are appeared in Main menu and work fine ("run" methods leads to
expected results). But i cann't find a way to control enablement of these
actions, because i implement IWorkbenchWindowActionDelegatenot not Action
directly.
I tried to use special <enablement> element of "action" extenstion with
<systemProperty> condition but don't get necessary behavoir. Enablement
was changed only if SelectionChanged event occured in some View o Editor
Part. But such behavoir do not cover situation when execution of one
action affect on enable state of other action.
Problem may be simplified to the following situation:
i want to have 2 actions which can change enblement of each other. In
other words when i click into one button on main tool bar, another button
become disable and vice versa.
Could you help me solve my problem?
With best wishes,
Konstantin Laskovenko,
Mirasoft Ltd, Kiev, Ukraine.
|
|
|
Re: How can i change enable/disable state of actions defined by ActionSet extension? [message #30606 is a reply to message #30535] |
Wed, 14 May 2003 04:24   |
Eclipse User |
|
|
|
Originally posted by: tom.eicher.gmx.ch.nodomain
Konstantin
You will have to control the enablement of your actions directly in the Java
code to handle complex cases that cannot be expressed in the extension
point's xml. You can create actions in code and insert them into any menu,
and subsequently control their enablement state using Action.setEnable().
This is a problem if you are trying to add actions to an existing plugin
(e.g. an editor), since you shouldn't modify its code. AFAIK, there is no
easy way around that.
-tom
"Konstantin Laskovenko" <kostyal@mirasoft.com.ua> wrote in message
news:b9sq0k$bdr$1@rogue.oti.com...
> Hello All!
>
> I met a problem with actions enablement!
>
> I have several actions which are grouped into "action set" by coresponding
> extension in plugin.xml. Logically this actions don't relate to any view
> or editor, they correspond to my own self-defined perspective.These
> actions are appeared in Main menu and work fine ("run" methods leads to
> expected results). But i cann't find a way to control enablement of these
> actions, because i implement IWorkbenchWindowActionDelegatenot not Action
> directly.
> I tried to use special <enablement> element of "action" extenstion with
> <systemProperty> condition but don't get necessary behavoir. Enablement
> was changed only if SelectionChanged event occured in some View o Editor
> Part. But such behavoir do not cover situation when execution of one
> action affect on enable state of other action.
>
> Problem may be simplified to the following situation:
> i want to have 2 actions which can change enblement of each other. In
> other words when i click into one button on main tool bar, another button
> become disable and vice versa.
>
> Could you help me solve my problem?
>
> With best wishes,
> Konstantin Laskovenko,
> Mirasoft Ltd, Kiev, Ukraine.
>
>
|
|
|
Re: How can i change enable/disable state of actions defined by ActionSet extension? [message #31582 is a reply to message #30535] |
Wed, 14 May 2003 10:57  |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
You should also open a problem report against Platform - UI. The
<enablement> element is only evaluated when a selection change occurs. But
from some things in this element, its not dependent on the selection
changing (like in your case systemProperty, etc)
Simon :-)
"Konstantin Laskovenko" <kostyal@mirasoft.com.ua> wrote in message
news:b9sq0k$bdr$1@rogue.oti.com...
> Hello All!
>
> I met a problem with actions enablement!
>
> I have several actions which are grouped into "action set" by coresponding
> extension in plugin.xml. Logically this actions don't relate to any view
> or editor, they correspond to my own self-defined perspective.These
> actions are appeared in Main menu and work fine ("run" methods leads to
> expected results). But i cann't find a way to control enablement of these
> actions, because i implement IWorkbenchWindowActionDelegatenot not Action
> directly.
> I tried to use special <enablement> element of "action" extenstion with
> <systemProperty> condition but don't get necessary behavoir. Enablement
> was changed only if SelectionChanged event occured in some View o Editor
> Part. But such behavoir do not cover situation when execution of one
> action affect on enable state of other action.
>
> Problem may be simplified to the following situation:
> i want to have 2 actions which can change enblement of each other. In
> other words when i click into one button on main tool bar, another button
> become disable and vice versa.
>
> Could you help me solve my problem?
>
> With best wishes,
> Konstantin Laskovenko,
> Mirasoft Ltd, Kiev, Ukraine.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03324 seconds