Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » ISharedTextColors implementation
ISharedTextColors implementation [message #274940] Mon, 01 November 2004 12:04 Go to next message
Eclipse UserFriend
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 #274943 is a reply to message #274940] Mon, 01 November 2004 14:12 Go to previous messageGo to next message
Eclipse UserFriend
I believe the text framework intends your editor to subclass
AbstractDecoratedTextEditor to get over ruler support etc

HTH
Darins

"Nick Brett" <nb271@cam.ac.uk> wrote in message
news:cm5q7f$3o7$1@eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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 ---
Previous Topic:Matching Brackets
Next Topic:Could it possible to use class-folder instead of .jar/.zip library?
Goto Forum:
  


Current Time: Wed Jul 16 21:28:27 EDT 2025

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

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

Back to the top