Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferrazzutti2015-05-20 22:01:25 +0000
committerAlexander Kurtakov2015-06-05 12:45:41 +0000
commited7ed4379cbd084d34e551713a643f81b64be02e (patch)
treea1f288285f1f235a0d2f9c1767879bb60d6c4c1a /changelog
parent30dbd49d24cec1846a2396e3fa16f1483ec7a163 (diff)
downloadorg.eclipse.linuxtools-ed7ed4379cbd084d34e551713a643f81b64be02e.tar.gz
org.eclipse.linuxtools-ed7ed4379cbd084d34e551713a643f81b64be02e.tar.xz
org.eclipse.linuxtools-ed7ed4379cbd084d34e551713a643f81b64be02e.zip
rpm: adjust handler enablement.
* Handlers of RPM commands that make changes to a spec file are now only active in a spec file editor context. * Adjust the commands themselves so that they do not throw a ClassCastException when an unexpected editor type is active. * Update changelog's FormatChangeLogAction to match the code style of the adjusted RPM commands. * In rpm.core, create a plugin definition for RPM file selections and use it to condense various plugin.xml files in RPM projects. Resolves auto-reported problem 54f3491ce4b0eb19d1a17116. Change-Id: Ie91633476f479da42be7f87de8071832c2335a3b Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com> Reviewed-on: https://git.eclipse.org/r/48328 Tested-by: Hudson CI Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'changelog')
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java
index 0ba6ad5ad6..59c9c0c185 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java
@@ -25,15 +25,12 @@ public class FormatChangeLogAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
- if (editor == null || !(editor instanceof ChangeLogEditor)) {
- return null;
+ if (editor instanceof ChangeLogEditor) {
+ SourceViewer srcViewer = (SourceViewer) ((ChangeLogEditor) editor).getMySourceViewer();
+ if (srcViewer != null) {
+ srcViewer.doOperation(ISourceViewer.FORMAT);
+ }
}
-
- SourceViewer srcViewer = (SourceViewer) ((ChangeLogEditor) editor).getMySourceViewer();
- if (srcViewer != null) {
- srcViewer.doOperation(ISourceViewer.FORMAT);
- }
-
return null;
}

Back to the top