Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Prevent "Quick Access" field from displaying commands
Prevent "Quick Access" field from displaying commands [message #1749562] Thu, 08 December 2016 02:56 Go to next message
Eclipse UserFriend
Recently I noticed that if I type a command id in the "Quick Access" field the command will appear in the list and can be executed by clicking on it.

But this was not the idea. The commands should only be called under specific conditions (e.g. the right object is selected ...). I've specified all the necessary conditions in plugin.xml and they work. But "Quick Access" field allows access to the commands just so... Great Smile

How to prevent it?
Re: Prevent "Quick Access" field from displaying commands [message #1749592 is a reply to message #1749562] Thu, 08 December 2016 08:16 Go to previous message
Eclipse UserFriend
I think I've found a solution. The command should delegate the job to its handler. This can be achieved by moving everything from command's <visibleWhen> to handler's <activeWhen>.

For example:

<command commandId="a"
<visibleWhen
checkEnabled="true"> This attribute value delegates all the tests to the handler
</visibleWhen>
</command>

...

<handler>
...
<activeWhen checkEnabled="false">
<with variable="selection">
<and>
<iterate ifEmpty="false" operator="or">
<instanceof
value="java.lang.String">
</instanceof>
</iterate>
<test
property="somePropertyTester.CONNECTED_TO_RIGHT_DB">
</test>
</and>
</with>
</activeWhen>
...
</handler>

[Updated on: Thu, 08 December 2016 08:18] by Moderator

Previous Topic:How do I remove applet from "run as" permanently
Next Topic:Unable to run Java class
Goto Forum:
  


Current Time: Thu May 22 06:27:58 EDT 2025

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

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

Back to the top