Package docking.widgets.fieldpanel.field
Class WrappingVerticalLayoutTextField
- java.lang.Object
-
- docking.widgets.fieldpanel.field.VerticalLayoutTextField
-
- docking.widgets.fieldpanel.field.WrappingVerticalLayoutTextField
-
- Direct Known Subclasses:
ClangTextField
public class WrappingVerticalLayoutTextField extends VerticalLayoutTextField
-
-
Field Summary
-
Fields inherited from class docking.widgets.fieldpanel.field.VerticalLayoutTextField
hlFactory, isClipped, preferredWidth, startX, subFields, textElements, width
-
-
Constructor Summary
Constructors Constructor Description WrappingVerticalLayoutTextField(FieldElement textElement, int startX, int width, int maxLines, HighlightFactory hlFactory)
This constructor will create a text field from an single AttributedString.WrappingVerticalLayoutTextField(FieldElement textElement, int startX, int width, int maxLines, HighlightFactory hlFactory, boolean breakOnWhiteSpace)
Create a text field from a single FieldElement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowColLocation
dataToScreenLocation(int index, int offset)
Finds the corresponding row, column for string index, and offset-
Methods inherited from class docking.widgets.fieldpanel.field.VerticalLayoutTextField
calculateHeight, contains, generateText, generateText, getCol, getCursorBounds, getFieldElement, getHeight, getHeightAbove, getHeightBelow, getNumCols, getNumRows, getPreferredWidth, getRow, getScrollableUnitIncrement, getStartX, getSubfields, getText, getTextWithLineSeparators, getWidth, getX, getY, isClipped, isPrimary, isValid, layoutElements, paint, rowHeightChanged, screenLocationToTextOffset, screenToDataLocation, setPrimary, textOffsetToScreenLocation, toString
-
-
-
-
Constructor Detail
-
WrappingVerticalLayoutTextField
public WrappingVerticalLayoutTextField(FieldElement textElement, int startX, int width, int maxLines, HighlightFactory hlFactory)
This constructor will create a text field from an single AttributedString. The string will be word wrapped.- Parameters:
textElement
- the AttributedString to displaystartX
- the x position to draw the stringwidth
- the max width allocated to this fieldmaxLines
- the max number of lines to displayhlFactory
- the highlight factory
-
WrappingVerticalLayoutTextField
public WrappingVerticalLayoutTextField(FieldElement textElement, int startX, int width, int maxLines, HighlightFactory hlFactory, boolean breakOnWhiteSpace)
Create a text field from a single FieldElement. The text is wrapped, either an words or simply- Parameters:
textElement
- is the element to displaystartX
- is the position to draw the stringwidth
- is the max width allocated to this fieldmaxLines
- is the max number of lines to displayhlFactory
- is the highlight factorybreakOnWhiteSpace
- is true if wrapping should break on word boundaries
-
-
Method Detail
-
dataToScreenLocation
public RowColLocation dataToScreenLocation(int index, int offset)
Finds the corresponding row, column for string index, and offset- Specified by:
dataToScreenLocation
in interfaceTextField
- Overrides:
dataToScreenLocation
in classVerticalLayoutTextField
- Parameters:
index
- index into the string arrayoffset
- offset into the indexed string.- Returns:
- row and column in the screen coordinate system.
-
-