Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » org.eclipse.ui.handlers - enableWhen - selection count
org.eclipse.ui.handlers - enableWhen - selection count [message #327545] Thu, 24 April 2008 05:21 Go to next message
Eclipse UserFriend
Hello,

I've a command that only effects to a group of items (delete all). I want
that command to be only enabled if the current selection is greater 1.
My current definition is:
<handler
class="de.kohnert.ui.actions.RefuseAllSamplesAction"
commandId="de.kohnert.ui.actions.refuseAllSamplesAction">
<enabledWhen>
<and>
<reference
definitionId="de.kohnert.ui.isSample">
</reference>
<reference
definitionId="de.kohnert.ui.hasOpenRackEditor">
</reference>
<count
value="2">
</count>
</and>
</enabledWhen>
</handler>

My problem is, that I do not know what to write into count. The current
definition enables only if exactly two objects are selected.

How can I define a "greater than" clause?

Thanks!
Re: org.eclipse.ui.handlers - enableWhen - selection count [message #327566 is a reply to message #327545] Thu, 24 April 2008 14:50 Go to previous message
Eclipse UserFriend
What the count element allows is in the extension point description, or
in the help
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_h andlers.html

You can do "1 or more", but not general greater than.

You could always write your own propertyTester, see
org.eclipse.core.expressions.propertyTesters.

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
Previous Topic:compile error for source tar ball
Next Topic:Saving Template causes Eclipse to hang
Goto Forum:
  


Current Time: Sun May 04 10:58:23 EDT 2025

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

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

Back to the top