Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to show line no in a Editor
How to show line no in a Editor [message #463729] Thu, 15 February 2007 02:16 Go to next message
Eclipse UserFriend
Originally posted by: thiraviyakumar.rediffmail.com

Hi All,

I have created a Read Write Editor, which is a sub class of
org.eclipse.ui.texteditor.AbstractDecoratedTextEditor. I want to show line
nos in this editor. Can you just let me know, is it possible to add line
no to this editor? If yes, how to add line no to this editor?

Thanks,
M.S.Thiraviyakumar
Re: How to show line no in a Editor [message #463814 is a reply to message #463729] Thu, 15 February 2007 16:32 Go to previous messageGo to next message
Eclipse UserFriend
Thiraviyakumar wrote:
> Hi All,
>
> I have created a Read Write Editor, which is a sub class of
> org.eclipse.ui.texteditor.AbstractDecoratedTextEditor. I want to show
> line nos in this editor. Can you just let me know, is it possible to add
> line no to this editor? If yes, how to add line no to this editor?
> Thanks,
> M.S.Thiraviyakumar
>

I believe all you need to do is turn on the "Show line numbers" option
on the "General->Editors->Text Editors" preference page.

Steve
Re: How to show line no in a Editor [message #463959 is a reply to message #463814] Wed, 21 February 2007 07:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thiraviyakumar.rediffmail.com

In below I have pasted the code which is being used. I want to show Line
no & Line no ruler in this RWEditor. Can you please let me know the
way/logic to do so?
public class RWEditor extends AbstractDecoratedTextEditor {
public RWEditor () {
super();
internal_init();
}

protected void internal_init() {
configureInsertMode(SMART_INSERT, false);
SimpleDocumentProvider docProvider = new SimpleDocumentProvider();
docProvider.setModifiable(true);
setDocumentProvider(docProvider);
}
}
Re: How to show line no in a Editor [message #463963 is a reply to message #463959] Wed, 21 February 2007 07:35 Go to previous message
Eclipse UserFriend
Thiraviyakumar wrote:

> In below I have pasted the code which is being used. I want to show
> Line no & Line no ruler in this RWEditor. Can you please let me know
> the way/logic to do so?
> public class RWEditor extends AbstractDecoratedTextEditor {
> public RWEditor () {
> super();
> internal_init();
> }
>
> protected void internal_init() {
> configureInsertMode(SMART_INSERT, false);
> SimpleDocumentProvider docProvider = new SimpleDocumentProvider();
> docProvider.setModifiable(true);
> setDocumentProvider(docProvider);
> }
> }
>
Per default line numbers aren't shown. You have to set the
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_N UMBER_RULER
to true.

Dani
Previous Topic:use of document partitioner
Next Topic:Swing and RCP
Goto Forum:
  


Current Time: Wed Mar 19 06:44:21 EDT 2025

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

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

Back to the top