Skip to content

Commit 97ba21c

Browse files
committed
EDIT: Context menu entry is now only shown when the selection is an IProject which is open.
1 parent 768ff69 commit 97ba21c

1 file changed

Lines changed: 26 additions & 21 deletions

File tree

plugin.xml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,38 @@
44
<extension point="org.eclipse.ui.commands">
55
<category name="JCE" id="JCE.commands.category" />
66
<command name="Ecorify From..." categoryId="JCE.commands.category" id="JCE.commands.ecorifyCommand" />
7-
<command
8-
categoryId="JCE.commands.category"
9-
id="JCE.commands.extractCommand"
10-
name="Extract From...">
11-
</command>
7+
<command categoryId="JCE.commands.category" id="JCE.commands.extractCommand" name="Extract From..." />
128
</extension>
139
<extension point="org.eclipse.ui.handlers">
1410
<handler commandId="JCE.commands.ecorifyCommand" class="jce.handlers.EcorificationHandler" />
15-
<handler
16-
class="jce.handlers.ExtractionHandler"
17-
commandId="JCE.commands.extractCommand">
18-
</handler>
11+
<handler class="jce.handlers.ExtractionHandler" commandId="JCE.commands.extractCommand" />
1912
</extension>
2013
<extension point="org.eclipse.ui.menus">
21-
<menuContribution locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
22-
<menu
23-
icon="src/main/resources/jce.gif"
24-
label="JCE"
25-
tooltip="Java Code Ecorification">
26-
<command commandId="JCE.commands.ecorifyCommand" id="JCE.menus.extractCommand" label="Ecorify Java Project..." mnemonic="S" tooltip="Start the Ecorification of Java code." />
27-
<command
28-
commandId="JCE.commands.extractCommand"
29-
id="JCE.menus.extractCommand"
30-
label="Extract Ecore Metamodel..."
31-
tooltip="Start only the Ecore metamodel extraction of the Ecorification of Java code.">
14+
<menuContribution locationURI="popup:org.eclipse.ui.popup.any">
15+
<menu icon="src/main/resources/jce.gif" label="JCE" tooltip="Java Code Ecorification">
16+
<command commandId="JCE.commands.ecorifyCommand" id="JCE.menus.extractCommand" label="Ecorify Java Project..." mnemonic="S" tooltip="Start the Ecorification of Java code.">
17+
<visibleWhen>
18+
<with variable="activeMenuSelection">
19+
<iterate ifEmpty="false">
20+
<adapt type="org.eclipse.core.resources.IProject">
21+
<test property="org.eclipse.core.resources.open" value="open" />
22+
</adapt>
23+
</iterate>
24+
</with>
25+
</visibleWhen>
26+
</command>
27+
<command commandId="JCE.commands.extractCommand" id="JCE.menus.extractCommand" label="Extract Ecore Metamodel..." tooltip="Start only the Ecore metamodel extraction of the Ecorification of Java code.">
28+
<visibleWhen>
29+
<with variable="activeMenuSelection">
30+
<iterate ifEmpty="false">
31+
<adapt type="org.eclipse.core.resources.IProject">
32+
<test property="org.eclipse.core.resources.open" value="open" />
33+
</adapt>
34+
</iterate>
35+
</with>
36+
</visibleWhen>
3237
</command>
3338
</menu>
3439
</menuContribution>
3540
</extension>
36-
</plugin>
41+
</plugin>

0 commit comments

Comments
 (0)