aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Guzman2013-11-06 17:16:35 (EST)
committerAlexander Kurtakov2013-11-08 10:38:25 (EST)
commit81b8212dec5545374c33f0bc97168aa1aca830bc (patch)
treec5e4b69d9708e1a75f5737ece7f7d9f81f58e195
parent845db098079ba6b978100fa3e0e7df5988ec0bef (diff)
downloadorg.eclipse.linuxtools-81b8212dec5545374c33f0bc97168aa1aca830bc.zip
org.eclipse.linuxtools-81b8212dec5545374c33f0bc97168aa1aca830bc.tar.gz
org.eclipse.linuxtools-81b8212dec5545374c33f0bc97168aa1aca830bc.tar.bz2
RPM: hide menu when not in contextrefs/changes/55/18155/5
Before RPM menu was displaying on non-RPM projects, as long as the active editor was a specfile. Changed the menu to only display when the menu is on a specfile or a project with an RPMNature. Bug 418872 Change-Id: If77db8f5c4aecfb319b96a2a619d10c4d3bf232e Signed-off-by: Neil Guzman <nguzman@redhat.com> Reviewed-on: https://git.eclipse.org/r/18155 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> IP-Clean: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.core/META-INF/MANIFEST.MF3
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.core/plugin.xml27
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml56
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.ui.editor/plugin.xml182
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/markers/SpecfileTaskHandler.java4
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.ui/plugin.xml121
6 files changed, 196 insertions, 197 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.core/META-INF/MANIFEST.MF b/rpm/org.eclipse.linuxtools.rpm.core/META-INF/MANIFEST.MF
index 6bbe7dc..8776dda 100644
--- a/rpm/org.eclipse.linuxtools.rpm.core/META-INF/MANIFEST.MF
+++ b/rpm/org.eclipse.linuxtools.rpm.core/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.ui,
- org.eclipse.linuxtools.tools.launch.core;bundle-version="1.1.0"
+ org.eclipse.linuxtools.tools.launch.core;bundle-version="1.1.0",
+ org.eclipse.core.expressions
Export-Package:
org.eclipse.linuxtools.rpm.core,
org.eclipse.linuxtools.rpm.core.utils
diff --git a/rpm/org.eclipse.linuxtools.rpm.core/plugin.xml b/rpm/org.eclipse.linuxtools.rpm.core/plugin.xml
index 4f1ed80..522cd94 100644
--- a/rpm/org.eclipse.linuxtools.rpm.core/plugin.xml
+++ b/rpm/org.eclipse.linuxtools.rpm.core/plugin.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?><!--
- Copyright (c) 2009 Red Hat, Inc.
+ Copyright (c) 2009, 2013 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -23,4 +23,29 @@
<initializer
class="org.eclipse.linuxtools.internal.rpm.core.RPMCoreInitializer" />
</extension>
+<extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.eclipse.linuxtools.rpm.core.rpmfile">
+ <iterate
+ ifEmpty="false">
+ <or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.rpm.core.rpmnature">
+ </test>
+ </adapt>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test
+ property="org.eclipse.core.resources.name"
+ value="*.spec">
+ </test>
+ </adapt>
+ </or>
+ </iterate>
+ </definition>
+</extension>
</plugin>
diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml b/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml
index 870e784..0dc63f2 100644
--- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml
+++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml
@@ -53,32 +53,44 @@
<command
commandId="rpmlint.toggleRpmlint.command"
label="%addremovewarnings.name" >
- <visibleWhen>
- <iterate operator="and" ifEmpty="false">
- <adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.linuxtools.rpm.core.rpmnature"/>
- </adapt>
- </iterate>
- </visibleWhen>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
+ </visibleWhen>
</command>
<command
commandId="rpmlint.runRpmlint.command"
label="%runrpmlintcommand.label">
- <visibleWhen>
- <iterate operator="or" ifEmpty="false">
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <or>
- <test property="org.eclipse.core.resources.name" value="*.rpm"/>
- <test property="org.eclipse.core.resources.name" value="*.spec"/>
- </or>
- </adapt>
- <with variable="activeEditorId">
- <equals value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor"/>
- </with>
- </or>
- </iterate>
- </visibleWhen>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
+ </visibleWhen>
</command>
</menuContribution>
</extension>
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui.editor/plugin.xml b/rpm/org.eclipse.linuxtools.rpm.ui.editor/plugin.xml
index 4c0fdc7..1b90a0d 100644
--- a/rpm/org.eclipse.linuxtools.rpm.ui.editor/plugin.xml
+++ b/rpm/org.eclipse.linuxtools.rpm.ui.editor/plugin.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?><!--
- Copyright (c) 2009 Red Hat, Inc.
+ Copyright (c) 2009, 2013 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -312,52 +312,44 @@
commandId="rpmEditor.downloadSources.command"
label="%command.name.2"
tooltip="%command.name.2">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
</command>
<command
commandId="rpmEditor.prepareSources.command"
label="%command.name.3"
tooltip="%command.name.3">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
</command>
</menuContribution>
@@ -367,78 +359,66 @@
commandId="rpmEditor.toggleComment.command"
label="%command.label"
tooltip="%command.tooltip">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
</command>
<command
commandId="rpmEditor.organizePatches.command"
label="%command.label.0"
tooltip="%command.tooltip.0">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
</command>
<command
commandId="rpmEditor.showOutline.command"
label="%command.label.1"
tooltip="%command.tooltip.1">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
</command>
</menuContribution>
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/markers/SpecfileTaskHandler.java b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/markers/SpecfileTaskHandler.java
index 5372f53..eb1cb8a 100644
--- a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/markers/SpecfileTaskHandler.java
+++ b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/markers/SpecfileTaskHandler.java
@@ -25,7 +25,7 @@ import org.eclipse.ui.texteditor.MarkerUtilities;
/**
* A class designated to handle the tasks of a specfile.
*
- * @since 1.2.0
+ * @since 1.2
*/
public class SpecfileTaskHandler extends SpecfileMarkerHandler{
public static final String SPECFILE_TASK_MARKER_ID = Activator.PLUGIN_ID
@@ -47,7 +47,7 @@ public class SpecfileTaskHandler extends SpecfileMarkerHandler{
* @param file The FileEditorInput to get the file from.
* @param document The specfile document.
*
- * @since 1.2.0
+ * @since 1.2
*/
public SpecfileTaskHandler(FileEditorInput file, IDocument document) {
this(file.getFile(), document);
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui/plugin.xml b/rpm/org.eclipse.linuxtools.rpm.ui/plugin.xml
index 5dda03e..e455705 100644
--- a/rpm/org.eclipse.linuxtools.rpm.ui/plugin.xml
+++ b/rpm/org.eclipse.linuxtools.rpm.ui/plugin.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?><!--
- Copyright (c) 2009 Red Hat, Inc.
+ Copyright (c) 2009, 2013 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -126,31 +126,27 @@
label="%command.name.0"
mnemonic="S"
tooltip="%command.name.0">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
- </visibleWhen>
<parameter
name="buildType"
value="SOURCE">
</parameter>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
+ </visibleWhen>
</command>
<command
commandId="rpmEditor.build.command"
@@ -158,31 +154,27 @@
label="%command.name.1"
mnemonic="R"
tooltip="%command.name.1">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
- </visibleWhen>
<parameter
name="buildType"
value="BINARY">
</parameter>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
+ </visibleWhen>
</command>
<command
commandId="rpmEditor.build.command"
@@ -190,26 +182,22 @@
label="%command.name.2"
mnemonic="A"
tooltip="%command.name.2">
- <visibleWhen>
- <iterate
- ifEmpty="false"
- operator="or">
- <or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
- </equals>
- </with>
- </or>
- </iterate>
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activeMenuSelection">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ <with
+ variable="activeMenuEditorInput">
+ <reference
+ definitionId="org.eclipse.linuxtools.rpm.core.rpmfile">
+ </reference>
+ </with>
+ </or>
</visibleWhen>
<parameter
name="buildType"
@@ -256,13 +244,6 @@
ifEmpty="false"
operator="or">
<or>
- <adapt
- type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.core.resources.name"
- value="*.spec">
- </test>
- </adapt>
<with
variable="activeEditorId">
<equals