|ACTIVE_PART: exactly when is it set? [message #1104322]
||Sun, 08 September 2013 06:21
| Andreas Buchen
Registered: July 2009
I decided to migrate my little RCP project to Eclipse 4... and ran into this question:
When exactly is the ACTIVE_PART available?
I have a handler (see below) with a @CanExecute annotation. The "part" is usually not null and everything I expect it to be. However, right after startup - the part is restored alright - "part" is null and therefore the menu is disabled. Once I click into the part, or on the tab (it is a PartStack), everything works as expected.
boolean isVisible(@Named(IServiceConstants.ACTIVE_PART) MPart part)
return null != part && part.getObject() instanceof PortfolioPart
&& ((PortfolioPart) part.getObject()).getFile() != null;
I am using Kepler 4.3
Powered by FUDForum
. Page generated in 0.01720 seconds