Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] selectionChanged method--only way to change enabled/disabled stat e of an action?


There is no API to do this. I would suggest you open a bug report against Platform - UI to describe your use case(s). We would need to address both cases - updating the action while your plugin is not yet loaded, and updating the action by the delegate once the plugin is loaded.

Simon :-)



"Levinson, Aaron N" <aaron.n.levinson@xxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx

03/05/03 03:26 PM
Please respond to platform-ui-dev

       
        To:        "'platform-ui-dev@xxxxxxxxxxx'" <platform-ui-dev@xxxxxxxxxxx>
        cc:        
        Subject:        [platform-ui-dev] selectionChanged method--only way to change enabled/disabled stat e of an action?



All,

Is the selectionChanged method (implemented by an action's delegate) the
only generic way, using Eclipse APIs, to change the enabled/disabled state
of an action based a user's actions?  The way I understand it, in the
workbench, if the user changes the selection state, the selectionChanged
method will be called on all action delegates that have been loaded.  Within
the implementation of the selectionChanged event handler, the respective
action delegate can determine if the action that it manages should be
enabled or disabled and set the enable/disabled state of the action
appropriately.

However, is there a solution, using Eclipse APIs, to handle generic
enabled/disabled state criteria?  For instance, certain actions'
enabled/disabled states may not depend on the selection in the workbench.
On Windows, there is the concept of the idle loop in GUI applications, and
whenever the application is idle, a message is sent that allows the
application to go through its update handlers, and each update handler
enables/disables the command it handles as appropriate.  Does a similar
concept exist with Eclipse?  Possibly, one solution would be for the plug-in
that provides the action(s) to setup a timer with a 0 ms period, and it
would handle the updates whenever the timer fires.  Perhaps this would
"simulate" the idle loop in GUI applications on Windows.

Thanks for any help!

Aaron Levinson
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev



Back to the top