Bug 229202 - [console] Open Link in Console Context Menu Gets Disabled When Activating
Summary: [console] Open Link in Console Context Menu Gets Disabled When Activating
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows All
: P2 normal (vote)
Target Milestone: 4.15 M3   Edit
Assignee: Paul Pazderski CLA
QA Contact:
URL:
Whiteboard: 4.15 M2
Keywords: usability
: 262310 (view as bug list)
Depends on:
Blocks: 553348
  Show dependency tree
 
Reported: 2008-04-28 19:55 EDT by Adam Cabler CLA
Modified: 2020-02-20 08:01 EST (History)
5 users (show)

See Also:


Attachments
Opening hyperlink with 4.14 (2.08 MB, video/quicktime)
2020-02-20 07:50 EST, Sarika Sinha CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Cabler CLA 2008-04-28 19:55:18 EDT
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();
		}
	}

}
Comment 1 Eric Moffatt CLA 2008-04-29 16:33:12 EDT
I'm thinking 'console' is owned by Debug...if not punt it back.
Comment 2 Darin Wright CLA 2009-06-09 16:15:41 EDT
*** Bug 262310 has been marked as a duplicate of this bug. ***
Comment 3 Lars Vogel CLA 2019-11-14 02:22:53 EST
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.
Comment 4 Eclipse Genie CLA 2020-01-11 16:28:42 EST
New Gerrit change created: https://git.eclipse.org/r/155651
Comment 6 Paul Pazderski CLA 2020-01-17 14:56:46 EST
Thanks Adam. Fixed with your suggestion.
Comment 7 Sarika Sinha CLA 2020-02-20 06:34:59 EST
@Paul,
Any possibility of testcase for this?

I tried with a simple hyperlink in console and right click worked without this change also.
Comment 8 Paul Pazderski CLA 2020-02-20 06:47:19 EST
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.
Comment 9 Sarika Sinha CLA 2020-02-20 07:50:09 EST
Created attachment 281872 [details]
Opening hyperlink with 4.14

Am I missing anything?
Comment 10 Paul Pazderski CLA 2020-02-20 08:01:43 EST
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.