org.eclipse.draw2d.text

## Class ParagraphTextLayout

- java.lang.Object
- - org.eclipse.draw2d.text.FlowFigureLayout
  - - org.eclipse.draw2d.text.TextLayout
    - - org.eclipse.draw2d.text.ParagraphTextLayout

All Implemented Interfaces:
  LayoutManager

    public class ParagraphTextLayout
    extends TextLayout

The layout for `TextFlow`.

Since:
  2.1

### Field Summary

Fields
`static int` `WORD_WRAP_HARD` Wrapping will ONLY occur at valid line breaks
`static int` `WORD_WRAP_SOFT` Wrapping will always occur at the end of the available space, breaking in the middle of a word.
`static int` `WORD_WRAP_TRUNCATE` Wrapping will always occur at the end of available space, truncating a word if it doesn't fit.

### Constructor Summary

Constructors
Constructor and Description
`ParagraphTextLayout(TextFlow flow)` Constructs a new ParagraphTextLayout on the specified TextFlow.
`ParagraphTextLayout(TextFlow flow, int style)` Constructs the layout with the specified TextFlow and wrapping style.

### Method Summary

Methods
`protected void` `layout()` Called during `FlowFigureLayout.layout(IFigure)`.

### Methods inherited from class org.eclipse.draw2d.text.TextLayout

`getFragment`

### Methods inherited from class org.eclipse.draw2d.text.FlowFigureLayout

`getConstraint, getContext, getFlowFigure, getMinimumSize, getPreferredSize, invalidate, layout, remove, setConstraint, setFlowContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### WORD_WRAP_HARD

    public static final int WORD_WRAP_HARD

Wrapping will ONLY occur at valid line breaks

See Also:
  Constant Field Values

#### WORD_WRAP_SOFT

    public static final int WORD_WRAP_SOFT

Wrapping will always occur at the end of the available space, breaking in the middle of a word.

See Also:
  Constant Field Values

#### WORD_WRAP_TRUNCATE

    public static final int WORD_WRAP_TRUNCATE

Wrapping will always occur at the end of available space, truncating a word if it doesn't fit. Note that truncation is not supported across multiple figures and with BiDi. Undesired effects may result if that is the case.

See Also:
  Constant Field Values

### Constructor Detail

#### ParagraphTextLayout

    public ParagraphTextLayout(TextFlow flow)

Constructs a new ParagraphTextLayout on the specified TextFlow.

Parameters:
  `flow` - the TextFlow

#### ParagraphTextLayout

    public ParagraphTextLayout(TextFlow flow,
                       int style)

Constructs the layout with the specified TextFlow and wrapping style. The wrapping style must be one of:

- `WORD_WRAP_HARD`
- `WORD_WRAP_SOFT`
- `WORD_WRAP_TRUNCATE`

Parameters:
  `flow` - the textflow
  `style` - the style of wrapping

### Method Detail

#### layout

    protected void layout()

Description copied from class: `FlowFigureLayout`
Called during `FlowFigureLayout.layout(IFigure)`.

Specified by:
  `layout` in class `FlowFigureLayout`
See Also:
  `FlowFigureLayout.layout()`