ISharedTextColors implementation [message #274940] |
Mon, 01 November 2004 12:04  |
Eclipse User |
|
|
|
Hi,
I raised this issue on the eclipse.platform.swt newsgroup and was
advised to try posting it here, sorry if this is where the question
should have gone in the first place.
--
I'm trying to create a simple editor for some code. I'm using a
SourceViewer and I need to pass an IVerticalRuler on it's constructor.
Now I was looking to use an OverviewRuler so I could display annotations
in the ruler but to create an OverviewRuler I need to pass an
ISharedTextColors.
The problem is, is that I can't find a public implementation of
ISharedTextColors.
All I can find is the
org.eclipse.ui.internal.editors.text.SharedTextColors class.
Am I meant to implement this class myself, or rely on the internal
implementation? From the interface it looks like framework code should
provide an implementation?
Any help would be appreciated.
Cheers.
Nick.
|
|
|
|
Re: ISharedTextColors implementation [message #274960 is a reply to message #274940] |
Mon, 01 November 2004 18:33  |
Eclipse User |
|
|
|
Nick Brett wrote:
> Hi,
> I raised this issue on the eclipse.platform.swt newsgroup and was
> advised to try posting it here, sorry if this is where the question
> should have gone in the first place.
> --
> I'm trying to create a simple editor for some code. I'm using a
> SourceViewer and I need to pass an IVerticalRuler on it's constructor.
> Now I was looking to use an OverviewRuler so I could display annotations
> in the ruler but to create an OverviewRuler I need to pass an
> ISharedTextColors.
> The problem is, is that I can't find a public implementation of
> ISharedTextColors.
> All I can find is the
> org.eclipse.ui.internal.editors.text.SharedTextColors class.
> Am I meant to implement this class myself, or rely on the internal
> implementation? From the interface it looks like framework code should
> provide an implementation?
> Any help would be appreciated.
> Cheers.
> Nick.
Use getSharedColors(), like in my snipplet below (for the code-folding
supported editor)...
public class ProgressEditor extends TextEditor {
public void createPartControl(Composite parent) {
super.createPartControl(parent);
ProjectionViewer projectionViewer = (ProjectionViewer)
getSourceViewer();
fProjectionSupport = new ProjectionSupport(projectionViewer,
getAnnotationAccess(), getSharedColors());
fProjectionSupport.install();
Cheers,
--- Per ---
|
|
|
Powered by
FUDForum. Page generated in 0.06574 seconds