Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:56 Go to next message
Denis Aristov is currently offline Denis AristovFriend
Messages: 15
Registered: March 2013
Location: Moscow
Junior Member
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 13:16 Go to previous message
Denis Aristov is currently offline Denis AristovFriend
Messages: 15
Registered: March 2013
Location: Moscow
Junior Member
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 13:18]

Report message to a moderator

Previous Topic:Building Eclipse JDT From Source
Next Topic:Neon fails to install on Ubuntu 16.04
Goto Forum:
  


Current Time: Sat Sep 23 05:44:43 GMT 2017

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

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