Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding hyperlink capabilities for text displayed on Text(Similar to the hyperlinked text displayed on Console)
icon5.gif  Adding hyperlink capabilities for text displayed on Text [message #1147671] Mon, 21 October 2013 02:06 Go to next message
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
Hi everyone,

One of my plug-ins define a view (by extending ViewPart). It is a very simple implementation where I show some information to the developer using a Text (org.eclipse.swt.widgets.Text) component.

I would like to add hyperlink capabilities to the text shown inside my Text component. What I mean by hyperlink capabilities is very similar to what Eclipse's default Console already does. For example, if I have "org.eclipse.core.internal.resources.ResourceException" in my Console output, then it is clickable and if I click it, it takes me to "Java Exception Breakpoint" dialog.

As an example, I would like to do the following:
If my text in the Text component contains the following element:
com.kivancmuslu.www.solstice.continuous.testing.client.ContinuousTesting.runAnalysis(ContinuousTesting.java:160)

I would like ContinuousTesting.java:160 to be clickable and when the developer clicks on it, I would like the capability to open the ContinuousTesting.java, line 160 in the active Eclipse editor.

It would be great if there is support for this by default (e.g., for exception traces), but I also would not mind writing some code to transform the trace into a format that Eclipse understands.

I have chosen Text as my main component because it was easy to use (and did what I needed), if Text does not support what I want to do, please let me know if there is another Component that I can use to do the same thing (but still be able to display text in it).

Any pointers, api, example code appreciated.

Thanks, best regards,

[Updated on: Mon, 21 October 2013 02:07]

Report message to a moderator

Re: Adding hyperlink capabilities for text displayed on Text [message #1153732 is a reply to message #1147671] Thu, 24 October 2013 20:29 Go to previous message
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
After more investigation, I realized that this cannot really be done using the Text component.

That being said, I also realized that Eclipse Console (ConsoleView) already does it, so I tried extending and using a MessageConsole Component to show my messages to the developer. However, the text I write to the MessageConsole (through its stream) does not get auto-hyperlinked. Does anyone have an idea why this is the case? Isn't there any way to re-use the auto-hyperlink that Eclipse ConsoleView uses? My text is already in the format (filename:linenumber) that Eclipse ConsoleView expects.

Thanks,
Previous Topic:Application works using "Debug As", But fails using "Run As"
Next Topic:How to create a FileLink for an external library resource
Goto Forum:
  


Current Time: Thu Mar 28 11:46:37 GMT 2024

Powered by FUDForum. Page generated in 0.02082 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top