|
Re: Hiding commands' UI elements [message #491242 is a reply to message #491154] |
Tue, 13 October 2009 18:54 |
|
Hi,
I believe you are looking for activities in combination with your own
source provider.
This might help:
http://www.vogella.de/blog/2009/07/13/eclipse-activities/
http://www.vogella.de/articles/EclipseCommands/article.html# commmands_sourceprovider
Best regards, Lars
joel.becker@21csi.com wrote:
> Hello. I have a toggle Command that must toggle the visibility of four
> other Commands. They are all contributed to a view's toolbar as toolbar
> buttons. Does anyone know how to do this? Please help.
> It sounds like it would be so simple, but I've been researching this and
> trying things for about 9 hours total now without any success. One thing
> I tried was having a static member variable in the toggle command's
> IHandler, which the other commands use in their isEnabled() methods to
> decide whether they should be enabled or not. The problem with this is
> that isEnabled() is only called at initialization (not to mention that
> the member having to be static means that it will toggle the commands in
> all instances of the view, but i'm desperate at this point.)
>
|
|
|
Re: Hiding commands' UI elements [message #495431 is a reply to message #491242] |
Wed, 04 November 2009 20:21 |
Joel Messages: 16 Registered: October 2009 |
Junior Member |
|
|
Activities apparently only work on the whole workbench-scope; is there something that can show/hide UI elements depending on which view? For example, show them in one view, but hide them in another instance of the view (same view id).
<edit>Is there a way to do it with "contexts"? (org.eclipse.ui.context) </edit>
Thanks so much for that helpful information. This was a huge step. The SourceProvider came in useful for something too.
[Updated on: Wed, 04 November 2009 20:37] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03178 seconds