org.apache.pivot.wtk.skin.terra
Class TerraTextInputSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.terra.TerraTextInputSkin
All Implemented Interfaces:
org.apache.pivot.wtk.ComponentKeyListener, org.apache.pivot.wtk.ComponentListener, org.apache.pivot.wtk.ComponentMouseButtonListener, org.apache.pivot.wtk.ComponentMouseListener, org.apache.pivot.wtk.ComponentMouseWheelListener, org.apache.pivot.wtk.ComponentStateListener, org.apache.pivot.wtk.ComponentTooltipListener, org.apache.pivot.wtk.ConstrainedVisual, org.apache.pivot.wtk.Skin, org.apache.pivot.wtk.TextInput.Skin, org.apache.pivot.wtk.TextInputContentListener, org.apache.pivot.wtk.TextInputListener, org.apache.pivot.wtk.TextInputSelectionListener, org.apache.pivot.wtk.Visual

public class TerraTextInputSkin
extends org.apache.pivot.wtk.skin.ComponentSkin
implements org.apache.pivot.wtk.TextInput.Skin, org.apache.pivot.wtk.TextInputListener, org.apache.pivot.wtk.TextInputContentListener, org.apache.pivot.wtk.TextInputSelectionListener

Text input skin.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputListener
org.apache.pivot.wtk.TextInputListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TextInputContentListener
org.apache.pivot.wtk.TextInputContentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
org.apache.pivot.wtk.ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
org.apache.pivot.wtk.ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
org.apache.pivot.wtk.ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
org.apache.pivot.wtk.ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
org.apache.pivot.wtk.ComponentKeyListener.Adapter
 
