Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » hyperlink functionality : show always?
hyperlink functionality : show always? [message #321119] Tue, 09 October 2007 15:25 Go to next message
Eclipse UserFriend
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 #321138 is a reply to message #321119] Wed, 10 October 2007 09:28 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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
>
>
>
>
Re: hyperlink functionality : show always? [message #334324 is a reply to message #321138] Tue, 03 February 2009 10:53 Go to previous message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
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
>>
>>
>>
Previous Topic:Activate a perspective as part of opening an editor
Next Topic:newWizard categories
Goto Forum:
  


Current Time: Thu Apr 25 04:20:10 GMT 2024

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

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

Back to the top