Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [commands] Dynamic enablement observation
[commands] Dynamic enablement observation [message #487828] Thu, 24 September 2009 14:16 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
I would like to ask, whether there exists already
more or less direct support for my use-case, before
I reinvent the wheel:

In one of the menus of my RCP main menu I would like
to add a menu contribution (I use org.eclipse.ui.menus
and the command framework and use the declarative way via
the extension points) which allows me to save a copy
of the log file. Similar to the Error Log View I would like
to perform some form of auto-enablement based on the
existence of the log file. Ideally the corresponding
ILogListener would register as soon as any menu contribution
that represents this command becomes (potentially) visible.

Does there exists anywhere a dedicated point in the live-cycle
of menu contributions or the command itself that allows
me to perform this registration (and if possible deregistration)?

I would like to prevent a programmatic registration as part
of my *Advisors classes of my branding plugin, because this
should be done by a plug-in without access to the branding

Thanks in advance,

Daniel Krügler
Re: [commands] Dynamic enablement observation [message #487908 is a reply to message #487828] Thu, 24 September 2009 18:34 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In the declarative lifecycle, there aren't many programmatic points of injection.

The closest you can come for enablement is probably:

<handler ...
<test forcePluginActivation="true" property="com.example.isLogAvailable"/>

Then your property tester should add a listener if it's not there already and return the appropriate true/false.

In theory the first time something needs to ask that command if it is enabled, the property tester will get called.


Previous Topic:UI Forms Title Area Toolbar & Commands
Next Topic:view action enablement without selection provider
Goto Forum:

Current Time: Sat Jun 23 04:56:54 GMT 2018

Powered by FUDForum. Page generated in 0.02333 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top