Constructor Summary
TerraTextInputSkin()
           
 
Method Summary
 void editableChanged(org.apache.pivot.wtk.TextInput textInput)
           
 void enabledChanged(org.apache.pivot.wtk.Component component)
           
 void focusedChanged(org.apache.pivot.wtk.Component component, org.apache.pivot.wtk.Component obverseComponent)
           
 Color getBackgroundColor()
           
 int getBaseline(int width, int height)
           
 Color getBorderColor()
           
 org.apache.pivot.wtk.Bounds getCharacterBounds(int index)
           
 Color getColor()
           
 Color getDisabledBackgroundColor()
           
 Color getDisabledBorderColor()
           
 Color getDisabledColor()
           
 Font getFont()
           
 org.apache.pivot.wtk.HorizontalAlignment getHorizontalAlignment()
           
 Color getInactiveSelectionBackgroundColor()
           
 Color getInactiveSelectionColor()
           
 int getInsertionPoint(int x)
           
 Color getInvalidBackgroundColor()
           
 Color getInvalidColor()
           
 org.apache.pivot.wtk.Insets getPadding()
           
 int getPreferredHeight(int width)
           
 org.apache.pivot.wtk.Dimensions getPreferredSize()
           
 int getPreferredWidth(int height)
           
 Color getPromptColor()
           
 Color getSelectionBackgroundColor()
           
 Color getSelectionColor()
           
 void insertTextVetoed(org.apache.pivot.wtk.TextInput textInput, org.apache.pivot.util.Vote reason)
           
 void install(org.apache.pivot.wtk.Component component)
           
 boolean keyPressed(org.apache.pivot.wtk.Component component, int keyCode, org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
          DELETE Delete the character after the caret or the entire selection if there is one.
 boolean keyTyped(org.apache.pivot.wtk.Component component, char character)
           
 void layout()
           
 void maximumLengthChanged(org.apache.pivot.wtk.TextInput textInput, int previousMaximumLength)
           
 boolean mouseClick(org.apache.pivot.wtk.Component component, org.apache.pivot.wtk.Mouse.Button button, int x, int y, int count)
           
 boolean mouseDown(org.apache.pivot.wtk.Component component, org.apache.pivot.wtk.Mouse.Button button, int x, int y)
           
 boolean mouseMove(org.apache.pivot.wtk.Component component, int x, int y)
           
 boolean mouseUp(org.apache.pivot.wtk.Component component, org.apache.pivot.wtk.Mouse.Button button, int x, int y)
           
 void paint(Graphics2D graphics)
           
 void passwordChanged(org.apache.pivot.wtk.TextInput textInput)
           
 org.apache.pivot.util.Vote previewInsertText(org.apache.pivot.wtk.TextInput textInput, CharSequence text, int index)
           
 org.apache.pivot.util.Vote previewRemoveText(org.apache.pivot.wtk.TextInput textInput, int index, int count)
           
 void promptChanged(org.apache.pivot.wtk.TextInput textInput, String previousPrompt)
           
 void removeTextVetoed(org.apache.pivot.wtk.TextInput textInput, org.apache.pivot.util.Vote reason)
           
 void selectionChanged(org.apache.pivot.wtk.TextInput textInput, int previousSelectionStart, int previousSelectionLength)
           
 void setBackgroundColor(Color backgroundColor)
           
 void setBackgroundColor(int color)
           
 void setBackgroundColor(String backgroundColor)
           
 void setBorderColor(Color borderColor)
           
 void setBorderColor(int color)
           
 void setBorderColor(String borderColor)
           
 void setColor(Color color)
           
 void setColor(int color)
           
 void setColor(String color)
           
 void setDisabledBackgroundColor(Color disabledBackgroundColor)
           
 void setDisabledBackgroundColor(int color)
           
 void setDisabledBackgroundColor(String disabledBackgroundColor)
           
 void setDisabledBorderColor(Color disabledBorderColor)
           
 void setDisabledBorderColor(int color)
           
 void setDisabledBorderColor(String disabledBorderColor)
           
 void setDisabledColor(Color disabledColor)
           
 void setDisabledColor(int disabledColor)
           
 void setDisabledColor(String disabledColor)
           
 void setFont(org.apache.pivot.collections.Dictionary<String,?> font)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setHorizontalAlignment(org.apache.pivot.wtk.HorizontalAlignment alignment)
           
 void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
           
 void setInactiveSelectionBackgroundColor(int color)
           
 void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
           
 void setInactiveSelectionColor(Color inactiveSelectionColor)
           
 void setInactiveSelectionColor(int color)
           
 void setInactiveSelectionColor(String inactiveSelectionColor)
           
 void setInvalidBackgroundColor(Color color)
           
 void setInvalidBackgroundColor(int color)
           
 void setInvalidBackgroundColor(String color)
           
 void setInvalidColor(Color color)
           
 void setInvalidColor(int color)
           
 void setInvalidColor(String color)
           
 void setPadding(org.apache.pivot.collections.Dictionary<String,?> padding)
           
 void setPadding(org.apache.pivot.wtk.Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setPadding(String padding)
           
 void setPromptColor(Color promptColor)
           
 void setPromptColor(int promptColor)
           
 void setPromptColor(String promptColor)
           
 void setSelectionBackgroundColor(Color selectionBackgroundColor)
           
 void setSelectionBackgroundColor(int color)
           
 void setSelectionBackgroundColor(String selectionBackgroundColor)
           
 void setSelectionColor(Color selectionColor)
           
 void setSelectionColor(int color)
           
 void setSelectionColor(String selectionColor)
           
 void setSize(int width, int height)
           
 void showCaret(boolean show)
           
 void strictValidationChanged(org.apache.pivot.wtk.TextInput textInput)
           
 void textChanged(org.apache.pivot.wtk.TextInput textInput)
           
 void textInserted(org.apache.pivot.wtk.TextInput textInput, int index, int count)
           
 void textRemoved(org.apache.pivot.wtk.TextInput textInput, int index, int count)
           
 void textSizeChanged(org.apache.pivot.wtk.TextInput textInput, int previousTextSize)
           
 void textValidatorChanged(org.apache.pivot.wtk.TextInput textInput, org.apache.pivot.wtk.validation.Validator previousValidator)
           
 void textValidChanged(org.apache.pivot.wtk.TextInput textInput)
           
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, keyReleased, locationChanged, menuHandlerChanged, mouseOut, mouseOver, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerraTextInputSkin

public TerraTextInputSkin()
Method Detail

install

public void install(org.apache.pivot.wtk.Component component)
Specified by:
install in interface org.apache.pivot.wtk.Skin
Overrides:
install in class org.apache.pivot.wtk.skin.ComponentSkin

getPreferredWidth

public int getPreferredWidth(int height)
Specified by:
getPreferredWidth in interface org.apache.pivot.wtk.ConstrainedVisual

getPreferredHeight

public int getPreferredHeight(int width)
Specified by:
getPreferredHeight in interface org.apache.pivot.wtk.ConstrainedVisual

getPreferredSize

public org.apache.pivot.wtk.Dimensions getPreferredSize()
Specified by:
getPreferredSize in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
getPreferredSize in class org.apache.pivot.wtk.skin.ComponentSkin

getBaseline

public int getBaseline(int width,
                       int height)
Specified by:
getBaseline in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
getBaseline in class org.apache.pivot.wtk.skin.ComponentSkin

layout

public void layout()
Specified by:
layout in interface org.apache.pivot.wtk.Skin

paint

public void paint(Graphics2D graphics)
Specified by:
paint in interface org.apache.pivot.wtk.Visual

getInsertionPoint

public int getInsertionPoint(int x)
Specified by:
getInsertionPoint in interface org.apache.pivot.wtk.TextInput.Skin

getCharacterBounds

public org.apache.pivot.wtk.Bounds getCharacterBounds(int index)
Specified by:
getCharacterBounds in interface org.apache.pivot.wtk.TextInput.Skin

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

setFont

public final void setFont(org.apache.pivot.collections.Dictionary<String,?> font)

getColor

public Color getColor()

setColor

public void setColor(Color color)

setColor

public final void setColor(String color)

setColor

public final void setColor(int color)

getPromptColor

public Color getPromptColor()

setPromptColor

public void setPromptColor(Color promptColor)

setPromptColor

public final void setPromptColor(String promptColor)

setPromptColor

public final void setPromptColor(int promptColor)

getDisabledColor

public Color getDisabledColor()

setDisabledColor

public void setDisabledColor(Color disabledColor)

setDisabledColor

public final void setDisabledColor(String disabledColor)

setDisabledColor

public final void setDisabledColor(int disabledColor)

getBackgroundColor

public Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(Color backgroundColor)

setBackgroundColor

public final void setBackgroundColor(String backgroundColor)

setBackgroundColor

public final void setBackgroundColor(int color)

getInvalidColor

public Color getInvalidColor()

setInvalidColor

public void setInvalidColor(Color color)

setInvalidColor

public final void setInvalidColor(String color)

setInvalidColor

public final void setInvalidColor(int color)

getInvalidBackgroundColor

public Color getInvalidBackgroundColor()

setInvalidBackgroundColor

public void setInvalidBackgroundColor(Color color)

setInvalidBackgroundColor

public final void setInvalidBackgroundColor(String color)

setInvalidBackgroundColor

public final void setInvalidBackgroundColor(int color)

getDisabledBackgroundColor

public Color getDisabledBackgroundColor()

setDisabledBackgroundColor

public void setDisabledBackgroundColor(Color disabledBackgroundColor)

setDisabledBackgroundColor

public final void setDisabledBackgroundColor(String disabledBackgroundColor)

setDisabledBackgroundColor

public final void setDisabledBackgroundColor(int color)

getBorderColor

public Color getBorderColor()

setBorderColor

public void setBorderColor(Color borderColor)

setBorderColor

public final void setBorderColor(String borderColor)

setBorderColor

public final void setBorderColor(int color)

getDisabledBorderColor

public Color getDisabledBorderColor()

setDisabledBorderColor

public void setDisabledBorderColor(Color disabledBorderColor)

setDisabledBorderColor

public final void setDisabledBorderColor(String disabledBorderColor)

setDisabledBorderColor

public final void setDisabledBorderColor(int color)

getSelectionColor

public Color getSelectionColor()

setSelectionColor

public void setSelectionColor(Color selectionColor)

setSelectionColor

public final void setSelectionColor(String selectionColor)

setSelectionColor

public final void setSelectionColor(int color)

getSelectionBackgroundColor

public Color getSelectionBackgroundColor()

setSelectionBackgroundColor

public void setSelectionBackgroundColor(Color selectionBackgroundColor)

setSelectionBackgroundColor

public final void setSelectionBackgroundColor(String selectionBackgroundColor)

setSelectionBackgroundColor

public final void setSelectionBackgroundColor(int color)

getInactiveSelectionColor

public Color getInactiveSelectionColor()

setInactiveSelectionColor

public void setInactiveSelectionColor(Color inactiveSelectionColor)

setInactiveSelectionColor

public final void setInactiveSelectionColor(String inactiveSelectionColor)

setInactiveSelectionColor

public final void setInactiveSelectionColor(int color)

getInactiveSelectionBackgroundColor

public Color getInactiveSelectionBackgroundColor()

setInactiveSelectionBackgroundColor

public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)

setInactiveSelectionBackgroundColor

public final void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)

