Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Configuring a SourceViewer
Configuring a SourceViewer [message #464471] Thu, 08 March 2007 08:45 Go to next message
Sebastien Pennec is currently offline Sebastien PennecFriend
Messages: 31
Registered: July 2009
Member
Hello,

I've subclassed the SourceViewerConfiguration class to add my own instance of
HyperlinkDetector to the getHyperlinkDetectors method.

It is the only thing that is implemented in my class, everything else comes from the
original SourceViewerConfiguration class.

When I display lines in my viewer, the links are detected (I see the cursor change
when I move the mouse over the links) but they are not underlined. Based on what I've
seen from the SourceViewerConfiguration class, it instances a
DefaultHyperlinkPresenter that is supposed to underline links and display them in blue.

Could anybody help me understand why the links are not displayed correctly? Could
that be a bug in the default presenter? (I doubt that... :)

Or, most likely, did I forget some configuration somewhere?

Thanks a lot for you help, I'm really lost with that issue...

Sébastien
Re: Configuring a SourceViewer [message #464597 is a reply to message #464471] Mon, 12 March 2007 13:37 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Sebastien Pennec wrote:

> Hello,
>
> I've subclassed the SourceViewerConfiguration class to add my own
> instance of HyperlinkDetector to the getHyperlinkDetectors method.

As of 3.3 you should no longer do this but instead use
'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' and
'org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTarget s' extension
points.

>
> It is the only thing that is implemented in my class, everything else
> comes from the original SourceViewerConfiguration class.
>
> When I display lines in my viewer, the links are detected (I see the
> cursor change when I move the mouse over the links) but they are not
> underlined. Based on what I've seen from the SourceViewerConfiguration
> class, it instances a DefaultHyperlinkPresenter that is supposed to
> underline links and display them in blue.

Yes, but only on-demand i.e. when the corresponding modifier is pressed.

Dani

>
> Could anybody help me understand why the links are not displayed
> correctly? Could that be a bug in the default presenter? (I doubt
> that... :)
>
> Or, most likely, did I forget some configuration somewhere?
>
> Thanks a lot for you help, I'm really lost with that issue...
>
> Sébastien
Re: Configuring a SourceViewer [message #464609 is a reply to message #464597] Mon, 12 March 2007 15:08 Go to previous messageGo to next message
Sebastien Pennec is currently offline Sebastien PennecFriend
Messages: 31
Registered: July 2009
Member
Hi Daniel,

Thanks for your help!

Daniel Megert wrote:
> Sebastien Pennec wrote:
>
>> Hello,
>>
>> I've subclassed the SourceViewerConfiguration class to add my own
>> instance of HyperlinkDetector to the getHyperlinkDetectors method.
>
> As of 3.3 you should no longer do this but instead use
> 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' and
> 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTarget s' extension
> points.

I'm developing my plugin with Eclipse version 3.2.1 and I'd like my users to be able
to use the plugin with their 3.2.1 version. I think that the main download link is
still leading to a 3.2.x version, or has it changed?

Should I change to 3.3 for development anyway??

>> It is the only thing that is implemented in my class, everything else
>> comes from the original SourceViewerConfiguration class.
>>
>> When I display lines in my viewer, the links are detected (I see the
>> cursor change when I move the mouse over the links) but they are not
>> underlined. Based on what I've seen from the SourceViewerConfiguration
>> class, it instances a DefaultHyperlinkPresenter that is supposed to
>> underline links and display them in blue.
>
> Yes, but only on-demand i.e. when the corresponding modifier is pressed.

Ok, now, if I implement the getHyperlinkStateMask() method, which is supposed to
return the modifier key that will be used by the Presenter, and set this key to
SWT.SHIFT, I can see a difference: the links are only active when I move my mouse on
them with the SHIFT key pressed. No surprise up to here.

But no matter the modifier key returned by this method (including SWT.NONE), the
links are _never_ underlined, even when they are active, i.e. when the mouse cursor
changes when it is above the links.

What should I do?

Sébastien


>
> Dani
>
>>
>> Could anybody help me understand why the links are not displayed
>> correctly? Could that be a bug in the default presenter? (I doubt
>> that... :)
>>
>> Or, most likely, did I forget some configuration somewhere?
>>
>> Thanks a lot for you help, I'm really lost with that issue...
>>
>> Sébastien
Re: Configuring a SourceViewer [message #464611 is a reply to message #464609] Mon, 12 March 2007 15:47 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Sebastien Pennec wrote:

> Hi Daniel,
>
> Thanks for your help!
>
> Daniel Megert wrote:
>
>> Sebastien Pennec wrote:
>>
>>> Hello,
>>>
>>> I've subclassed the SourceViewerConfiguration class to add my own
>>> instance of HyperlinkDetector to the getHyperlinkDetectors method.
>>
>>
>> As of 3.3 you should no longer do this but instead use
>> 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' and
>> 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTarget s'
>> extension points.
>
>
> I'm developing my plugin with Eclipse version 3.2.1 and I'd like my
> users to be able to use the plugin with their 3.2.1 version. I think
> that the main download link is still leading to a 3.2.x version, or
> has it changed?
>
> Should I change to 3.3 for development anyway??

You can switch to one of the stable (milestone) builds for developement.

>
>>> It is the only thing that is implemented in my class, everything
>>> else comes from the original SourceViewerConfiguration class.
>>>
>>> When I display lines in my viewer, the links are detected (I see the
>>> cursor change when I move the mouse over the links) but they are not
>>> underlined. Based on what I've seen from the
>>> SourceViewerConfiguration class, it instances a
>>> DefaultHyperlinkPresenter that is supposed to underline links and
>>> display them in blue.
>>
>>
>> Yes, but only on-demand i.e. when the corresponding modifier is pressed.
>
>
> Ok, now, if I implement the getHyperlinkStateMask() method, which is
> supposed to return the modifier key that will be used by the
> Presenter, and set this key to SWT.SHIFT, I can see a difference: the
> links are only active when I move my mouse on them with the SHIFT key
> pressed. No surprise up to here.
>
> But no matter the modifier key returned by this method (including
> SWT.NONE), the links are _never_ underlined, even when they are
> active, i.e. when the mouse cursor changes when it is above the links.
>
> What should I do?

Does it work for normal HTML links?

Dani

>
> Sébastien
>
>
>>
>> Dani
>>
>>>
>>> Could anybody help me understand why the links are not displayed
>>> correctly? Could that be a bug in the default presenter? (I doubt
>>> that... :)
>>>
>>> Or, most likely, did I forget some configuration somewhere?
>>>
>>> Thanks a lot for you help, I'm really lost with that issue...
>>>
>>> Sébastien
>>
Re: Configuring a SourceViewer [message #464613 is a reply to message #464611] Mon, 12 March 2007 17:32 Go to previous messageGo to next message
Sebastien Pennec is currently offline Sebastien PennecFriend
Messages: 31
Registered: July 2009
Member
Daniel Megert wrote:
>
> You can switch to one of the stable (milestone) builds for developement.
>

To be sure that I understand you well: I can update my version of Eclipse to develop
my plugin, and still have the plugin being compatible and runnable on older Eclipse
versions?

>> Ok, now, if I implement the getHyperlinkStateMask() method, which is
>> supposed to return the modifier key that will be used by the
>> Presenter, and set this key to SWT.SHIFT, I can see a difference: the
>> links are only active when I move my mouse on them with the SHIFT key
>> pressed. No surprise up to here.
>>
>> But no matter the modifier key returned by this method (including
>> SWT.NONE), the links are _never_ underlined, even when they are
>> active, i.e. when the mouse cursor changes when it is above the links.
>>
>> What should I do?
>
> Does it work for normal HTML links?

Unfortunately not, and this is what I don't understand...

Thanks a lot for your help,

Sébastien
Re: Configuring a SourceViewer [message #464622 is a reply to message #464613] Tue, 13 March 2007 09:35 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Sebastien Pennec wrote:

> Daniel Megert wrote:
> >
>
>> You can switch to one of the stable (milestone) builds for developement.
>
> >
>
> To be sure that I understand you well: I can update my version of
> Eclipse to develop my plugin, and still have the plugin being
> compatible and runnable on older Eclipse versions?
>
>>> Ok, now, if I implement the getHyperlinkStateMask() method, which is
>>> supposed to return the modifier key that will be used by the
>>> Presenter, and set this key to SWT.SHIFT, I can see a difference:
>>> the links are only active when I move my mouse on them with the
>>> SHIFT key pressed. No surprise up to here.
>>>
>>> But no matter the modifier key returned by this method (including
>>> SWT.NONE), the links are _never_ underlined, even when they are
>>> active, i.e. when the mouse cursor changes when it is above the links.
>>>
>>> What should I do?
>>
>>
>> Does it work for normal HTML links?
>
>
> Unfortunately not, and this is what I don't understand...

If you can strip your code down and remove all confidential info then I
suggest you file a bug report and attach the code. I can then take a
closer look.

Dani

>
> Thanks a lot for your help,
>
> Sébastien
Re: Configuring a SourceViewer [message #464624 is a reply to message #464622] Tue, 13 March 2007 13:13 Go to previous messageGo to next message
Sebastien Pennec is currently offline Sebastien PennecFriend
Messages: 31
Registered: July 2009
Member
Thanks Daniel, I'll do that this afternoon :)

You mentioned that I could switch to a stable 3.3.x build for development. I just
want to be sure of one thing: Can I use a 3.3.x version of Eclipse to develop my
plugin and run it fine with 3.2.x versions? It seems a bit suspect to me...

Thanks for you help,

Sébastien

Daniel Megert wrote:
> Sebastien Pennec wrote:
>
>> Daniel Megert wrote:
>> >
>>
>>> You can switch to one of the stable (milestone) builds for developement.
>>
>> >
>>
>> To be sure that I understand you well: I can update my version of
>> Eclipse to develop my plugin, and still have the plugin being
>> compatible and runnable on older Eclipse versions?
>>
>>>> Ok, now, if I implement the getHyperlinkStateMask() method, which is
>>>> supposed to return the modifier key that will be used by the
>>>> Presenter, and set this key to SWT.SHIFT, I can see a difference:
>>>> the links are only active when I move my mouse on them with the
>>>> SHIFT key pressed. No surprise up to here.
>>>>
>>>> But no matter the modifier key returned by this method (including
>>>> SWT.NONE), the links are _never_ underlined, even when they are
>>>> active, i.e. when the mouse cursor changes when it is above the links.
>>>>
>>>> What should I do?
>>>
>>>
>>> Does it work for normal HTML links?
>>
>>
>> Unfortunately not, and this is what I don't understand...
>
> If you can strip your code down and remove all confidential info then I
> suggest you file a bug report and attach the code. I can then take a
> closer look.
>
> Dani
>
>>
>> Thanks a lot for your help,
>>
>> Sébastien
Re: Configuring a SourceViewer [message #464627 is a reply to message #464624] Tue, 13 March 2007 14:12 Go to previous message
Sebastien Pennec is currently offline Sebastien PennecFriend
Messages: 31
Registered: July 2009
Member
It's online:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=177142

I've attached a sample plugin that shows the bug.

Thanks for your help :)

Sébastien

>> Daniel Megert wrote:
>> If you can strip your code down and remove all confidential info then
>> I suggest you file a bug report and attach the code. I can then take a
>> closer look.
>>
>> Dani
Previous Topic:Perspectives in a RCP Application
Next Topic:Automatic Updates
Goto Forum:
  


Current Time: Wed Jan 15 11:17:23 GMT 2025

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

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

Back to the top