Package docking.widgets.fieldpanel.support

# Class FieldUtils

java.lang.Object
docking.widgets.fieldpanel.support.FieldUtils

public class FieldUtils extends Object
A utility class for working with Field objects.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `WORD_WRAP_OPTION_DESCRIPTION`
  `static final String`
  `WORD_WRAP_OPTION_NAME`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `trimString(String string)`
  Trims unwanted characters off of the given label, like spaces, '[',']', etc.
  `static List<FieldElement>`
  `wrap(FieldElement fieldElement, int width)`
  Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
  `static List<FieldElement>`
  `wrap(FieldElement fieldElement, int width, boolean breakOnWhiteSpace)`
  Splits the given FieldElement into sub-elements by wrapping the element in some fashion.
  `static List<FieldElement>`
  `wrap(List<FieldElement> fieldElements, int width)`

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

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

- ## Field Details

  - ### WORD_WRAP_OPTION_NAME

    public static final String WORD_WRAP_OPTION_NAME
    See Also:
      - Constant Field Values

  - ### WORD_WRAP_OPTION_DESCRIPTION

    public static final String WORD_WRAP_OPTION_DESCRIPTION
    See Also:
      - Constant Field Values

- ## Method Details

  - ### wrap

    public static List<FieldElement> wrap(List<FieldElement> fieldElements, int width)

  - ### wrap

    public static List<FieldElement> wrap(FieldElement fieldElement, int width)
    Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
    Parameters:
      `fieldElement` - The element to wrap
      `width` - The maximum width to allow before wrapping
    Returns:
      The wrapped elements

  - ### wrap

    public static List<FieldElement> wrap(FieldElement fieldElement, int width, boolean breakOnWhiteSpace)
    Splits the given FieldElement into sub-elements by wrapping the element in some fashion. If breakOnWhiteSpace is indicated, wrapping will break lines on a white space character if possible, otherwise wrapping occurs on the last possible character.
    Parameters:
      `fieldElement` - is the element to wrap
      `width` - is the maximum width to allow before wrapping
      `breakOnWhiteSpace` - determines whether line breaks should happen at white space chars
    Returns:
      the wrapped elements

  - ### trimString

    public static String trimString(String string)
    Trims unwanted characters off of the given label, like spaces, '[',']', etc.
    Parameters:
      `string` - The string to be trimmed
    Returns:
      The trimmed string.