[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Contribute both a command Id plus an action implementation to another plugin.

Gary E. Barnes wrote:

I'm using 3.2. There doesn't appear to be a HandlerUtil in 3.2. So I'm doing,

OK, in 3.2 you're using the best code, although you can actually use ISources.ACTIVE_PART_NAME instead of the string literal.


You can also simply supply a default handler in your command definition (but you can only supply one).

Does that work in 3.2? It is documented in the 3.2 Help files but if I specify a default handler it never gets invoked. Never even gets constructed (I put a breakpoint in the constructor).

It should work, but maybe that's a bug in 3.2 ... a number of bugs with commands, handlers, and menus were fixed in 3.3, and even more in 3.4M4 (M5 will be coming out in 3 weeks or so).



With the activeWhen commented out the handler is never invoked. With the activeWhen not commented out then the handler is invoked.

Is there perhaps a way to specify an activeWhen expression that is simply a constant TRUE literal? Looking at the documentation there doesn't seem to be a way.

Your syntax looks correct, it must be a bug in 3.2. If you can write a property tester in 3.2(depend on org.eclipse.core.expressions plugin) that extends PropertyTester then you can just return TRUE all the time.


Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench.htm