|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.wombat.Component jcontrol.ui.wombat.AbstractFocusComponent jcontrol.ui.wombat.TextInputField
public class TextInputField
This class implements a single line text imput field. Using the keyboard the user can enter text into this component.
(c) Copyright 2005-2007 DOMOLOGIC GmbH
Field Summary | |
---|---|
static int |
STYLE_ALIGN_CENTER
Align text to the middle |
static int |
STYLE_ALIGN_LEFT
Align text to the left |
static int |
STYLE_ALIGN_RIGHT
Align text to the right |
Fields inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
BORDER_WIDTH, listener |
Fields inherited from interface jcontrol.ui.wombat.IFocusable |
---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
Constructor Summary | |
---|---|
TextInputField(int x,
int y,
int width,
int style)
Creates a new TextInputField. |
Method Summary | |
---|---|
void |
addText(String text)
Adds the given text at the cursor position and shifts the cursor about the length of the given text. |
String |
getText()
Returns the current text in the text input field. |
KeyEvent |
onKeyEvent(KeyEvent e)
This method is called when a keyboard action has been performed. |
int |
onTouchEvent(TouchEvent e)
Every time a touch event is fired, this method will be called. |
void |
paint(XGraphics g)
Paint the TextInputField. |
void |
setCursorBlink(boolean onoff)
Turns the blinking state of the cursor on or off. |
void |
setCursorPosition(int position)
Sets the cursor at the spectified position. |
void |
setText(String text)
Sets some text into this TextInputField. |
Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
clearCorners, drawBevelRect, drawButton, drawDottedRect, drawFocusRect, getActionListener, onActionEvent, requestFocus, setActionListener, setEnabled, setVisible |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setBounds, setDirty, setFont, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, unsafeExec, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
public static final int STYLE_ALIGN_LEFT
public static final int STYLE_ALIGN_CENTER
public static final int STYLE_ALIGN_RIGHT
Constructor Detail |
---|
public TextInputField(int x, int y, int width, int style)
x
- the x coordinatey
- the y coordinatewidth
- the width of the TextInputField. The height is calculated automatically and depends on
the font size.style
- One of the available styles STYLE_ALIGN_LEFT, STYLE_ALIGN_CENTER or STYLE_ALIGN_RIGHT.Method Detail |
---|
public void setCursorBlink(boolean onoff)
public void setText(String text)
public String getText()
public void setCursorPosition(int position)
position
- a new cursor position.public int onTouchEvent(TouchEvent e)
TouchListener
onTouchEvent
in interface TouchListener
onTouchEvent
in class AbstractFocusComponent
e
- The touch event.
RESULT_ACCEPTED
if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED
if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE
if the TouchEvent should be passed on to the next TouchListener.public void addText(String text)
text
- a text to add.public KeyEvent onKeyEvent(KeyEvent e)
AbstractFocusComponent
onKeyEvent
in interface KeyListener
onKeyEvent
in class AbstractFocusComponent
e
- the event that contains information about the key.
null
if the KeyEvent has been consumed by the KeyListener,public void paint(XGraphics g)
paint
in class Component
g
- the application's graphics object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |