Problem with Hyperlink Presenter [message #34590] |
Wed, 26 November 2008 07:32 |
Matthias Kohles Messages: 71 Registered: July 2009 |
Member |
|
|
Hey guys, it's me again :-)
Now i have a slight problem with the presentation of my hyperlinks in the
plugin.
I created a class called HyperLinkPresenter which implements the interface
IHyperlinkPresenter.
Then i implemented the following two methods.
public void install(ITextViewer textViewer)
{
System.out.println("install called");
this.viewer = textViewer;
}
public void showHyperlinks(IHyperlink[] hyperlinks) throws
IllegalArgumentException
{
System.out.println("show hyperlinks called");
Display display =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().getDisplay();
IHyperlink link = hyperlinks[0];
IRegion link_region = link.getHyperlinkRegion();
Color color = new Color(display, new RGB(128, 128, 128));
this.viewer.setTextColor(color, link_region.getOffset(),
link_region.getLength(), true);
}
The goal is to make the hyperlink in another color and underline it like
in the java editor. Both methods are called, but the setTextColor method
has no effect? what i am doing wrong here?
thanks in advance
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03093 seconds