Class TerraTextInputSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.terra.TerraTextInputSkin
-
- All Implemented Interfaces:
ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,Skin,TextInput.Skin,TextInputContentListener,TextInputListener,TextInputSelectionListener,Visual
public class TerraTextInputSkin extends ComponentSkin implements TextInput.Skin, TextInputListener, TextInputContentListener, TextInputSelectionListener
Text input skin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputContentListener
TextInputContentListener.Adapter, TextInputContentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputListener
TextInputListener.Adapter, TextInputListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputSelectionListener
TextInputSelectionListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraTextInputSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voideditableChanged(TextInput textInput)Called when the editable state has changed.voidenabledChanged(Component component)Called when a component's enabled state has changed.voidfocusedChanged(Component component, Component obverseComponent)Called when a component's focused state has changed.java.awt.ColorgetBackgroundColor()intgetBaseline(int width, int height)Should be implemented in every subclass.java.awt.ColorgetBorderColor()BoundsgetCharacterBounds(int index)Determine the bounding box of the character at the given index in the text in coordinates relative to the entire component (that is, adding in the insets and padding, etc.).java.awt.ColorgetColor()java.awt.ColorgetDisabledBackgroundColor()java.awt.ColorgetDisabledBorderColor()java.awt.ColorgetDisabledColor()java.awt.FontgetFont()HorizontalAlignmentgetHorizontalAlignment()java.awt.ColorgetInactiveSelectionBackgroundColor()java.awt.ColorgetInactiveSelectionColor()intgetInsertionPoint(int x)Calculate the text insertion point given the mouse X-position relative to the component's X-position.java.awt.ColorgetInvalidBackgroundColor()java.awt.ColorgetInvalidColor()InsetsgetPadding()intgetPreferredHeight(int width)Returns the visual's preferred height given the provided width constraint.DimensionsgetPreferredSize()Returns the visual's unconstrained preferred size.intgetPreferredWidth(int height)Returns the visual's preferred width given the provided height constraint.java.awt.ColorgetPromptColor()java.awt.ColorgetSelectionBackgroundColor()java.awt.ColorgetSelectionColor()TextInputMethodListenergetTextInputMethodListener()Returns the input method listener for this component.voidinsertTextVetoed(TextInput textInput, Vote reason)Called when a text insertion has been vetoed.voidinstall(Component component)Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.booleankeyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)booleankeyTyped(Component component, char character)Called when a key has been typed.voidlayout()If the component on which the skin is installed is a container, lays out the container's children.voidmaximumLengthChanged(TextInput textInput, int previousMaximumLength)Called when a text input's maximum length has changed.booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.booleanmouseDown(Component component, Mouse.Button button, int x, int y)Called when a mouse button is pressed over a component.booleanmouseMove(Component component, int x, int y)Called when the mouse is moved over a component.booleanmouseUp(Component component, Mouse.Button button, int x, int y)Called when a mouse button is released over a component.voidpaint(java.awt.Graphics2D graphics)Paints the visual.voidpasswordChanged(TextInput textInput)Called when a text input's password flag has changed.VotepreviewInsertText(TextInput textInput, java.lang.CharSequence text, int index)Called to preview a text insertion.VotepreviewRemoveText(TextInput textInput, int index, int count)Called to preview a text removal.voidpromptChanged(TextInput textInput, java.lang.String previousPrompt)Called when a text input's prompt has changed.voidremoveTextVetoed(TextInput textInput, Vote reason)Called when a text removal has been vetoed.voidselectionChanged(TextInput textInput, int previousSelectionStart, int previousSelectionLength)Called when a text input's selection state has changed.voidsetBackgroundColor(int colorIndex)voidsetBackgroundColor(java.awt.Color colorValue)voidsetBackgroundColor(java.lang.String colorString)voidsetBorderColor(int colorIndex)voidsetBorderColor(java.awt.Color colorValue)voidsetBorderColor(java.lang.String colorString)voidsetColor(int colorIndex)voidsetColor(java.awt.Color colorValue)voidsetColor(java.lang.String colorString)voidsetDisabledBackgroundColor(int colorIndex)voidsetDisabledBackgroundColor(java.awt.Color colorValue)voidsetDisabledBackgroundColor(java.lang.String colorString)voidsetDisabledBorderColor(int colorIndex)voidsetDisabledBorderColor(java.awt.Color colorValue)voidsetDisabledBorderColor(java.lang.String colorString)voidsetDisabledColor(int colorIndex)voidsetDisabledColor(java.awt.Color colorValue)voidsetDisabledColor(java.lang.String colorString)voidsetFont(java.awt.Font newFont)Set the new font to use to render the text in this component.voidsetFont(java.lang.String fontString)voidsetFont(Dictionary<java.lang.String,?> fontDict)voidsetHorizontalAlignment(HorizontalAlignment alignment)voidsetInactiveSelectionBackgroundColor(int colorIndex)voidsetInactiveSelectionBackgroundColor(java.awt.Color colorValue)voidsetInactiveSelectionBackgroundColor(java.lang.String colorString)voidsetInactiveSelectionColor(int colorIndex)voidsetInactiveSelectionColor(java.awt.Color colorValue)voidsetInactiveSelectionColor(java.lang.String colorString)voidsetInvalidBackgroundColor(int colorIndex)voidsetInvalidBackgroundColor(java.awt.Color colorValue)voidsetInvalidBackgroundColor(java.lang.String colorString)voidsetInvalidColor(int colorIndex)voidsetInvalidColor(java.awt.Color colorValue)voidsetInvalidColor(java.lang.String colorString)voidsetPadding(int paddingValue)voidsetPadding(java.lang.Number paddingValue)voidsetPadding(java.lang.String paddingString)voidsetPadding(Dictionary<java.lang.String,?> paddingDictionary)voidsetPadding(Sequence<?> paddingSequence)voidsetPadding(Insets paddingValue)voidsetPromptColor(int colorIndex)voidsetPromptColor(java.awt.Color colorValue)voidsetPromptColor(java.lang.String colorString)voidsetSelectionBackgroundColor(int colorIndex)voidsetSelectionBackgroundColor(java.awt.Color colorValue)voidsetSelectionBackgroundColor(java.lang.String colorString)voidsetSelectionColor(int colorIndex)voidsetSelectionColor(java.awt.Color colorValue)voidsetSelectionColor(java.lang.String colorString)voidsetSize(int width, int height)Set the final size of the component after layout has finished.voidshowCaret(boolean show)voidstrictValidationChanged(TextInput textInput)Called when a text input's strict validation flag has changed.voidtextChanged(TextInput textInput)Called when a text input's text has changed.voidtextInserted(TextInput textInput, int index, int count)Called when text has been inserted into a text input.voidtextRemoved(TextInput textInput, int index, int count)Called when text has been removed from a text input.voidtextSizeChanged(TextInput textInput, int previousTextSize)Called when a text input's text size has changed.voidtextValidatorChanged(TextInput textInput, Validator previousValidator)Called when the validator changes.voidtextValidChanged(TextInput textInput)Called when the text changes validity.-
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, fontFromObject, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, keyReleased, locationChanged, menuHandlerChanged, mouseOut, mouseOver, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
setSize
-
-
-
-
Method Detail
-
install
public void install(Component component)
Description copied from class:ComponentSkinMust be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
installin interfaceSkin- Overrides:
installin classComponentSkin- Parameters:
component- The component to which the skin is being attached.
-
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisualReturns the visual's preferred width given the provided height constraint.- Specified by:
getPreferredWidthin interfaceConstrainedVisual- Parameters:
height- The height by which to constrain the preferred width, or-1for no constraint.- Returns:
- The preferred width given the height constraint.
-
getPreferredHeight
public int getPreferredHeight(int width)
Description copied from interface:ConstrainedVisualReturns the visual's preferred height given the provided width constraint.- Specified by:
getPreferredHeightin interfaceConstrainedVisual- Parameters:
width- The width by which to constrain the preferred height, or-1for no constraint.- Returns:
- The preferred height given the width constraint.
-
getPreferredSize
public Dimensions getPreferredSize()
Description copied from interface:ConstrainedVisualReturns the visual's unconstrained preferred size.- Specified by:
getPreferredSizein interfaceConstrainedVisual- Overrides:
getPreferredSizein classComponentSkin- Returns:
- The preferred size (width and height) of this component.
Depending on the component this can be a static value or derived (as for a container) from its subcomponents, etc.
The default implementation simply calls
ConstrainedVisual.getPreferredWidth(int)andConstrainedVisual.getPreferredHeight(int).
-
getBaseline
public int getBaseline(int width, int height)Description copied from class:ComponentSkinShould be implemented in every subclass.The default implementation here simply returns -1 (no baseline).
- Specified by:
getBaselinein interfaceConstrainedVisual- Overrides:
getBaselinein classComponentSkin- Parameters:
width- Constrained width to compute the baseline for.height- Constrained height to compute the baseline for.- Returns:
- The baseline relative to the origin of this visual, or
-1if this visual does not have a baseline.
-
layout
public void layout()
Description copied from interface:SkinIf the component on which the skin is installed is a container, lays out the container's children.
-
paint
public void paint(java.awt.Graphics2D graphics)
Description copied from interface:VisualPaints the visual.
-
getInsertionPoint
public int getInsertionPoint(int x)
Calculate the text insertion point given the mouse X-position relative to the component's X-position.Note: if the given X-position is on the right-hand side of a glyph then the insertion point will be after that character, while an X-position within the left half of a glyph will position the insert before that character.
- Specified by:
getInsertionPointin interfaceTextInput.Skin- Parameters:
x- The relative X-position.- Returns:
- The offset into the text determined by the X-position.
-
getCharacterBounds
public Bounds getCharacterBounds(int index)
Determine the bounding box of the character at the given index in the text in coordinates relative to the entire component (that is, adding in the insets and padding, etc.).- Specified by:
getCharacterBoundsin interfaceTextInput.Skin- Parameters:
index- The 0-based index of the character to inquire about.- Returns:
- The bounding box within the component where that character
will be displayed, or
nullif there is no text.
-
getFont
public final java.awt.Font getFont()
-
setFont
public final void setFont(java.awt.Font newFont)
Set the new font to use to render the text in this component.Also calculate the
averageCharacterSizevalue based on this font, which will be the width of the "missing glyph code" and the maximum height of any character in the font.- Parameters:
newFont- The new font to use.- Throws:
java.lang.IllegalArgumentException- if thenewFontargument isnull.
-
setFont
public final void setFont(java.lang.String fontString)
-
setFont
public final void setFont(Dictionary<java.lang.String,?> fontDict)
-
getColor
public final java.awt.Color getColor()
-
setColor
public final void setColor(java.awt.Color colorValue)
-
setColor
public final void setColor(java.lang.String colorString)
-
setColor
public final void setColor(int colorIndex)
-
getPromptColor
public final java.awt.Color getPromptColor()
-
setPromptColor
public final void setPromptColor(java.awt.Color colorValue)
-
setPromptColor
public final void setPromptColor(java.lang.String colorString)
-
setPromptColor
public final void setPromptColor(int colorIndex)
-
getDisabledColor
public final java.awt.Color getDisabledColor()
-
setDisabledColor
public final void setDisabledColor(java.awt.Color colorValue)
-
setDisabledColor
public final void setDisabledColor(java.lang.String colorString)
-
setDisabledColor
public final void setDisabledColor(int colorIndex)
-
getBackgroundColor
public final java.awt.Color getBackgroundColor()
-
setBackgroundColor
public final void setBackgroundColor(java.awt.Color colorValue)
-
setBackgroundColor
public final void setBackgroundColor(java.lang.String colorString)
-
setBackgroundColor
public final void setBackgroundColor(int colorIndex)
-
getInvalidColor
public final java.awt.Color getInvalidColor()
-
setInvalidColor
public final void setInvalidColor(java.awt.Color colorValue)
-
setInvalidColor
public final void setInvalidColor(java.lang.String colorString)
-
setInvalidColor
public final void setInvalidColor(int colorIndex)
-
getInvalidBackgroundColor
public final java.awt.Color getInvalidBackgroundColor()
-
setInvalidBackgroundColor
public final void setInvalidBackgroundColor(java.awt.Color colorValue)
-
setInvalidBackgroundColor
public final void setInvalidBackgroundColor(java.lang.String colorString)
-
setInvalidBackgroundColor
public final void setInvalidBackgroundColor(int colorIndex)
-
getDisabledBackgroundColor
public final java.awt.Color getDisabledBackgroundColor()
-
setDisabledBackgroundColor
public final void setDisabledBackgroundColor(java.awt.Color colorValue)
-
setDisabledBackgroundColor
public final void setDisabledBackgroundColor(java.lang.String colorString)
-
setDisabledBackgroundColor
public final void setDisabledBackgroundColor(int colorIndex)
-
getBorderColor
public final java.awt.Color getBorderColor()
-
setBorderColor
public final void setBorderColor(java.awt.Color colorValue)
-
setBorderColor
public final void setBorderColor(java.lang.String colorString)
-
setBorderColor
public final void setBorderColor(int colorIndex)
-
getDisabledBorderColor
public final java.awt.Color getDisabledBorderColor()
-
setDisabledBorderColor
public final void setDisabledBorderColor(java.awt.Color colorValue)
-
setDisabledBorderColor
public final void setDisabledBorderColor(java.lang.String colorString)
-
setDisabledBorderColor
public final void setDisabledBorderColor(int colorIndex)
-
getSelectionColor
public final java.awt.Color getSelectionColor()
-
setSelectionColor
public final void setSelectionColor(java.awt.Color colorValue)
-
setSelectionColor
public final void setSelectionColor(java.lang.String colorString)
-
setSelectionColor
public final void setSelectionColor(int colorIndex)
-
getSelectionBackgroundColor
public final java.awt.Color getSelectionBackgroundColor()
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(java.awt.Color colorValue)
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(java.lang.String colorString)
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(int colorIndex)
-
getInactiveSelectionColor
public final java.awt.Color getInactiveSelectionColor()
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(java.awt.Color colorValue)
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(java.lang.String colorString)
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(int colorIndex)
-
getInactiveSelectionBackgroundColor
public final java.awt.Color getInactiveSelectionBackgroundColor()
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(java.awt.Color colorValue)
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(java.lang.String colorString)
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(int colorIndex)
-
getPadding
public final Insets getPadding()
-
setPadding
public final void setPadding(Insets paddingValue)
-
setPadding
public final void setPadding(Dictionary<java.lang.String,?> paddingDictionary)
-
setPadding
public final void setPadding(Sequence<?> paddingSequence)
-
setPadding
public final void setPadding(int paddingValue)
-
setPadding
public final void setPadding(java.lang.Number paddingValue)
-
setPadding
public final void setPadding(java.lang.String paddingString)
-
getHorizontalAlignment
public final HorizontalAlignment getHorizontalAlignment()
-
setHorizontalAlignment
public final void setHorizontalAlignment(HorizontalAlignment alignment)
-
mouseMove
public boolean mouseMove(Component component, int x, int y)
Description copied from interface:ComponentMouseListenerCalled when the mouse is moved over a component.- Specified by:
mouseMovein interfaceComponentMouseListener- Overrides:
mouseMovein classComponentSkin- Parameters:
component- Component that is under the mouse.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default return).
-
mouseDown
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is pressed over a component.- Specified by:
mouseDownin interfaceComponentMouseButtonListener- Overrides:
mouseDownin classComponentSkin- Parameters:
component- Component that is under the mouse pointer.button- Which mouse button was pressed.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseUp
public boolean mouseUp(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is released over a component.- Specified by:
mouseUpin interfaceComponentMouseButtonListener- Overrides:
mouseUpin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button that was released.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is clicked over a component.- Specified by:
mouseClickin interfaceComponentMouseButtonListener- Overrides:
mouseClickin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button was clicked.x- X position of the mouse.y- Y position of the mouse.count- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
keyTyped
public boolean keyTyped(Component component, char character)
Description copied from interface:ComponentKeyListenerCalled when a key has been typed.- Specified by:
keyTypedin interfaceComponentKeyListener- Overrides:
keyTypedin classComponentSkin- Parameters:
component- Component that has the focus, that is receiving this key.character- The decoded character that was typed.- Returns:
trueto consume the event;falseto allow it to propagate.
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
DELETEDelete the character after the caret or the entire selection if there is one.
BACKSPACEDelete the character before the caret or the entire selection if there is one.HOMEMove the caret to the beginning of the text.
LEFT+METAMove the caret to the beginning of the text.HOME+SHIFTSelect from the caret to the beginning of the text.
LEFT+META+SHIFTSelect from the caret to the beginning of the text.ENDMove the caret to the end of the text.
RIGHT+METAMove the caret to the end of the text.END+SHIFTSelect from the caret to the end of the text.
RIGHT+META+SHIFTSelect from the caret to the end of the text.LEFTClear the selection and move the caret back by one character.
LEFT+SHIFTAdd the previous character to the selection.
LEFT+CTRLClear the selection and move the caret to the beginning of the text.
LEFT+CTRL+SHIFTAdd all preceding text to the selection.RIGHTClear the selection and move the caret forward by one character.
RIGHT+SHIFTAdd the next character to the selection.
RIGHT+CTRLClear the selection and move the caret to the end of the text.
RIGHT+CTRL+SHIFTAdd all subsequent text to the selection.CommandModifier +
ASelect all.
CommandModifier +XCut selection to clipboard (if not a password TextInput).
CommandModifier +CCopy selection to clipboard (if not a password TextInput).
CommandModifier +VPaste from clipboard.
CommandModifier +ZUndo.- Specified by:
keyPressedin interfaceComponentKeyListener- Overrides:
keyPressedin classComponentSkin- Parameters:
component- Component that has the focus.keyCode- The key code for the key that was pressed.keyLocation- Location value for the key (left or right for shift keys, etc.).- Returns:
trueto consume the event;falseto allow it to propagate.- See Also:
Platform.getCommandModifier()
-
enabledChanged
public void enabledChanged(Component component)
Description copied from interface:ComponentStateListenerCalled when a component's enabled state has changed.Called both when the component is enabled and when it is disabled. The component's
enabledflag has already been set when this method is called so the new state can be determined by calling theComponent.isEnabled()method.- Specified by:
enabledChangedin interfaceComponentStateListener- Overrides:
enabledChangedin classComponentSkin- Parameters:
component- The component whose enabled state is changing.
-
focusedChanged
public void focusedChanged(Component component, Component obverseComponent)
Description copied from interface:ComponentStateListenerCalled when a component's focused state has changed.This will be called both when a component gains focus and when it loses focus. The currently focused component has already been set when this method is called, so that the new state of the component can be determined by calling the
Component.isFocused()method.- Specified by:
focusedChangedin interfaceComponentStateListener- Overrides:
focusedChangedin classComponentSkin- Parameters:
component- The component that is either gaining focus or the one that previously had focus and is now losing it.obverseComponent- If the component is gaining focus, this is the component that is losing focus. If the component is losing focus this is the component that is gaining the focus instead.
-
textSizeChanged
public void textSizeChanged(TextInput textInput, int previousTextSize)
Description copied from interface:TextInputListenerCalled when a text input's text size has changed.- Specified by:
textSizeChangedin interfaceTextInputListener- Parameters:
textInput- The source of this event.previousTextSize- The previous text size for the control
-
maximumLengthChanged
public void maximumLengthChanged(TextInput textInput, int previousMaximumLength)
Description copied from interface:TextInputListenerCalled when a text input's maximum length has changed.- Specified by:
maximumLengthChangedin interfaceTextInputListener- Parameters:
textInput- The source of this event.previousMaximumLength- The previous maximum text length.
-
passwordChanged
public void passwordChanged(TextInput textInput)
Description copied from interface:TextInputListenerCalled when a text input's password flag has changed.- Specified by:
passwordChangedin interfaceTextInputListener- Parameters:
textInput- The source of this event.
-
promptChanged
public void promptChanged(TextInput textInput, java.lang.String previousPrompt)
Description copied from interface:TextInputListenerCalled when a text input's prompt has changed.- Specified by:
promptChangedin interfaceTextInputListener- Parameters:
textInput- The source of this event.previousPrompt- The previous prompt string.
-
textValidatorChanged
public void textValidatorChanged(TextInput textInput, Validator previousValidator)
Description copied from interface:TextInputListenerCalled when the validator changes.- Specified by:
textValidatorChangedin interfaceTextInputListener- Parameters:
textInput- The source of this event.previousValidator- The previous validator for the text.
-
strictValidationChanged
public void strictValidationChanged(TextInput textInput)
Description copied from interface:TextInputListenerCalled when a text input's strict validation flag has changed.- Specified by:
strictValidationChangedin interfaceTextInputListener- Parameters:
textInput- The text input that has changed.
-
textValidChanged
public void textValidChanged(TextInput textInput)
Description copied from interface:TextInputListenerCalled when the text changes validity.- Specified by:
textValidChangedin interfaceTextInputListener- Parameters:
textInput- The text input that has been changed.
-
previewInsertText
public Vote previewInsertText(TextInput textInput, java.lang.CharSequence text, int index)
Description copied from interface:TextInputContentListenerCalled to preview a text insertion.- Specified by:
previewInsertTextin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.text- The text that will be inserted.index- The index at which the text will be inserted.- Returns:
- The accumulated vote as to whether to allow this insertion.
-
insertTextVetoed
public void insertTextVetoed(TextInput textInput, Vote reason)
Description copied from interface:TextInputContentListenerCalled when a text insertion has been vetoed.- Specified by:
insertTextVetoedin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.reason- The reason the event was vetoed.
-
textInserted
public void textInserted(TextInput textInput, int index, int count)
Description copied from interface:TextInputContentListenerCalled when text has been inserted into a text input.- Specified by:
textInsertedin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.index- The index at which the text was inserted.count- The number of characters that were inserted.
-
previewRemoveText
public Vote previewRemoveText(TextInput textInput, int index, int count)
Description copied from interface:TextInputContentListenerCalled to preview a text removal.- Specified by:
previewRemoveTextin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.index- The starting index from which the text will be removed.count- The count of characters to be removed starting from that index.- Returns:
- The accumulated vote as to whether to allow this removal.
-
setSize
public void setSize(int width, int height)Description copied from class:ComponentSkinSet the final size of the component after layout has finished.All subclasses must call this superclass method in order to set the
ComponentSkin.widthandComponentSkin.heightvalues, but may need to do additional calculations before doing so.- Specified by:
setSizein interfaceConstrainedVisual- Overrides:
setSizein classComponentSkin- Parameters:
width- The new (final) width of the component after layout.height- The new (final) height of the component after layout.
-
removeTextVetoed
public void removeTextVetoed(TextInput textInput, Vote reason)
Description copied from interface:TextInputContentListenerCalled when a text removal has been vetoed.- Specified by:
removeTextVetoedin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.reason- The reason the event was vetoed.
-
textRemoved
public void textRemoved(TextInput textInput, int index, int count)
Description copied from interface:TextInputContentListenerCalled when text has been removed from a text input.- Specified by:
textRemovedin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.index- The index from which the text was removed.count- The number of characters that were removed.
-
textChanged
public void textChanged(TextInput textInput)
Description copied from interface:TextInputContentListenerCalled when a text input's text has changed.- Specified by:
textChangedin interfaceTextInputContentListener- Parameters:
textInput- The source of the event.
-
editableChanged
public void editableChanged(TextInput textInput)
Description copied from interface:TextInputListenerCalled when the editable state has changed.- Specified by:
editableChangedin interfaceTextInputListener- Parameters:
textInput- The text input whose state has changed.
-
selectionChanged
public void selectionChanged(TextInput textInput, int previousSelectionStart, int previousSelectionLength)
Description copied from interface:TextInputSelectionListenerCalled when a text input's selection state has changed.- Specified by:
selectionChangedin interfaceTextInputSelectionListener- Parameters:
textInput- The source of the event.previousSelectionStart- If the selection changed directly, the previous selection start index. Otherwise, the current selection start index.previousSelectionLength- If the selection changed directly, the previous selection length. Otherwise, the current selection length.
-
showCaret
public void showCaret(boolean show)
-
getTextInputMethodListener
public TextInputMethodListener getTextInputMethodListener()
Description copied from class:ComponentSkinReturns the input method listener for this component.Should be overridden by any component's skin that wants to handle Input Method events (such as
TextInput).- Overrides:
getTextInputMethodListenerin classComponentSkin- Returns:
- The input method listener (if any) for this component.
-
-