hyperlink functionality : show always? [message #321119] |
Tue, 09 October 2007 11:25  |
Eclipse User |
|
|
|
Originally posted by: e.lynch.pilz.ie
Hi
I am implementing hyperlink functionality in a Custom Text editor. I am
using the extension points
org.eclipse.ui.workbench.texteditor.hyperlinkDetectors and
org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets and all is
working well. On CTRL + mouse over I can see the Hyperlink and by clicking
on the Hyperlink the relevant open method is called.
My question is : Is it possible for me to view the hyperlinks all the time
in the editor using functionality like.... maybe hitting CTRL+H turning on
the hyperlinks (all hyperlinks visible in the editor) and something else to
turn them off?
Any help would be greatly appreciated!
Thanks in advance
Ev
|
|
|
|
Re: hyperlink functionality : show always? [message #334324 is a reply to message #321138] |
Tue, 03 February 2009 05:53  |
Eclipse User |
|
|
|
Hello,
Could the following be an acceptable implementation of a PresentationReconciler that adds hyperlinks to the text editor all times ? :
Or are there some drawbacks with this approach ?
PresentationReconciler reconciler= new PresentationReconciler() {
IHyperlinkPresenter hlp = new MultipleHyperlinkPresenter(new RGB(0, 0, 255));
@Override
public void install(ITextViewer viewer) {
super.install(viewer);
hlp.install(sourceViewer);
}
@Override
public void uninstall() {
hlp.uninstall();
super.uninstall();
}
@Override
protected TextPresentation createPresentation(IRegion damage, IDocument document) {
IHyperlink[] links = test.detectHyperlinks(sourceViewer, damage, true);
TextPresentation result = super.createPresentation(damage, document);
hlp.showHyperlinks(links);
return result;
}
};
Thanks in advance,
--
Laurent
Daniel Megert wrote:
> Ev wrote:
>
>> Hi
>> I am implementing hyperlink functionality in a Custom Text editor. I
>> am using the extension points
>> org.eclipse.ui.workbench.texteditor.hyperlinkDetectors and
>> org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets and all
>> is working well. On CTRL + mouse over I can see the Hyperlink and by
>> clicking on the Hyperlink the relevant open method is called.
>>
>> My question is : Is it possible for me to view the hyperlinks all the
>> time in the editor using functionality like.... maybe hitting CTRL+H
>> turning on the hyperlinks (all hyperlinks visible in the editor) and
>> something else to turn them off?
>>
>>
> This is currently not possible out of the box but of course you can
> implement your own presentation reconciler that shows links as links.
>
> Dani
>
>> Any help would be greatly appreciated!
>> Thanks in advance
>> Ev
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02729 seconds