setInactiveSelectionBackgroundColor

public final void setInactiveSelectionBackgroundColor(int color)

getPadding

public org.apache.pivot.wtk.Insets getPadding()

setPadding

public void setPadding(org.apache.pivot.wtk.Insets padding)

setPadding

public final void setPadding(org.apache.pivot.collections.Dictionary<String,?> padding)

setPadding

public final void setPadding(int padding)

setPadding

public final void setPadding(Number padding)

setPadding

public final void setPadding(String padding)

getHorizontalAlignment

public org.apache.pivot.wtk.HorizontalAlignment getHorizontalAlignment()

setHorizontalAlignment

public final void setHorizontalAlignment(org.apache.pivot.wtk.HorizontalAlignment alignment)

mouseMove

public boolean mouseMove(org.apache.pivot.wtk.Component component,
                         int x,
                         int y)
Specified by:
mouseMove in interface org.apache.pivot.wtk.ComponentMouseListener
Overrides:
mouseMove in class org.apache.pivot.wtk.skin.ComponentSkin

mouseDown

public boolean mouseDown(org.apache.pivot.wtk.Component component,
                         org.apache.pivot.wtk.Mouse.Button button,
                         int x,
                         int y)
Specified by:
mouseDown in interface org.apache.pivot.wtk.ComponentMouseButtonListener
Overrides:
mouseDown in class org.apache.pivot.wtk.skin.ComponentSkin

