How to put hyperlinks in the messages put into the eclipse console view [message #266925] |
Sat, 06 December 2008 01:22  |
Eclipse User |
|
|
|
Hi,
I want to use the eclipse consolo log view to log messages, when some
operation is executed.
I am able to log into the console view. But i am facing problem is
creating hyper-links in the messages put in console view.
I can create a separate view where i can put hyperlinks but i wanted to
re-use the eclipse console view. The hyperlinks can be used to navigate to
different views and editors.
Can you help me by guiding for "How to put hyperlinks in the messages put
into the eclipse console view" ? Is it possible ?
Thanks and Regards,
Ashwani
|
|
|
|
|
|
|
Re: How to put hyperlinks in the messages put into the eclipse console view [message #267016 is a reply to message #266948] |
Wed, 10 December 2008 23:49   |
Eclipse User |
|
|
|
Originally posted by: fastcodejava.gmail.com
I am using FileLink, but I always get BadLocationException.
My code looks like:
offset = this.messageConsole.getDocument().getLength();
messageConsole.addHyperlink(new FileLink(file,
"org.eclipse.jdt.ui.CompilationUnitEditor", 0, 1, 0),
this.offset, file.getName().length());
Thanks in advance,
--Gautam
Ashwani Kr Sharma wrote:
> Hi,
>
> Yes, the logic is pretty simple. The problem was that the console's
> document was getting updated in a UIJob asynchrously.
> Hence, one has to wait till the document is updated and then decorate
> the hyperlink. [ else location where hyperlink has to be populated will
> never be correct because it might not exist till than. ]
> It is something similar to patterMatcher which gets involed after
> document is updated.
>
> But i did it via DocumentEventListener. When the document is udpated
> notification is given back where i decorate the hyperlinks.
>
> Thanks a lot for you answers. They were very helpful.
>
> Best Regards,
> Ashwani Kr Sharma
>
|
|
|
Re: How to put hyperlinks in the messages put into the eclipse console view [message #267018 is a reply to message #267016] |
Thu, 11 December 2008 01:48  |
Eclipse User |
|
|
|
G Gev wrote:
> I am using FileLink, but I always get BadLocationException.
> My code looks like:
>
> offset = this.messageConsole.getDocument().getLength();
>
> messageConsole.addHyperlink(new FileLink(file,
> "org.eclipse.jdt.ui.CompilationUnitEditor", 0, 1, 0),
> this.offset, file.getName().length());
You need to try debugging or rethink how to use this method because the
parameters you're passing it looks incorrect. You should rethink your
offsets. In particular, addHyperlink doesn't add text to the document.
Remy
|
|
|
Powered by
FUDForum. Page generated in 0.06219 seconds