Toolbar icon starting in disabled state [message #314085] |
Tue, 03 April 2007 03:32  |
Eclipse User |
|
|
|
Hi All,
I have an "actionSets" plug-in (very simple, based on the HelloWorld
template).
I use "selectionChanged" and "ResourceChangeListener" during the life of
the plug-in to handle the enabled state of his toolbar icon. This is fine.
But, I would like his toolbar icon start in disabled (grey) state when
Eclipse is launched.
In my Action class,
the action() constructor
the init() method
the run() method
the selectionChanged() method
etc...
are all called too late (on a mouse click, after the icon is drawn on the
toolbar).
Is there a way to send a setEnable(false) to my icon before the icon is
drawn by eclipse (or just after :-) ?
--
Philippe
|
|
|
|
|
Re: Toolbar icon starting in disabled state [message #314108 is a reply to message #314107] |
Tue, 03 April 2007 11:44   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Philippe,
This does sound better. Sorry, I don't really know how to do that
though. Maybe someone else will have a good suggestion.
Isn't it also okay just to be enabled and when the user clicks on it, it
will suddenly become disabled if that's the state it should actually be
in? That would be the "standard Eclipse way", I think...
Philippe wrote:
> Thanks Ed,
>
> You're right, of course, I agree with the Eclipse behavior.
> I thought of a field in the xml definition.
> As for the "state" flag which functions for "toggle" buttons.
> Maybe there is a better approach:
>
> The main task of my plugin is to manage a CDT project.
> My wanted behavior is: No project = No icon or Disabled icon.
> Maybe it's possible to create the actionSet after the CDT project is
> created.
> I mean: If I don't use actionSet xml extension, Eclipse don't create
> my toolbar. Then, when a project is created (instantiating my CDT
> plugin), I create the toolbar with my icon...
>
> Would this be correct?
> Is there a sample source code to do that?
|
|
|
|
Re: Toolbar icon starting in disabled state [message #314774 is a reply to message #314142] |
Mon, 23 April 2007 12:16  |
Eclipse User |
|
|
|
Originally posted by: eddie.streambase.com
Philippe wrote:
> Thanks Ed,
>
> This is exactly what I do, while waiting better :-).
>
> Ed Merks wrote:
>
>> Isn't it also okay just to be enabled and when the user clicks on it,
>> it will suddenly become disabled if that's the state it should
>> actually be in?
>
>
What I did, a variation may work for you:
I set enablesFor to + and the enablement to not(objectClass,
java.lang.Object)
I still think eclipse should have a way to say "starts disabled"
succintly.
- Eddie
|
|
|
Powered by
FUDForum. Page generated in 0.07282 seconds