Class TextArea

All Implemented Interfaces:
Control, Enableable, Focusable, HasAttribute, HasClassName, HasComputedStyle, HasControlText, HasDestroy, HasMouseWheelCondition, HasReadOnly, HasStyle, HasTooltip, HasVisibility, Scrollable, TabTraversable, TextHighlightable

  • Constructor Details

    • TextArea

      public TextArea()
  • Method Details

    • create

      protected void create(AbstractDwcjPanel p)
      Description copied from class: AbstractControl
      Create the object on a panel p. The preferred way of creating an object is using the Panel::add(Control) method, instead of this
      Overrides:
      create in class AbstractControl
      Parameters:
      p - the panel to add this control on
    • onEditModify

      public TextArea onEditModify(Consumer<TextAreaOnEditModifyEvent> callback)
    • addParagraph

      public TextArea addParagraph(Integer index, String paragraph)
      Adds a paragraph to the MultilineEdit control
      Parameters:
      index - - Specifies the paragraph number with 0 identifying the first paragraph. If index equals -1, paragraphs are added to the end.
      paragraph - - Specifies the paragraph to be added.
      Returns:
      Returns this
    • appendToParagraph

      public TextArea appendToParagraph(Integer parNum, String text)
      Appends text to the end of a paragraph in the MultilineEdit control
      Parameters:
      index - - Specifies the 0-based index of the paragraph to append the text to.
      test - - Specifies the text to be appended to the end of the paragraph.
      Returns:
      Returns this
    • getAllParagraphs

      public List<String> getAllParagraphs()
      This method returns the text of all paragraphs from the MultilineEdit in a List
      Returns:
      Paragraph text from the MultilineEdit control in a List of strings.
    • getCurrentParagraphIndex

      public Integer getCurrentParagraphIndex()
      This method returns the current zero-based paragraph index in the MultilineEdit control
      Returns:
      Returns the zero-based paragraph index in the MultilineEdit control
    • isHorizontalScrollable

      public Boolean isHorizontalScrollable()
      Returns whether a horizontal scroll bar will appear when the text is too large to fit within the MultilineEdit control area
      Returns:
      Returns whether a horizontal scroll bar will appear when the text is too large to fit within the control area (false = No Horizontal Scroll Bar, true = Horizontal Scroll Bar).
    • isIgnoreEnters

      public Boolean isIgnoreEnters()
      This method returns whether the ENTER key is ignored in the MultilineEdit control
      Returns:
      Returns whether the ENTER key is ignored in the MultilineEdit control (false = ENTER key not ignored, true = ENTER key ignored).
    • isIgnoreTabs

      public Boolean isIgnoreTabs()
      Returns whether TAB key is ignored in the MultilineEdit control
      Returns:
      Returns whether the TAB key is ignored in the control (false = TAB key not ignored, true = TAB key ignored).
    • isLimitToOneParagraph

      public Boolean isLimitToOneParagraph()
      Returns whether the MultilineEdit control is limited to one paragraph.
      Returns:
      Returns whether the control is limited to one paragraph (false = Not limited, true = Limited).
    • getLineCountLimit

      public Integer getLineCountLimit()
      This method returns the maximum number of lines (paragraphs) that can be entered into the MultilineEdit control
      Returns:
      Returns the maximum number of lines that can be entered into the control (0 = no limit)
    • isLineWrap

      public Boolean isLineWrap()
      Returns whether lines are wrapped in the MultilineEdit control
      Returns:
      Returns whether the lines are wrapped in the control (false = Not Wrapped, true = Wrapped).
    • getMaxParagraphSize

      public Integer getMaxParagraphSize()
      Returns the maximum number of characters allowed per paragraph in the MultilineEdit control
      Returns:
      Returns the maximum number of characters allowed per paragraph in the control
    • getMaxLength

      public Integer getMaxLength()
      This method returns the maximum length of the text in a MultilineEdit control
      Returns:
      Returns the maximum length of the text in the control.
    • getNumberOfParagraphs

      public Integer getNumberOfParagraphs()
      Returns the number of paragraphs in the MultilineEdit control
      Returns:
      Returns the number of paragraphs in the control.
    • isOvertypeMode

      public Boolean isOvertypeMode()
      Returns whether overtype mode is used in the MultilineEdit control
      Returns:
      Returns whether overtype mode is being used in the control (false = Not in Overtype Mode, true = In Overtype Mode).
    • getParagraph

      public String getParagraph(Integer parNum)
      Returns the paragraph text in the MultilineEdit control
      Parameters:
      parNum - - Specifies the 0-based index of the paragraph, for text to be returned.
      Returns:
      Returns the paragraph text in the control.
    • getSelection

      public List<String> getSelection()
      Returns the selected text in the MultilineEdit control
      Returns:
      Returns a four-element List of strings that identifies the currently selected text in the MultilineEdit control. If the List is selectionList, then selectionList.getItem(0) and selectionList.getItem(1) identify the paragraph and offset of the beginning of the selected text while selectionList.getItem(2) and selectionList.getItem(3) identify the paragraph and offset of the end of the selected text. All values are zero-based. If the start and end points are the same, there is no selection and the location of the caret (insertion point) is reported.
    • getTabSize

      public Integer getTabSize()
      Returns the tab size in the MultilineEdit control
      Returns:
      Returns the tab size of the control.
    • isVerticalScrollable

      public Boolean isVerticalScrollable()
      Returns whether a vertical scroll bar will appear when the text is too large to fit within the MultilineEdit control area.
      Returns:
      Returns whether a vertical scroll bar will appear when the text is too large to fit within control area (false = No Vertical Scroll Bar, true = Vertical Scroll Bar).
    • isWrapStyleWord

      public Boolean isWrapStyleWord()
      This method gets the style of wrapping used if the MultilineEdit control is wrapping lines
      Returns:
      Returns the style of wrapping used if the text area is wrapping lines (true = wrap at word boundaries; false = wrap at character boundaries).
    • highlight

      public void highlight(Integer parIndex1, Integer off1, Integer parIndex2, Integer off2)
      Highlights characters in the MultilineEdit control
      Parameters:
      parIndex1 - - Specifies the 0-based paragraph index where the highlight is to begin.
      off1 - - Specifies the offset of characters where the highlight is to begin.
      parIndex2 - - Specifies the 0-based paragraph index where the highlight is to end.
      off2 - - Specifies the offset of characters where the highlight is to end.
    • removeAll

      public void removeAll()
      This method removes all paragraphs from the MultilineEdit control
    • removeParagraph

      public TextArea removeParagraph(Integer parIndex)
      Removes a paragraph in theMultilineEdit control
      Parameters:
      parIndex - - Specifies the 0-based index of the paragraph to be removed.
      Returns:
      Returns this
    • setHorizontalScrollable

      public TextArea setHorizontalScrollable(Boolean scroll)
      Sets whether a horizontal scroll bar will appear when the text is too large to fit within the MultilineEdit control
      Parameters:
      scroll - - Specifies whether a horizontal scroll bar will appear when the text is too large to fit within control area (false = No Horizontal Scroll, true = Horizontal Scroll).
      Returns:
      Returns this
    • setIgnoreEnters

      public TextArea setIgnoreEnters(Boolean ignore)
      This method sets whether to ignore the ENTER key in the MultilineEdit control
      Parameters:
      ignore - - Specifies whether the ENTER key is ignored (false = ENTER key not ignored, true = ENTER key ignored).
      Returns:
      Returns this
    • setIgnoreTabs

      public TextArea setIgnoreTabs(Boolean ignore)
      Sets whether to ignore the Tab key in the MultilineEdit control
      Parameters:
      ignore - - Specifies whether the TAB key is ignored (false = TAB key not ignored, true = TAB key ignored)
      Returns:
      Returns this
    • setLimitToOneParagraph

      public TextArea setLimitToOneParagraph(Boolean limit)
      Sets whether the MultilineEdit control is limited to one paragraph
      Parameters:
      limit - - Specifies whether control is limited to one paragraph (false = Not limited, true = Limited)
      Returns:
      Returns this
    • setLineCountLimit

      public TextArea setLineCountLimit(Integer limit)
      This method sets the maximum number of paragraphs (lines) that can be entered into the MultilineEdit control
      Parameters:
      limit - - Maximum number of lines (paragraphs) that can be entered into the control.
      Returns:
      Returns this
    • setLineWrap

      public TextArea setLineWrap(Boolean wrap)
      Sets whether the lines will be wrapped in the MultilineEdit control
      Parameters:
      wrap - - Specifies whether the lines will be wrapped (false = Not Wrapped, true = Wrapped)
      Returns:
      Returns this
    • setMaxParagraphSize

      public TextArea setMaxParagraphSize(Integer size)
      Sets the maximum number of characters allowed in a MultilineEdit control paragraph.
      Parameters:
      limit - - Specifies the number of characters to be allowed in a paragraph.
      Returns:
      Returns this
    • setMaxLength

      public TextArea setMaxLength(Integer length)
      This method sets the maximum length of the text in a MultilineEdit control
      Parameters:
      limit - - Specifies the maximum length of the text in the control.
      Returns:
      Returns this
    • setOvertypeMode

      public TextArea setOvertypeMode(Boolean overtype)
      Sets whether the overtype mode is used in the MultilineEdit control
      Parameters:
      overtype - - Specifies whether to use overtype mode (false = Not in Overtype Mode, true = In Overtype Mode)
      Returns:
      Returns this
    • setTabSize

      public TextArea setTabSize(Integer size)
      Sets the tab size of the MultilineEdit control
      Parameters:
      size - - Specifies the tab size.
      Returns:
      Returns this
    • setVerticalScrollable

      public TextArea setVerticalScrollable(Boolean scroll)
      Sets whether a vertical scroll bar will appear when the text is too large to fit within the MultilineEdit control
      Parameters:
      scroll - - Specifies whether a vertical scroll bar will appear when the text is too large to fit within control area (false = No Vertical Scroll Bar, true = Vertical Scroll Bar)
      Returns:
      Returns this
    • setWrapStyleWord

      public TextArea setWrapStyleWord(Boolean word)
      this method sets the style of wrapping used if the MultilineEdit control is wrapping lines.
      Parameters:
      wrap - - Sets the style of wrapping used if the BBjCEdit is wrapping lines (false = Wrap at character boundaries, true = Wrap at word boundaries.)
      Returns:
      Returns this
    • isReadOnly

      public Boolean isReadOnly()
      Description copied from interface: HasReadOnly
      Returns a value indicating whether or not a control is set to read only or not.
      Specified by:
      isReadOnly in interface HasReadOnly
      Returns:
      Boolean indicating whether or not the user can edit the control.
    • setReadOnly

      public TextArea setReadOnly(Boolean editable)
      Sets whether the text is editable in the MultilineEdit control
      Specified by:
      setReadOnly in interface HasReadOnly
      Parameters:
      editable - - Specifies whether the text can be edited (false = Not Editable, true = Editable).
      Returns:
      Returns this
    • getHighlightOnFocus

      public TextHighlightable.Highlight getHighlightOnFocus()
      Description copied from interface: TextHighlightable
      This method returns an enum representing the current behavior of highlighting in a text control when the control receives focus.
      Specified by:
      getHighlightOnFocus in interface TextHighlightable
      Returns:
      Enum representing BBj constant for highlight on focus
    • setHighlightOnFocus

      public TextArea setHighlightOnFocus(TextHighlightable.Highlight highlight)
      Description copied from interface: TextHighlightable
      This method sets the behavior of controls implementing the TextControl interface when receiving focus via the keyboard, mouse, or BBjControl::focus() method FOCUS mnemonic.
      Specified by:
      setHighlightOnFocus in interface TextHighlightable
      Parameters:
      highlight - Enum representing a BBj constant that dictates highlight behavior for control
      Returns:
      The control itself.
    • isFocusable

      public Boolean isFocusable()
      Description copied from interface: Focusable
      isFocusable returns a value indicating whether or not the user can focus the control. Note: A focused control is the control to which keyboard interaction is directed. Typically, the focused control is indicated visually, often via a dotted grey border. A control which is not focusable, therefore, cannot be manipulated via the keyboard. It is still possible to interact with a non-focusable control via the mouse.
      Specified by:
      isFocusable in interface Focusable
      Returns:
      True if object can be focused, False if not.
    • setFocusable

      public TextArea setFocusable(Boolean focusable)
      Description copied from interface: Focusable
      setFocusable sets whether a control can be focused. Note: A focused control is the control to which keyboard interaction is directed. Typically, the focused control is indicated visually, often via a dotted grey border. A control which is not focusable, therefore, cannot be manipulated via the keyboard. It is still possible to interact with a non-focusable control via the mouse. To disable all interaction, including the mouse, see setEnabled() and setReadOnly().
      Specified by:
      setFocusable in interface Focusable
      Parameters:
      focusable - Boolean True for allowing focusing, False to disable focus
      Returns:
      Object itself
    • getScrollWheelBehavior

      public HasMouseWheelCondition.MouseWheelCondition getScrollWheelBehavior()
      Description copied from interface: HasMouseWheelCondition
      getScrollWheelBehavior returns a constant indicating under what situations the control will respond to the mouse scroll wheel.
      Specified by:
      getScrollWheelBehavior in interface HasMouseWheelCondition
      Returns:
      Enum value of scroll behavior
    • setScrollWheelBehavior

      public TextArea setScrollWheelBehavior(HasMouseWheelCondition.MouseWheelCondition condition)
      Description copied from interface: HasMouseWheelCondition
      setScrollWheelBehavior configures under what situations the control will respond to the mouse scroll wheel.
      Specified by:
      setScrollWheelBehavior in interface HasMouseWheelCondition
      Parameters:
      condition - Enum value for desired behavior
      Returns:
      The control itself
    • getHorizontalScrollBarHeight

      public Integer getHorizontalScrollBarHeight()
      Description copied from interface: Scrollable
      This method returns the height of the horizontal scrollbar for a Scrollable Control.
      Specified by:
      getHorizontalScrollBarHeight in interface Scrollable
      Returns:
      Integer height of scrollbar
    • getHorizontalScrollBarPosition

      public Integer getHorizontalScrollBarPosition()
      Description copied from interface: Scrollable
      This method returns the position of the horizontal scrollbar for a Scrollable Control.
      Specified by:
      getHorizontalScrollBarPosition in interface Scrollable
      Returns:
      Integer horizontal position of scrollbar
    • getHorizontalScrollBarWidth

      public Integer getHorizontalScrollBarWidth()
      Description copied from interface: Scrollable
      This method returns the width of the horizontal scrollbar for a Scrollable Control.
      Specified by:
      getHorizontalScrollBarWidth in interface Scrollable
      Returns:
      Integer horizontal scrollbar width
    • getVerticalScrollBarHeight

      public Integer getVerticalScrollBarHeight()
      Description copied from interface: Scrollable
      This method returns the height of the vertical scrollbar for a Scrollable Control.
      Specified by:
      getVerticalScrollBarHeight in interface Scrollable
      Returns:
      Integer vertical scrollbar height
    • getVerticalScrollBarPosition

      public Integer getVerticalScrollBarPosition()
      Description copied from interface: Scrollable
      This method returns the position of the vertical scrollbar for a Scrollable Control.
      Specified by:
      getVerticalScrollBarPosition in interface Scrollable
      Returns:
      Integer representing vertical scroll bar's position
    • getVerticalScrollBarWidth

      public Integer getVerticalScrollBarWidth()
      Description copied from interface: Scrollable
      This method returns the width of the vertical scrollbar for a Scrollable Control.
      Specified by:
      getVerticalScrollBarWidth in interface Scrollable
      Returns:
      Integer representing width of the vertical scrollbar
    • isHorizontalScrollBarVisible

      public Boolean isHorizontalScrollBarVisible()
      Description copied from interface: Scrollable
      This method returns whether the horizontal scrollbar for a Scrollable Control is currently visible.
      Specified by:
      isHorizontalScrollBarVisible in interface Scrollable
      Returns:
      True if horizontal bar is visible, False if not.
    • isVerticalScrollBarVisible

      public Boolean isVerticalScrollBarVisible()
      Description copied from interface: Scrollable
      This method returns whether the vertical scrollbar for a Scrollable Control is currently visible.
      Specified by:
      isVerticalScrollBarVisible in interface Scrollable
      Returns:
      True if vertical bar is visible, False if not.
    • setHorizontalScrollBarPosition

      public TextArea setHorizontalScrollBarPosition(Integer position)
      Description copied from interface: Scrollable
      This method sets the position of the horizontal scrollbar for a Scrollable BBjControl.
      Specified by:
      setHorizontalScrollBarPosition in interface Scrollable
      Parameters:
      position - Integer pixel location of beginning of horizontal scrollbar
      Returns:
      The control itself
    • setVerticalScrollBarPosition

      public TextArea setVerticalScrollBarPosition(Integer position)
      Description copied from interface: Scrollable
      This method sets the position of the vertical scrollbar for a Scrollable BBjControl.
      Specified by:
      setVerticalScrollBarPosition in interface Scrollable
      Parameters:
      position - Integer pixel location of beginning of vertical scrollbar
      Returns:
      The control itself
    • isTabTraversable

      public Boolean isTabTraversable()
      Description copied from interface: TabTraversable
      Returns a boolean indicating whether or not the user can navigate to the control using the tab key.
      Specified by:
      isTabTraversable in interface TabTraversable
      Returns:
      True if user can navigate to control with Tab key, False if not
    • setTabTraversable

      public TextArea setTabTraversable(Boolean traversable)
      Description copied from interface: TabTraversable
      Sets whether or not the user can navigate to the control using the tab key.
      Specified by:
      setTabTraversable in interface TabTraversable
      Parameters:
      traversable - Boolean dictating tab traversal. True if control can be navigated to with Tab, False if not.
      Returns:
      The control itself
    • setText

      public TextArea setText(String text)
      Description copied from interface: HasControlText
      set the text of the control Each control implementing this interface has a text property, which might be visible in different ways (caption, title, contents of edit) or sometimes not visible at all
      Specified by:
      setText in interface HasControlText
      Overrides:
      setText in class AbstractDwcControl
      Returns:
      the control itself
    • setVisible

      public TextArea setVisible(Boolean visible)
      Description copied from interface: HasVisibility
      Set whether the control is visible or invisible
      Specified by:
      setVisible in interface HasVisibility
      Overrides:
      setVisible in class AbstractDwcControl
      Returns:
      the control itself
    • setEnabled

      public TextArea setEnabled(Boolean enabled)
      Description copied from interface: Enableable
      Set whether the control is to be enabled
      Specified by:
      setEnabled in interface Enableable
      Overrides:
      setEnabled in class AbstractDwcControl
      Returns:
      the control itself
    • setTooltipText

      public TextArea setTooltipText(String text)
      Description copied from interface: HasTooltip
      Set the tooltip text of the control
      Specified by:
      setTooltipText in interface HasTooltip
      Overrides:
      setTooltipText in class AbstractDwcControl
      Returns:
      the control itself
    • setAttribute

      public TextArea setAttribute(String attribute, String value)
      Description copied from class: AbstractDwcControl
      set the value for an attribute in the control
      Specified by:
      setAttribute in interface HasAttribute
      Overrides:
      setAttribute in class AbstractDwcControl
      Parameters:
      attribute - the name of the attribute
      value - the value to be set
      Returns:
      the control itself
    • setId

      public TextArea setId(String elementId)
      Description copied from interface: Control
      Assigns the ID of a control
      Specified by:
      setId in interface Control
      Overrides:
      setId in class AbstractControl
      Parameters:
      elementId - Desired ID designation
      Returns:
      The control itself
    • setStyle

      public TextArea setStyle(String property, String value)
      Description copied from interface: HasStyle
      Assigns specified value to the specified CSS property
      Specified by:
      setStyle in interface HasStyle
      Overrides:
      setStyle in class AbstractDwcControl
      Parameters:
      property - The CSS property to be changed
      value - The value of the selected CSS property
      Returns:
      The control itself
    • addClassName

      public TextArea addClassName(String selector)
      Description copied from interface: HasClassName
      Adds a CSS class to the list of CSS classes for the control.
      Specified by:
      addClassName in interface HasClassName
      Overrides:
      addClassName in class AbstractDwcControl
      Returns:
      The control itself
    • removeClassName

      public TextArea removeClassName(String selector)
      Description copied from interface: HasClassName
      Removes a CSS class from the list of CSS classes for the control.
      Specified by:
      removeClassName in interface HasClassName
      Overrides:
      removeClassName in class AbstractDwcControl
      Returns:
      The control itself
    • setExpanse

      public TextArea setExpanse(TextArea.Expanse expanse)
    • setTheme

      public TextArea setTheme(TextArea.Theme theme)
    • catchUp

      protected void catchUp() throws IllegalAccessException
      Description copied from class: AbstractDwcControl
      The catchUp method is used to replay attributes and settings that the API user might have added to a control before its creation. A control is not created before it's added to a panel. Anything that is added between instantiation of a control and its addition to a panel has to be recorded and replayed in this method
      Overrides:
      catchUp in class AbstractDwcControl
      Throws:
      IllegalAccessException - - thrown if an attempt is made to call this method more than once