mouseUp

public boolean mouseUp(org.apache.pivot.wtk.Component component,
                       org.apache.pivot.wtk.Mouse.Button button,
                       int x,
                       int y)
Specified by:
mouseUp in interface org.apache.pivot.wtk.ComponentMouseButtonListener
Overrides:
mouseUp in class org.apache.pivot.wtk.skin.ComponentSkin

mouseClick

public boolean mouseClick(org.apache.pivot.wtk.Component component,
                          org.apache.pivot.wtk.Mouse.Button button,
                          int x,
                          int y,
                          int count)
Specified by:
mouseClick in interface org.apache.pivot.wtk.ComponentMouseButtonListener
Overrides:
mouseClick in class org.apache.pivot.wtk.skin.ComponentSkin

keyTyped

public boolean keyTyped(org.apache.pivot.wtk.Component component,
                        char character)
Specified by:
keyTyped in interface org.apache.pivot.wtk.ComponentKeyListener
Overrides:
keyTyped in class org.apache.pivot.wtk.skin.ComponentSkin

keyPressed

public boolean keyPressed(org.apache.pivot.wtk.Component component,
                          int keyCode,
                          org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
DELETE Delete the character after the caret or the entire selection if there is one.
BACKSPACE Delete the character before the caret or the entire selection if there is one.

HOME Move the caret to the beginning of the text.
LEFT + META Move the caret to the beginning of the text.

HOME + SHIFT Select from the caret to the beginning of the text.
LEFT + META + SHIFT Select from the caret to the beginning of the text.

END Move the caret to the end of the text.
RIGHT + META Move the caret to the end of the text.

END + SHIFT Select from the caret to the end of the text.
RIGHT + META + SHIFT Select from the caret to the end of the text.

LEFT Clear the selection and move the caret back by one character.
LEFT + SHIFT Add the previous character to the selection.
LEFT + CTRL Clear the selection and move the caret to the beginning of the text.
LEFT + CTRL + SHIFT Add all preceding text to the selection.

RIGHT Clear the selection and move the caret forward by one character.
RIGHT + SHIFT Add the next character to the selection.
RIGHT + CTRL Clear the selection and move the caret to the end of the text.
RIGHT + CTRL + SHIFT Add all subsequent text to the selection.

CommandModifier + A Select all.
CommandModifier + X Cut selection to clipboard (if not a password TextInput).
CommandModifier + C Copy selection to clipboard (if not a password TextInput).
CommandModifier + V Paste from clipboard.
CommandModifier + Z Undo.

Specified by:
keyPressed in interface org.apache.pivot.wtk.ComponentKeyListener
Overrides:
keyPressed in class org.apache.pivot.wtk.skin.ComponentSkin
See Also:
Platform.getCommandModifier()

enabledChanged

public void enabledChanged(org.apache.pivot.wtk.Component component)
Specified by:
enabledChanged in interface org.apache.pivot.wtk.ComponentStateListener
Overrides:
enabledChanged in class org.apache.pivot.wtk.skin.ComponentSkin

focusedChanged

public void focusedChanged(org.apache.pivot.wtk.Component component,
                           org.apache.pivot.wtk.Component obverseComponent)
Specified by:
focusedChanged in interface org.apache.pivot.wtk.ComponentStateListener
Overrides:
focusedChanged in class org.apache.pivot.wtk.skin.ComponentSkin

textSizeChanged

public void textSizeChanged(org.apache.pivot.wtk.TextInput textInput,
                            int previousTextSize)
Specified by:
textSizeChanged in interface org.apache.pivot.wtk.TextInputListener

maximumLengthChanged

public void maximumLengthChanged(org.apache.pivot.wtk.TextInput textInput,
                                 int previousMaximumLength)
Specified by:
maximumLengthChanged in interface org.apache.pivot.wtk.TextInputListener

passwordChanged

public void passwordChanged(org.apache.pivot.wtk.TextInput textInput)
Specified by:
passwordChanged in interface org.apache.pivot.wtk.TextInputListener

promptChanged

public void promptChanged(org.apache.pivot.wtk.TextInput textInput,
                          String previousPrompt)
Specified by:
promptChanged in interface org.apache.pivot.wtk.TextInputListener

textValidatorChanged

public void textValidatorChanged(org.apache.pivot.wtk.TextInput textInput,
                                 org.apache.pivot.wtk.validation.Validator previousValidator)
Specified by:
textValidatorChanged in interface org.apache.pivot.wtk.TextInputListener

strictValidationChanged

public void strictValidationChanged(org.apache.pivot.wtk.TextInput textInput)
Specified by:
strictValidationChanged in interface org.apache.pivot.wtk.TextInputListener

textValidChanged

public void textValidChanged(org.apache.pivot.wtk.TextInput textInput)
Specified by:
textValidChanged in interface org.apache.pivot.wtk.TextInputListener

previewInsertText

public org.apache.pivot.util.Vote previewInsertText(org.apache.pivot.wtk.TextInput textInput,
                                                    CharSequence text,
                                                    int index)
Specified by:
previewInsertText in interface org.apache.pivot.wtk.TextInputContentListener

insertTextVetoed

public void insertTextVetoed(org.apache.pivot.wtk.TextInput textInput,
                             org.apache.pivot.util.Vote reason)
Specified by:
insertTextVetoed in interface org.apache.pivot.wtk.TextInputContentListener

textInserted

public void textInserted(org.apache.pivot.wtk.TextInput textInput,
                         int index,
                         int count)
Specified by:
textInserted in interface org.apache.pivot.wtk.TextInputContentListener

previewRemoveText

public org.apache.pivot.util.Vote previewRemoveText(org.apache.pivot.wtk.TextInput textInput,
                                                    int index,
                                                    int count)
Specified by:
previewRemoveText in interface org.apache.pivot.wtk.TextInputContentListener

setSize

public void setSize(int width,
                    int height)
Specified by:
setSize in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
setSize in class org.apache.pivot.wtk.skin.ComponentSkin

removeTextVetoed

public void removeTextVetoed(org.apache.pivot.wtk.TextInput textInput,
                             org.apache.pivot.util.Vote reason)
Specified by:
removeTextVetoed in interface org.apache.pivot.wtk.TextInputContentListener

textRemoved

public void textRemoved(org.apache.pivot.wtk.TextInput textInput,
                        int index,
                        int count)
Specified by:
textRemoved in interface org.apache.pivot.wtk.TextInputContentListener

textChanged

public void textChanged(org.apache.pivot.wtk.TextInput textInput)
Specified by:
textChanged in interface org.apache.pivot.wtk.TextInputContentListener

editableChanged

public void editableChanged(org.apache.pivot.wtk.TextInput textInput)
Specified by:
editableChanged in interface org.apache.pivot.wtk.TextInputListener

selectionChanged

public void selectionChanged(org.apache.pivot.wtk.TextInput textInput,
                             int previousSelectionStart,
                             int previousSelectionLength)
Specified by:
selectionChanged in interface org.apache.pivot.wtk.TextInputSelectionListener

showCaret

public void showCaret(boolean show)