Package org.dwcj.controls.textarea
Class TextArea
java.lang.Object
org.dwcj.controls.AbstractControl
org.dwcj.controls.AbstractDwcControl
org.dwcj.controls.textarea.TextArea
- All Implemented Interfaces:
Control,Enableable,Focusable,HasAttribute,HasClassName,HasComputedStyle,HasControlText,HasDestroy,HasMouseWheelCondition,HasReadOnly,HasStyle,HasTooltip,HasVisibility,Scrollable,TabTraversable,TextHighlightable
public final class TextArea
extends AbstractDwcControl
implements HasReadOnly, TextHighlightable, Focusable, HasMouseWheelCondition, Scrollable, TabTraversable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.dwcj.interfaces.HasMouseWheelCondition
HasMouseWheelCondition.MouseWheelConditionNested classes/interfaces inherited from interface org.dwcj.interfaces.TextHighlightable
TextHighlightable.Highlight -
Field Summary
Fields inherited from class org.dwcj.controls.AbstractDwcControl
BASISNUMBER_1, BASISNUMBER_25, BASISNUMBER_250, focusable, horizontalScrollBarPosition, mouseWheelCondition, readOnly, STR_EXPANSE, STR_THEME, tabTraversable, textAlignment, textHighlight, verticalScrollBarPositionFields inherited from class org.dwcj.controls.AbstractControl
ctrl, destroyed, elementId, userData -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClassName(String selector) Adds a CSS class to the list of CSS classes for the control.addParagraph(Integer index, String paragraph) Adds a paragraph to the MultilineEdit controlappendToParagraph(Integer parNum, String text) Appends text to the end of a paragraph in the MultilineEdit controlprotected voidcatchUp()The catchUp method is used to replay attributes and settings that the API user might have added to a control before its creation.protected voidCreate the object on a panel p.This method returns the text of all paragraphs from the MultilineEdit in a ListThis method returns the current zero-based paragraph index in the MultilineEdit controlThis method returns an enum representing the current behavior of highlighting in a text control when the control receives focus.This method returns the height of the horizontal scrollbar for a Scrollable Control.This method returns the position of the horizontal scrollbar for a Scrollable Control.This method returns the width of the horizontal scrollbar for a Scrollable Control.This method returns the maximum number of lines (paragraphs) that can be entered into the MultilineEdit controlThis method returns the maximum length of the text in a MultilineEdit controlReturns the maximum number of characters allowed per paragraph in the MultilineEdit controlReturns the number of paragraphs in the MultilineEdit controlgetParagraph(Integer parNum) Returns the paragraph text in the MultilineEdit controlgetScrollWheelBehavior returns a constant indicating under what situations the control will respond to the mouse scroll wheel.Returns the selected text in the MultilineEdit controlReturns the tab size in the MultilineEdit controlThis method returns the height of the vertical scrollbar for a Scrollable Control.This method returns the position of the vertical scrollbar for a Scrollable Control.This method returns the width of the vertical scrollbar for a Scrollable Control.voidHighlights characters in the MultilineEdit controlisFocusable returns a value indicating whether or not the user can focus the control.Returns whether a horizontal scroll bar will appear when the text is too large to fit within the MultilineEdit control areaThis method returns whether the horizontal scrollbar for a Scrollable Control is currently visible.This method returns whether the ENTER key is ignored in the MultilineEdit controlReturns whether TAB key is ignored in the MultilineEdit controlReturns whether the MultilineEdit control is limited to one paragraph.Returns whether lines are wrapped in the MultilineEdit controlReturns whether overtype mode is used in the MultilineEdit controlReturns a value indicating whether or not a control is set to read only or not.Returns a boolean indicating whether or not the user can navigate to the control using the tab key.Returns whether a vertical scroll bar will appear when the text is too large to fit within the MultilineEdit control area.This method returns whether the vertical scrollbar for a Scrollable Control is currently visible.This method gets the style of wrapping used if the MultilineEdit control is wrapping linesonEditModify(Consumer<TextAreaOnEditModifyEvent> callback) voidThis method removes all paragraphs from the MultilineEdit controlremoveClassName(String selector) Removes a CSS class from the list of CSS classes for the control.removeParagraph(Integer parIndex) Removes a paragraph in theMultilineEdit controlsetAttribute(String attribute, String value) set the value for an attribute in the controlsetEnabled(Boolean enabled) Set whether the control is to be enabledsetExpanse(TextArea.Expanse expanse) setFocusable(Boolean focusable) setFocusable sets whether a control can be focused.setHighlightOnFocus(TextHighlightable.Highlight highlight) This method sets the behavior of controls implementing the TextControl interface when receiving focus via the keyboard, mouse, or BBjControl::focus() method FOCUS mnemonic.setHorizontalScrollable(Boolean scroll) Sets whether a horizontal scroll bar will appear when the text is too large to fit within the MultilineEdit controlsetHorizontalScrollBarPosition(Integer position) This method sets the position of the horizontal scrollbar for a Scrollable BBjControl.Assigns the ID of a controlsetIgnoreEnters(Boolean ignore) This method sets whether to ignore the ENTER key in the MultilineEdit controlsetIgnoreTabs(Boolean ignore) Sets whether to ignore the Tab key in the MultilineEdit controlsetLimitToOneParagraph(Boolean limit) Sets whether the MultilineEdit control is limited to one paragraphsetLineCountLimit(Integer limit) This method sets the maximum number of paragraphs (lines) that can be entered into the MultilineEdit controlsetLineWrap(Boolean wrap) Sets whether the lines will be wrapped in the MultilineEdit controlsetMaxLength(Integer length) This method sets the maximum length of the text in a MultilineEdit controlsetMaxParagraphSize(Integer size) Sets the maximum number of characters allowed in a MultilineEdit control paragraph.setOvertypeMode(Boolean overtype) Sets whether the overtype mode is used in the MultilineEdit controlsetReadOnly(Boolean editable) Sets whether the text is editable in the MultilineEdit controlsetScrollWheelBehavior configures under what situations the control will respond to the mouse scroll wheel.Assigns specified value to the specified CSS propertysetTabSize(Integer size) Sets the tab size of the MultilineEdit controlsetTabTraversable(Boolean traversable) Sets whether or not the user can navigate to the control using the tab key.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 allsetTheme(TextArea.Theme theme) setTooltipText(String text) Set the tooltip text of the controlsetVerticalScrollable(Boolean scroll) Sets whether a vertical scroll bar will appear when the text is too large to fit within the MultilineEdit controlsetVerticalScrollBarPosition(Integer position) This method sets the position of the vertical scrollbar for a Scrollable BBjControl.setVisible(Boolean visible) Set whether the control is visible or invisiblesetWrapStyleWord(Boolean word) this method sets the style of wrapping used if the MultilineEdit control is wrapping lines.Methods inherited from class org.dwcj.controls.AbstractDwcControl
destroy, getAttribute, getComputedStyle, getText, getTooltipText, isEnabled, isVisible, setControlExpanse, setControlThemeMethods inherited from class org.dwcj.controls.AbstractControl
getCaughtUp, getId, getUserData, isDestroyed, setUserData
-
Constructor Details
-
TextArea
public TextArea()
-
-
Method Details
-
create
Description copied from class:AbstractControlCreate the object on a panel p. The preferred way of creating an object is using the Panel::add(Control) method, instead of this- Overrides:
createin classAbstractControl- Parameters:
p- the panel to add this control on
-
onEditModify
-
addParagraph
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
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
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
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
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
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
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
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
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
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
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
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
Returns the number of paragraphs in the MultilineEdit control- Returns:
- Returns the number of paragraphs in the control.
-
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
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
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
Returns the tab size in the MultilineEdit control- Returns:
- Returns the tab size of the control.
-
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
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
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
Removes a paragraph in theMultilineEdit control- Parameters:
parIndex- - Specifies the 0-based index of the paragraph to be removed.- Returns:
- Returns this
-
setHorizontalScrollable
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
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
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
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
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
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
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
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
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
Sets the tab size of the MultilineEdit control- Parameters:
size- - Specifies the tab size.- Returns:
- Returns this
-
setVerticalScrollable
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
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
Description copied from interface:HasReadOnlyReturns a value indicating whether or not a control is set to read only or not.- Specified by:
isReadOnlyin interfaceHasReadOnly- Returns:
- Boolean indicating whether or not the user can edit the control.
-
setReadOnly
Sets whether the text is editable in the MultilineEdit control- Specified by:
setReadOnlyin interfaceHasReadOnly- Parameters:
editable- - Specifies whether the text can be edited (false = Not Editable, true = Editable).- Returns:
- Returns this
-
getHighlightOnFocus
Description copied from interface:TextHighlightableThis method returns an enum representing the current behavior of highlighting in a text control when the control receives focus.- Specified by:
getHighlightOnFocusin interfaceTextHighlightable- Returns:
- Enum representing BBj constant for highlight on focus
-
setHighlightOnFocus
Description copied from interface:TextHighlightableThis 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:
setHighlightOnFocusin interfaceTextHighlightable- Parameters:
highlight- Enum representing a BBj constant that dictates highlight behavior for control- Returns:
- The control itself.
-
isFocusable
Description copied from interface:FocusableisFocusable 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:
isFocusablein interfaceFocusable- Returns:
- True if object can be focused, False if not.
-
setFocusable
Description copied from interface:FocusablesetFocusable 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:
setFocusablein interfaceFocusable- Parameters:
focusable- Boolean True for allowing focusing, False to disable focus- Returns:
- Object itself
-
getScrollWheelBehavior
Description copied from interface:HasMouseWheelConditiongetScrollWheelBehavior returns a constant indicating under what situations the control will respond to the mouse scroll wheel.- Specified by:
getScrollWheelBehaviorin interfaceHasMouseWheelCondition- Returns:
- Enum value of scroll behavior
-
setScrollWheelBehavior
Description copied from interface:HasMouseWheelConditionsetScrollWheelBehavior configures under what situations the control will respond to the mouse scroll wheel.- Specified by:
setScrollWheelBehaviorin interfaceHasMouseWheelCondition- Parameters:
condition- Enum value for desired behavior- Returns:
- The control itself
-
getHorizontalScrollBarHeight
Description copied from interface:ScrollableThis method returns the height of the horizontal scrollbar for a Scrollable Control.- Specified by:
getHorizontalScrollBarHeightin interfaceScrollable- Returns:
- Integer height of scrollbar
-
getHorizontalScrollBarPosition
Description copied from interface:ScrollableThis method returns the position of the horizontal scrollbar for a Scrollable Control.- Specified by:
getHorizontalScrollBarPositionin interfaceScrollable- Returns:
- Integer horizontal position of scrollbar
-
getHorizontalScrollBarWidth
Description copied from interface:ScrollableThis method returns the width of the horizontal scrollbar for a Scrollable Control.- Specified by:
getHorizontalScrollBarWidthin interfaceScrollable- Returns:
- Integer horizontal scrollbar width
-
getVerticalScrollBarHeight
Description copied from interface:ScrollableThis method returns the height of the vertical scrollbar for a Scrollable Control.- Specified by:
getVerticalScrollBarHeightin interfaceScrollable- Returns:
- Integer vertical scrollbar height
-
getVerticalScrollBarPosition
Description copied from interface:ScrollableThis method returns the position of the vertical scrollbar for a Scrollable Control.- Specified by:
getVerticalScrollBarPositionin interfaceScrollable- Returns:
- Integer representing vertical scroll bar's position
-
getVerticalScrollBarWidth
Description copied from interface:ScrollableThis method returns the width of the vertical scrollbar for a Scrollable Control.- Specified by:
getVerticalScrollBarWidthin interfaceScrollable- Returns:
- Integer representing width of the vertical scrollbar
-
isHorizontalScrollBarVisible
Description copied from interface:ScrollableThis method returns whether the horizontal scrollbar for a Scrollable Control is currently visible.- Specified by:
isHorizontalScrollBarVisiblein interfaceScrollable- Returns:
- True if horizontal bar is visible, False if not.
-
isVerticalScrollBarVisible
Description copied from interface:ScrollableThis method returns whether the vertical scrollbar for a Scrollable Control is currently visible.- Specified by:
isVerticalScrollBarVisiblein interfaceScrollable- Returns:
- True if vertical bar is visible, False if not.
-
setHorizontalScrollBarPosition
Description copied from interface:ScrollableThis method sets the position of the horizontal scrollbar for a Scrollable BBjControl.- Specified by:
setHorizontalScrollBarPositionin interfaceScrollable- Parameters:
position- Integer pixel location of beginning of horizontal scrollbar- Returns:
- The control itself
-
setVerticalScrollBarPosition
Description copied from interface:ScrollableThis method sets the position of the vertical scrollbar for a Scrollable BBjControl.- Specified by:
setVerticalScrollBarPositionin interfaceScrollable- Parameters:
position- Integer pixel location of beginning of vertical scrollbar- Returns:
- The control itself
-
isTabTraversable
Description copied from interface:TabTraversableReturns a boolean indicating whether or not the user can navigate to the control using the tab key.- Specified by:
isTabTraversablein interfaceTabTraversable- Returns:
- True if user can navigate to control with Tab key, False if not
-
setTabTraversable
Description copied from interface:TabTraversableSets whether or not the user can navigate to the control using the tab key.- Specified by:
setTabTraversablein interfaceTabTraversable- Parameters:
traversable- Boolean dictating tab traversal. True if control can be navigated to with Tab, False if not.- Returns:
- The control itself
-
setText
Description copied from interface:HasControlTextset 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:
setTextin interfaceHasControlText- Overrides:
setTextin classAbstractDwcControl- Returns:
- the control itself
-
setVisible
Description copied from interface:HasVisibilitySet whether the control is visible or invisible- Specified by:
setVisiblein interfaceHasVisibility- Overrides:
setVisiblein classAbstractDwcControl- Returns:
- the control itself
-
setEnabled
Description copied from interface:EnableableSet whether the control is to be enabled- Specified by:
setEnabledin interfaceEnableable- Overrides:
setEnabledin classAbstractDwcControl- Returns:
- the control itself
-
setTooltipText
Description copied from interface:HasTooltipSet the tooltip text of the control- Specified by:
setTooltipTextin interfaceHasTooltip- Overrides:
setTooltipTextin classAbstractDwcControl- Returns:
- the control itself
-
setAttribute
Description copied from class:AbstractDwcControlset the value for an attribute in the control- Specified by:
setAttributein interfaceHasAttribute- Overrides:
setAttributein classAbstractDwcControl- Parameters:
attribute- the name of the attributevalue- the value to be set- Returns:
- the control itself
-
setId
Description copied from interface:ControlAssigns the ID of a control- Specified by:
setIdin interfaceControl- Overrides:
setIdin classAbstractControl- Parameters:
elementId- Desired ID designation- Returns:
- The control itself
-
setStyle
Description copied from interface:HasStyleAssigns specified value to the specified CSS property- Specified by:
setStylein interfaceHasStyle- Overrides:
setStylein classAbstractDwcControl- Parameters:
property- The CSS property to be changedvalue- The value of the selected CSS property- Returns:
- The control itself
-
addClassName
Description copied from interface:HasClassNameAdds a CSS class to the list of CSS classes for the control.- Specified by:
addClassNamein interfaceHasClassName- Overrides:
addClassNamein classAbstractDwcControl- Returns:
- The control itself
-
removeClassName
Description copied from interface:HasClassNameRemoves a CSS class from the list of CSS classes for the control.- Specified by:
removeClassNamein interfaceHasClassName- Overrides:
removeClassNamein classAbstractDwcControl- Returns:
- The control itself
-
setExpanse
-
setTheme
-
catchUp
Description copied from class:AbstractDwcControlThe 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:
catchUpin classAbstractDwcControl- Throws:
IllegalAccessException- - thrown if an attempt is made to call this method more than once
-