Community
Participate
Working Groups
Build ID: I20080330-1350 I have a console pattern matcher with a IHyperlink. Left clicking on a hyperlink in the console behaves as expected. However, when I right click on a hyperlink created and select "Open Link" nothing happens. This is because the TextConsoleViewer receives a mouseExit call which in turn calls linkExited on the selected hyperlink before the hyperlink is activated. Next the enablement of the action is checked and since TextConsoleViewer set the link to null, the action is not executed. To fix this, I suggest populating FollowHyperlinkAction with the hyperlink to activate at creation. The enablement could then be hyperlink != null. FollowHyperLinkAction.java: public class FollowHyperlinkAction extends Action { private TextConsoleViewer viewer; private IHyperLink hyperlink; /** * Constructs a follow link action */ public FollowHyperlinkAction(TextConsoleViewer consoleViewer) { super(ConsoleMessages.FollowHyperlinkAction_0); setToolTipText(ConsoleMessages.FollowHyperlinkAction_1); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_OPEN_LINK_ACTION); this.viewer = consoleViewer; this.hyperlink = consoleViewer.getHyperLink(); } /* (non-Javadoc) * @see org.eclipse.jface.action.IAction#isEnabled() */ public boolean isEnabled() { return hyperlink != null; } /* * (non-Javadoc) * @see org.eclipse.jface.action.IAction#run() */ public void run() { if (hyperlink != null) { hyperlink .linkActivated(); } } }
I'm thinking 'console' is owned by Debug...if not punt it back.
*** Bug 262310 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.
New Gerrit change created: https://git.eclipse.org/r/155651
Gerrit change https://git.eclipse.org/r/155651 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=ba77a9eb15753401e8f2c4d6413151244669cb7a
Thanks Adam. Fixed with your suggestion.
@Paul, Any possibility of testcase for this? I tried with a simple hyperlink in console and right click worked without this change also.
Right click worked and the menu entry is enabled but when the 'Open link' entry is selected the link action (e.g. open exception class) was not performed. The last step failed reliable for me without the change.
Created attachment 281872 [details] Opening hyperlink with 4.14 Am I missing anything?
No. Apparently it was wrong from me to change the platform. The bug depends on how menus are handled it is indeed platform dependent. I tried it with 4.14 and I20200218-1800 and verified it is fixed on Windows. Sorry for the hassle.