Example usage for org.eclipse.swt.custom StyledText setLineWrapIndent

List of usage examples for org.eclipse.swt.custom StyledText setLineWrapIndent

Introduction

In this page you can find the example usage for org.eclipse.swt.custom StyledText setLineWrapIndent.

Prototype

public void setLineWrapIndent(int startLine, int lineCount, int wrapIndent) 

Source Link

Document

Sets the wrap indent of the specified lines.

Usage

From source file:org.eclipse.swt.snippets.Snippet331.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("Snippet 331");
    shell.setLayout(new FillLayout());
    StyledText styledText = new StyledText(shell, SWT.WRAP | SWT.BORDER);
    styledText.setText(text);//from   w ww .j av  a  2  s  .  c  o  m
    styledText.setLineIndent(0, 1, 50);
    styledText.setLineIndent(2, 1, 50);
    styledText.setLineWrapIndent(2, 1, 50);
    styledText.setLineWrapIndent(4, 1, 50);

    StyleRange style = new StyleRange();
    style.metrics = new GlyphMetrics(0, 0, 50);
    Bullet bullet = new Bullet(style);
    styledText.setLineBullet(6, 1, bullet);
    styledText.setLineBullet(8, 1, bullet);
    styledText.setLineWrapIndent(8, 1, 50);

    shell.setSize(350, 550);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}