Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » ACTIVE_PART: exactly when is it set?
ACTIVE_PART: exactly when is it set? [message #1104322] Sun, 08 September 2013 02:21 Go to next message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
Hi,

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.

    @CanExecute
    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
Re: ACTIVE_PART: exactly when is it set? [message #1104680 is a reply to message #1104322] Sun, 08 September 2013 16:12 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
I should add: I am running on Mac OS X.
Re: ACTIVE_PART: exactly when is it set? [message #1115942 is a reply to message #1104680] Tue, 24 September 2013 15:56 Go to previous message
Eric Moffatt is currently offline Eric Moffatt
Messages: 118
Registered: July 2009
Senior Member
This may well be us faking you out. The CSS styling for the active stack is stored in the model but it may be that we aren't activating a part on startup.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=329458 for more details.

BTW, I've flagged that defect for a(nother) look in Luna M3.
Previous Topic:Auto adjust of toolbar item
Next Topic:No icons after exporting
Goto Forum:
  


Current Time: Thu Aug 28 03:13:57 EDT 2014

Powered by FUDForum. Page generated in 0.01803 seconds