How to add a vertical ruler to a Text Editor [message #665990] |
Mon, 18 April 2011 09:51  |
Eclipse User |
|
|
|
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 10:17  |
Eclipse User |
|
|
|
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.12792 seconds