Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to add a vertical ruler to a Text Editor(Vertical ruler to a Text Editor)
How to add a vertical ruler to a Text Editor [message #665990] Mon, 18 April 2011 13:51 Go to next message
ekta  is currently offline ekta Friend
Messages: 1
Registered: April 2011
Junior Member
I have created a TextEditor,and want to add a vertical ruler to it.

Below is part of code..

protected IVerticalRuler createVerticalRuler() {

return new VerticalRuler(12);
}

protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
return new SourceViewer(parent, ruler, styles);
}
@Override
public void createPartControl(Composite parent) {
int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
fVerticalRuler = createVerticalRuler();
fSourceViewer = createSourceViewer(parent, fVerticalRuler, styles);


This just gives me a ruler like component to the left of editor.What do i do get line numbers /or any other charater on the ruler.
Re: How to add a vertical ruler to a Text Editor [message #666226 is a reply to message #665990] Tue, 19 April 2011 14:17 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
This isn't really a "newcomers" question; try asking in the Platform
forum group instead.

Eric


On 4/18/11 9:51 AM, ekta wrote:
> I have created a TextEditor,and want to add a vertical ruler to it.
>
> Below is part of code..
>
> protected IVerticalRuler createVerticalRuler() {
>
> return new VerticalRuler(12);
> }
>
> protected ISourceViewer createSourceViewer(Composite parent,
> IVerticalRuler ruler, int styles) {
> return new SourceViewer(parent, ruler, styles);
> }
> @Override
> public void createPartControl(Composite parent) {
> int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER |
> SWT.FULL_SELECTION;
> fVerticalRuler = createVerticalRuler();
> fSourceViewer = createSourceViewer(parent, fVerticalRuler, styles);
>
>
> This just gives me a ruler like component to the left of editor.What do
> i do get line numbers /or any other charater on the ruler.
>
Previous Topic:External configuration
Next Topic:Android XML Edit full screen toggle missing
Goto Forum:
  


Current Time: Fri Apr 26 06:15:36 GMT 2024

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

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

Back to the top