org.kalmeo.kuix.widget
Class TextField

java.lang.Object
  extended by org.kalmeo.kuix.widget.Widget
      extended by org.kalmeo.kuix.widget.FocusableWidget
          extended by org.kalmeo.kuix.widget.TextWidget
              extended by org.kalmeo.kuix.widget.Text
                  extended by org.kalmeo.kuix.widget.TextField

public class TextField
extends Text

This class represents a textfield.

For further informations, visit the Kuix widgets reference page.

Author:
bbeaulant

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kalmeo.kuix.widget.Widget
Widget.BindInstruction
 
Field Summary
static java.lang.String ANY
           
static java.lang.String DECIMAL
           
static java.lang.String EMAILADDR
           
static java.lang.String INITIAL_CAPS_SENTENCE
           
static java.lang.String INITIAL_CAPS_WORD
           
static java.lang.String NON_PREDICTIVE
           
static java.lang.String NUMERIC
           
static java.lang.String PASSWORD
           
static java.lang.String PHONENUMBER
           
static java.lang.String SENSITIVE
           
static java.lang.String URL
           
 
Fields inherited from class org.kalmeo.kuix.widget.Text
insetHeight, textX, textY
 
Fields inherited from class org.kalmeo.kuix.widget.TextWidget
text
 
Fields inherited from class org.kalmeo.kuix.widget.FocusableWidget
DISABLED_PSEUDO_CLASS, enabled, focusable, focused, HOVER_PSEUDO_CLASS, PSEUDO_CLASSES
 
Fields inherited from class org.kalmeo.kuix.widget.Widget
bindInstructions, DEFAULT_ALIGN, DEFAULT_BACKGROUND_ALIGN, DEFAULT_BACKGROUND_REPEAT, DEFAULT_BORDER, DEFAULT_GAP, DEFAULT_MARGIN, DEFAULT_MIN_SIZE, DEFAULT_PADDING, DEFAULT_SPAN, DEFAULT_WEIGHT, next, parent, previous
 
Constructor Summary
TextField()
          Construct a TextField
 
Method Summary
 void commandAction(Command command, Displayable displayable)
           
protected  void doLayout()
          Layout the widget if its layout is defined.
 int getConstraints()
           
protected  java.lang.String getDisplayedText()
          Returns the displayed text.
 int getMaxSize()
           
 java.lang.String getOnChange()
           
 java.lang.String getTitle()
           
 java.lang.String getTooltip()
           
 boolean isEditOnAllKeys()
           
 boolean isFocusable()
          Check if this Widget is focusable.
protected  void onFocus(Widget focusedWidget)
          Call when the widget or one of its parents gain the focus.
protected  void onLostFocus(Widget focusedWidget)
          Call when the widget or one of its parents lost the focus.
 void paint(Graphics g)
          Paint the widget itself.
protected  void paintChildrenImpl(Graphics g)
          Invoke the paintImpl method on widget's children.
 boolean processActionEvent()
          Process action event
 boolean processKeyEvent(byte type, int kuixKeyCode)
          Process a key event
 boolean processPointerEvent(byte type, int x, int y)
          Process a pointer event
 boolean setAttribute(java.lang.String name, java.lang.String value)
          Set the value to the specified attribute representing by the name
 void setConstraints(int constraints)
           
 void setEditOnAllKeys(boolean editOnAllKeys)
           
 void setMaxSize(int maxSize)
           
 void setOnChange(java.lang.String onChange)
           
 TextWidget setText(java.lang.String text)
          Returns the instance of this TextWidget Useful in this case : AbstractTextWidget text = new Text().setText("message");
 void setTitle(java.lang.String title)
           
 void setTooltip(java.lang.String text)
          Define the TextField tooltip text.
 
Methods inherited from class org.kalmeo.kuix.widget.Text
add, getLayout, getPreferredSize
 
Methods inherited from class org.kalmeo.kuix.widget.TextWidget
clearCachedStyle, getAttribute, getDefaultStylePropertyValue, getFont, getText, setDefaultFontFace, setDefaultFontSize, setDefaultFontStyle
 
Methods inherited from class org.kalmeo.kuix.widget.FocusableWidget
getAvailablePseudoClasses, getOnFocus, getOnLostFocus, giveFocusToNearestWidget, isEnabled, isFocused, isPseudoClassCompatible, onAdded, processFocusEvent, remove, requestFocus, setEnabled, setFocusable, setOnFocus, setOnLostFocus, setVisible
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, getAlign, getAuthorStyle, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorder, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, getDesktop, getDisplayX, getDisplayY, getFocusManager, getGap, getGrayedColor, getHeight, getId, getInheritedTag, getInnerHeight, getInnerWidth, getInsets, getInternalChildInstance, getLastChild, getLayoutData, getMargin, getMinSize, getOtherFocus, getPadding, getSpan, getStyleClasses, getStylePropertyValue, getStyles, getTag, getWeight, getWidget, getWidgetAt, getWidgetAt, getWidth, getX, getY, hasBindInstruction, hasShortcutKeyCodes, hasShortcuts, invalidate, invalidate, invalidateAppearance, invalidateAppearanceRegion, invalidateStylePropertiesCache, isFocusWidgetChild, isIndividualyVisible, isInvalidated, isInWidgetTree, isObjectAttribute, isShortcutKeyCodeCompatible, isVisible, markAsValidate, needToComputePreferredSize, onChildAdded, onChildRemoved, onRemoved, paintBackground, paintBorder, paintImpl, paintMosaicImage, parseAuthorStyle, processDataBindEvent, processItemsModelUpdateEvent, processModelUpdateEvent, processShortcutKeyEvent, propagateFocusEvent, removeAll, removeAttributeBindInstruction, requestBackwardFocus, requestForwardFocus, sendToBack, setAttributeBindInstruction, setAuthorStyle, setBounds, setDataProvider, setId, setObjectAttribute, setShortcutKeyCodes, setShortcuts, setStyleClass, setStyleClasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY

