Popup Menu "Test" definition not working [message #327704] |
Tue, 29 April 2008 13:12 |
Eclipse User |
|
|
|
Originally posted by: outkastman.hotmail.com
I am having a bit of trouble getting a popup menu on a tree view to work
correctly. The TreeViewer is populated with "Reference" objects. Each
Reference contains a public "referenceId", once of which is "123". I have
debugged the tree and tripple checked to make sure the objects and id's
are correct. Here is a portion of my plugin xml :
My command:
<extension point="org.eclipse.ui.commands">
<category id ="category.edit" name="edit commands">
</category>
<command categoryId="category.edit" id="edit.task" name="Edit Task">
</command>
</extension>
My Handler:
<extension point="org.eclipse.ui.handlers">
<handler class="EditTaskHandler" commandId="edit.task">
</handler>
</extension>
My Popup :
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI ="popup:TaskTreeView">
<command commandId="edit.task"
icon="icons/edit_task.png"
label="Edit Task">
<visibleWhen>
<reference definitionId="isReferenceCheck">
</reference>
</visibleWhen>
</command>
</extension>
My definition :
<extension point="org.eclipse.core.expressions.definitions">
<definition id="isReferenceCheck">
<iterate>
<adapt type="Reference">
<test property ="referenceId" value="123">
</test>
</adapt>
</iterate>
</definition>
</extension>
The problem is, I get the "Edit Task" popup option anytime I right click
on the tree, even for items whose id is not 123 (I've debugged and
confirmed this). The menu option also always appears even when I do not
have anything selected. Can someone help me out?
Regards
Ps. Note : for simplicity I took out full package names in the plugin xml.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03941 seconds