I tried to add a menu item to package explorer's right click menu. But my menu item is not visible when i run my plugin. what am i missing?
here is my plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
<command
commandId="kodsayici.counter"
label="Count"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="menuSelection">
<iterate
ifEmpty="false"
operator="or">
<adapt
type="org.eclipse.jdt.core.ICompilationUnit">
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="kodsayici.Counter"
id="kodsayici.counter"
name="Count">
</command>
</extension>
</plugin>
I solved my problem.
menuSelection
is a wrong variable name. These variable names are predefined (Command_Core_Expressions). If change menuSelection toactiveMenuSelection
, my plugin works.