Toolbar action in inactive plugin [message #262669] |
Thu, 07 August 2008 09:25  |
Eclipse User |
|
|
|
Originally posted by: wieant.nielander.altium.nl
Hi,
I have a toolbar action with a dropdown menu that, when selected, shows a list with a kind of
history of previously selected projects. This list is built using the action's selectionChanged()
method. Problem is that initially the plugin containing this action is not active, and hence
the selectionChanged() method is not called. When the plugin is actually activated, e.g. by
selecting the given action, it may have missed several selection changes. A similar action in a
plugin that does get activated at startup seems to work fine. So my question is if it is possible to
implement this selection-tracking without having to reside to using the startup extension point for
the plugin?
Regards,
Wieant
|
|
|
Re: Toolbar action in inactive plugin [message #262671 is a reply to message #262669] |
Thu, 07 August 2008 09:34   |
Eclipse User |
|
|
|
Wieant,
No, I think you need to force your plugin to activate eagerly if you
want this to start before your action is first invoked by the user.
Wieant Nielander wrote:
> Hi,
>
> I have a toolbar action with a dropdown menu that, when selected,
> shows a list with a kind of history of previously selected projects.
> This list is built using the action's selectionChanged() method.
> Problem is that initially the plugin containing this action is not
> active, and hence
> the selectionChanged() method is not called. When the plugin is
> actually activated, e.g. by selecting the given action, it may have
> missed several selection changes. A similar action in a plugin that
> does get activated at startup seems to work fine. So my question is if
> it is possible to implement this selection-tracking without having to
> reside to using the startup extension point for the plugin?
>
> Regards,
> Wieant
|
|
|
Re: Toolbar action in inactive plugin [message #262677 is a reply to message #262671] |
Thu, 07 August 2008 10:02   |
Eclipse User |
|
|
|
Originally posted by: wieant.nielander.altium.nl
>> I have a toolbar action with a dropdown menu that, when selected,
>> shows a list with a kind of history of previously selected projects.
>> This list is built using the action's selectionChanged() method.
>> Problem is that initially the plugin containing this action is not
>> active, and hence
>> the selectionChanged() method is not called. When the plugin is
>> actually activated, e.g. by selecting the given action, it may have
>> missed several selection changes. A similar action in a plugin that
>> does get activated at startup seems to work fine. So my question is if
>> it is possible to implement this selection-tracking without having to
>> reside to using the startup extension point for the plugin?
> No, I think you need to force your plugin to activate eagerly if you
> want this to start before your action is first invoked by the user.
Thanks, using the startup extension does do the trick, but still, the following quote keeps echoing
in my head:
"In other words, if you think you "need" to activate your plugin on startup, think again. If you
still think you "need" to, think again. Repeat until you realize you don't really need to do it. :-) "
|
|
|
Re: Toolbar action in inactive plugin [message #262679 is a reply to message #262677] |
Thu, 07 August 2008 10:57  |
Eclipse User |
|
|
|
Wieant,
Well yes, everyone always thinks their function is so important it
simply must be fully functional before any user even thinks to use it
and that tends to cause everything to activate which makes the overall
combined result slow and bloated. So indeed you should think many times
before doing this. But clearly in you need something that's actively
keeping a history of selections, you need real code that's running up
front...
Wieant Nielander wrote:
> >> I have a toolbar action with a dropdown menu that, when selected,
> >> shows a list with a kind of history of previously selected projects.
> >> This list is built using the action's selectionChanged() method.
> >> Problem is that initially the plugin containing this action is not
> >> active, and hence
> >> the selectionChanged() method is not called. When the plugin is
> >> actually activated, e.g. by selecting the given action, it may have
> >> missed several selection changes. A similar action in a plugin that
> >> does get activated at startup seems to work fine. So my question is if
> >> it is possible to implement this selection-tracking without having to
> >> reside to using the startup extension point for the plugin?
>
>> No, I think you need to force your plugin to activate eagerly if you
>> want this to start before your action is first invoked by the user.
>
> Thanks, using the startup extension does do the trick, but still, the
> following quote keeps echoing in my head:
>
> "In other words, if you think you "need" to activate your plugin on
> startup, think again. If you still think you "need" to, think again.
> Repeat until you realize you don't really need to do it. :-) "
|
|
|
Powered by
FUDForum. Page generated in 0.10126 seconds