Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2020-01-11 16:26:58 -0500
committerPaul Pazderski2020-01-17 14:39:34 -0500
commitba77a9eb15753401e8f2c4d6413151244669cb7a (patch)
tree9ed0be938dd70a5978fa4f262e370c532c29ee8f
parentef601e2f25021d9b861b231dcb100738f7e1b989 (diff)
downloadeclipse.platform.debug-ba77a9eb15753401e8f2c4d6413151244669cb7a.tar.gz
eclipse.platform.debug-ba77a9eb15753401e8f2c4d6413151244669cb7a.tar.xz
eclipse.platform.debug-ba77a9eb15753401e8f2c4d6413151244669cb7a.zip
Bug 229202 - [console] Open link in console context menu gets disabled
when activating Consequence was that context menu showed an active menu entry to open link but nothing was opened/executed. Change-Id: Ia2db5fe2caf3f7de9735e99732c691ba9c163e85
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java2
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java18
2 files changed, 9 insertions, 11 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
index 467b11fc2..01a0b8111 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
@@ -359,7 +359,7 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
menuManager.add(new Separator("FIND")); //$NON-NLS-1$
menuManager.add(fGlobalActions.get(ActionFactory.FIND.getId()));
- menuManager.add(new FollowHyperlinkAction(fViewer));
+ menuManager.add(new FollowHyperlinkAction(fViewer.getHyperlink()));
menuManager.add(fClearOutputAction);
menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java
index 8eca78902..461432766 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,6 @@ package org.eclipse.ui.internal.console;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.IHyperlink;
-import org.eclipse.ui.console.TextConsoleViewer;
/**
* Follows a hyperlink in the console
@@ -25,30 +24,29 @@ import org.eclipse.ui.console.TextConsoleViewer;
*/
public class FollowHyperlinkAction extends Action {
- private TextConsoleViewer viewer;
+ private IHyperlink hyperlink;
/**
* Constructs a follow link action.
*
- * @param consoleViewer the viewer containing the link
+ * @param hyperlink the hyperlink to follow when activated
*/
- public FollowHyperlinkAction(TextConsoleViewer consoleViewer) {
+ public FollowHyperlinkAction(IHyperlink hyperlink) {
super(ConsoleMessages.FollowHyperlinkAction_0);
setToolTipText(ConsoleMessages.FollowHyperlinkAction_1);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_OPEN_LINK_ACTION);
- this.viewer = consoleViewer;
+ this.hyperlink = hyperlink;
}
@Override
public boolean isEnabled() {
- return viewer.getHyperlink() != null;
+ return hyperlink != null;
}
@Override
public void run() {
- IHyperlink link = viewer.getHyperlink();
- if (link != null) {
- link.linkActivated();
+ if (hyperlink != null) {
+ hyperlink.linkActivated();
}
}

Back to the top