Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-04-12 14:14:05 -0400
committerAlexander Kurtakov2017-04-12 14:14:05 -0400
commitdffc6039d803e16e64902f716632d4c424b345c4 (patch)
tree9e15c61fa61da113c2c098d864e8a7a0c49f7242
parente4e135165c6c420b11c662c9f1929014dc632f67 (diff)
downloadorg.eclipse.dltk.sh-dffc6039d803e16e64902f716632d4c424b345c4.tar.gz
org.eclipse.dltk.sh-dffc6039d803e16e64902f716632d4c424b345c4.tar.xz
org.eclipse.dltk.sh-dffc6039d803e16e64902f716632d4c424b345c4.zip
Small cleanups.
* Make method private. * Use HandlerUtil.getCurrentSelection instead of chain of multiple calls achieving the same. Change-Id: I52851aa88f9921ab502a073ac80914102c2eb073 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/commands/ShowManHandler.java5
-rw-r--r--plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/selection/ShellDocumentationProvider.java4
2 files changed, 4 insertions, 5 deletions
diff --git a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/commands/ShowManHandler.java b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/commands/ShowManHandler.java
index e681168..f8d0f40 100644
--- a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/commands/ShowManHandler.java
+++ b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/commands/ShowManHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat Inc. and others.
+ * Copyright (c) 2009, 2017 Red Hat Inc. and others.
* 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
@@ -27,8 +27,7 @@ public class ShowManHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) {
try {
- ISelection selection = HandlerUtil.getActiveEditor(event).getEditorSite().getSelectionProvider()
- .getSelection();
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
String manPage = "";
if (selection instanceof TextSelection) {
TextSelection textSelection = (TextSelection) selection;
diff --git a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/selection/ShellDocumentationProvider.java b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/selection/ShellDocumentationProvider.java
index 1376164..9f9646a 100644
--- a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/selection/ShellDocumentationProvider.java
+++ b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/selection/ShellDocumentationProvider.java
@@ -37,7 +37,7 @@ public class ShellDocumentationProvider implements IScriptDocumentationProvider
return new StringReader(info);
}
- public static String getHelp(String command) {
+ private static String getHelp(String command) {
List<String> commands = new ArrayList<>();
commands.add("bash");
commands.add("-c");
@@ -55,7 +55,7 @@ public class ShellDocumentationProvider implements IScriptDocumentationProvider
out.append(buffer, 0, rsz);
}
} catch (IOException e) {
- // ignore
+ e.printStackTrace();
}
return out.toString();
}

Back to the top