public static final java.lang.String ANY
See Also:
Constant Field Values

EMAILADDR

public static final java.lang.String EMAILADDR
See Also:
Constant Field Values

NUMERIC

public static final java.lang.String NUMERIC
See Also:
Constant Field Values

PHONENUMBER

public static final java.lang.String PHONENUMBER
See Also:
Constant Field Values

DECIMAL

public static final java.lang.String DECIMAL
See Also:
Constant Field Values

URL

public static final java.lang.String URL
See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
See Also:
Constant Field Values

SENSITIVE

public static final java.lang.String SENSITIVE
See Also:
Constant Field Values

NON_PREDICTIVE

public static final java.lang.String NON_PREDICTIVE
See Also:
Constant Field Values

INITIAL_CAPS_WORD

public static final java.lang.String INITIAL_CAPS_WORD
See Also:
Constant Field Values

INITIAL_CAPS_SENTENCE

public static final java.lang.String INITIAL_CAPS_SENTENCE
See Also:
Constant Field Values
Constructor Detail

TextField

public TextField()
Construct a TextField

Method Detail

setAttribute

public boolean setAttribute(java.lang.String name,
                            java.lang.String value)
Description copied from class: Widget
Set the value to the specified attribute representing by the name

Overrides:
setAttribute in class TextWidget
Returns:
true if the attribute exists

getTitle

public java.lang.String getTitle()
Returns:
the title

setTitle

public void setTitle(java.lang.String title)
Parameters:
title - the title to set

getMaxSize

public int getMaxSize()
Returns:
the maxSize

setMaxSize

public void setMaxSize(int maxSize)
Parameters:
maxSize - the maxSize to set

getConstraints

public int getConstraints()
Returns:
the constraints

setConstraints

public void setConstraints(int constraints)
Parameters:
constraints - the constraints to set

isEditOnAllKeys

public boolean isEditOnAllKeys()
Returns:
the editOnAllKeys

setEditOnAllKeys

public void setEditOnAllKeys(boolean editOnAllKeys)
Parameters:
editOnAllKeys - the editOnAllKeys to set

getTooltip

public java.lang.String getTooltip()
Returns:
th tooltip

setTooltip

public void setTooltip(java.lang.String text)
Define the TextField tooltip text.

Parameters:
text -

getOnChange

public java.lang.String getOnChange()
Returns:
the onChange

setOnChange

public void setOnChange(java.lang.String onChange)
Parameters:
onChange - the onChange to set

isFocusable

public boolean isFocusable()
Description copied from class: Widget
Check if this Widget is focusable.

Overrides:
isFocusable in class TextWidget
Returns:
true if the widget is focusable

setText

public TextWidget setText(java.lang.String text)
Description copied from class: TextWidget
Returns the instance of this TextWidget Useful in this case : AbstractTextWidget text = new Text().setText("message");

Overrides:
setText in class TextWidget
Parameters:
text - the text to set

getDisplayedText

protected java.lang.String getDisplayedText()
Description copied from class: TextWidget
Returns the displayed text. By default displayed text is the text value.

Overrides:
getDisplayedText in class TextWidget
Returns:
the displayed text

doLayout

protected void doLayout()
Description copied from class: Widget
Layout the widget if its layout is defined.

Overrides:
doLayout in class Text

paint

public void paint(Graphics g)
Description copied from class: Widget
Paint the widget itself.

Overrides:
paint in class Text

paintChildrenImpl

protected void paintChildrenImpl(Graphics g)
Description copied from class: Widget
Invoke the paintImpl method on widget's children.

Overrides:
paintChildrenImpl in class Text

commandAction

public void commandAction(Command command,
                          Displayable displayable)

processPointerEvent

public boolean processPointerEvent(byte type,
                                   int x,
                                   int y)
Description copied from class: Widget
Process a pointer event

Overrides:
processPointerEvent in class FocusableWidget
Returns:
true if the event is treated by the widget

processKeyEvent

public boolean processKeyEvent(byte type,
                               int kuixKeyCode)
Description copied from class: Widget
Process a key event

Overrides:
processKeyEvent in class Widget
Returns:
true if the event is treated by the widget

processActionEvent

public boolean processActionEvent()
Description copied from class: Widget
Process action event

Overrides:
processActionEvent in class Widget
Returns:
true if the event is treated by the widget

onFocus

protected void onFocus(Widget focusedWidget)
Description copied from class: Widget
Call when the widget or one of its parents gain the focus.

Overrides:
onFocus in class Text

onLostFocus

protected void onLostFocus(Widget focusedWidget)
Description copied from class: Widget
Call when the widget or one of its parents lost the focus.

Overrides:
onLostFocus in class Text


Copyright © 2007-2008 Kalmeo. All Rights Reserved.