All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dtai.gwt.TextFieldGadget

java.lang.Object
   |
   +----dtai.gwt.Gadget
           |
           +----dtai.gwt.ContainerGadget
                   |
                   +----dtai.gwt.PanelGadget
                           |
                           +----dtai.gwt.BorderGadget
                                   |
                                   +----dtai.gwt.TextFieldGadget

public class TextFieldGadget
extends BorderGadget
implements TextGadget, Runnable
TextFieldGadget


Variable Index

 o HORIZ_ALIGN_CENTER
 o HORIZ_ALIGN_LEFT
 o HORIZ_ALIGN_RIGHT
 o VERT_ALIGN_BOTTOM
 o VERT_ALIGN_MIDDLE
 o VERT_ALIGN_TOP

Constructor Index

 o TextFieldGadget()
Constructs a Text with no text.
 o TextFieldGadget(int)
Constructs a Text with the specified number of columns.
 o TextFieldGadget(String)
Constructs a Text with the specified text.
 o TextFieldGadget(String, int)
Constructs a Text with the specified text and number of columns.
 o TextFieldGadget(String, int, TextLine)
TextFieldGadget

Method Index

 o addActionListener(ActionListener)
Adds the specified listener to be notified when component events occur on this component.
 o appendText(char)
Appends the given character to the end.
 o appendText(String)
Appends the given text to the end.
 o blackAndWhite(GadgetGraphics)
blackAndWhite
 o clear(GadgetGraphics)
clear
 o echoCharIsSet()
Returns true if this TextField has a character set for echoing.
 o getCaretPosition()
Returns the cursor position.
 o getColumns()
getColumns
 o getCursorPos()
Returns the cursor position.
 o getEchoChar()
Returns the character to be used for echoing.
 o getFocusOffset()
Returns the offset used to calculate the next focus gadget, usually the value of getOffset(), but might be an ancestors offset in some cases (like combo box).
 o getHorizAlign()
gets the horizontal alignment
 o getIgnoreDefaultAction()
getIgnoreDefaultAction
 o getLine()
getLine
 o getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.
 o getMinimumSize(int)
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
 o getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.
 o getPreferredSize(int)
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.
 o getSelectedText()
Returns the selected text contained in this TextComponent.
 o getSelectionEnd()
Returns the selected text's end position.
 o getSelectionStart()
Returns the selected text's start position.
 o getText()
Gets the text of the button.
 o getVertAlign()
gets the vertical alignment
 o insertText(char, int)
Inserts the specified character at the specified position.
 o insertText(String, int)
Inserts the specified text at the specified position.
 o invokeAction(AWTEvent)
invokeAction
 o isAllowedToShrink()
Returns the boolean indicating whether this TextComponent is allowedToShrink or not.
 o isEditable()
Returns the boolean indicating whether this TextComponent is editable or not.
 o isFocusTraversable()
isFocusTraversable
 o paint(GadgetGraphics)
paint
 o processActionEvent(ActionEvent)
 o processEvent(AWTEvent)
processEvent
 o processFocusEvent(FocusEvent)
processFocusEvent
 o processKeyEvent(KeyEvent)
processKeyEvent
 o processMouseEvent(MouseEvent)
processMouseEvent
 o processMouseMotionEvent(MouseEvent)
processMouseMotionEvent
 o removeActionListener(ActionListener)
Removes the specified listener so it no longer receives action events on this action.
 o replaceText(char, int, int)
Replaces text from the indicated start to end position with the new character specified.
 o replaceText(String, int, int)
Replaces text from the indicated start to end position with the new text specified.
 o run()
run
 o select(int)
select
 o select(int, int)
Selects the text found between the specified start and end locations.
 o selectAll()
Selects all the text in the TextComponent.
 o setAllowedToShrink(boolean)
Sets the specified boolean to indicate whether or not this TextComponent should be allowedToShrink.
 o setCaretPosition(int)
Returns the cursor position.
 o setColumns(int)
setColumns
 o setEchoChar(char)
Sets the echo character for this TextField.
 o setEditable(boolean)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
 o setHorizAlign(int)
sets the horizontal alignment
 o setIgnoreDefaultAction(boolean)
setIgnoreDefaultAction
 o setSelectionEnd(int)
Sets the selection end to the specified position.
 o setSelectionStart(int)
Sets the selection start to the specified position.
 o setText(String)
Sets the button with the specified text.
 o setVertAlign(int)
sets the vertical alignment
 o toString()
toString
 o update(GadgetGraphics)
update

Variables

 o HORIZ_ALIGN_LEFT
 public static final int HORIZ_ALIGN_LEFT
 o HORIZ_ALIGN_CENTER
 public static final int HORIZ_ALIGN_CENTER
 o HORIZ_ALIGN_RIGHT
 public static final int HORIZ_ALIGN_RIGHT
 o VERT_ALIGN_TOP
 public static final int VERT_ALIGN_TOP
 o VERT_ALIGN_MIDDLE
 public static final int VERT_ALIGN_MIDDLE
 o VERT_ALIGN_BOTTOM
 public static final int VERT_ALIGN_BOTTOM

Constructors

 o TextFieldGadget
 public TextFieldGadget()
Constructs a Text with no text.

 o TextFieldGadget
 public TextFieldGadget(String text)
Constructs a Text with the specified text.

Parameters:
text - - the text of the button
 o TextFieldGadget
 public TextFieldGadget(int columns)
Constructs a Text with the specified number of columns.

Parameters:
columns - - the text of the button
 o TextFieldGadget
 public TextFieldGadget(String text,
                        int columns)
Constructs a Text with the specified text and number of columns.

Parameters:
text - - the text of the button
columns - - the number of columns
 o TextFieldGadget
 protected TextFieldGadget(String text,
                           int columns,
                           TextLine line)
TextFieldGadget

Parameters:
text - - TBD
columns - - TBD
line - - TBD

Methods

 o getLine
 protected TextLine getLine()
getLine

Returns:
TextLine
 o blackAndWhite
 protected boolean blackAndWhite(GadgetGraphics g)
blackAndWhite

Parameters:
g - - TBD
Returns:
boolean
 o clear
 public void clear(GadgetGraphics g)
clear

Parameters:
g - - TBD
Overrides:
clear in class Gadget
 o update
 public void update(GadgetGraphics g)
update

Parameters:
g - - TBD
Overrides:
update in class BorderGadget
 o paint
 public void paint(GadgetGraphics g)
paint

Parameters:
g - - TBD
Overrides:
paint in class BorderGadget
 o setHorizAlign
 public void setHorizAlign(int horizAlign)
sets the horizontal alignment

Parameters:
horizAlign - - TBD
 o getHorizAlign
 public int getHorizAlign()
gets the horizontal alignment

Returns:
int - TBD
 o setVertAlign
 public void setVertAlign(int vertAlign)
sets the vertical alignment

Parameters:
vertAlign - - TBD
 o getVertAlign
 public int getVertAlign()
gets the vertical alignment

Returns:
int
 o getText
 public String getText()
Gets the text of the button.

Returns:
String
See Also:
setText
 o toString
 public String toString()
toString

Returns:
String
Overrides:
toString in class Object
 o setText
 public void setText(String text)
Sets the button with the specified text.

Parameters:
text - - the text to set the button with
See Also:
getText
 o insertText
 public void insertText(String str,
                        int pos)
Inserts the specified text at the specified position.

Parameters:
str - the text to insert.
pos - the position at which to insert.
See Also:
setText, replaceText
 o insertText
 public void insertText(char c,
                        int pos)
Inserts the specified character at the specified position.

Parameters:
c - the character to insert.
pos - the position at which to insert.
See Also:
setText, replaceText
 o appendText
 public void appendText(String str)
Appends the given text to the end.

Parameters:
str - the text to insert
See Also:
insertText
 o appendText
 public void appendText(char c)
Appends the given character to the end.

Parameters:
c - the character to insert
See Also:
insertText
 o replaceText
 public void replaceText(String str,
                         int start,
                         int end)
Replaces text from the indicated start to end position with the new text specified.

Parameters:
str - the text to use as the replacement.
start - the start position.
end - the end position.
See Also:
insertText, replaceText
 o replaceText
 public void replaceText(char c,
                         int start,
                         int end)
Replaces text from the indicated start to end position with the new character specified.

Parameters:
c - the character to use as the replacement.
start - the start position.
end - the end position.
See Also:
insertText, replaceText
 o getIgnoreDefaultAction
 public boolean getIgnoreDefaultAction()
getIgnoreDefaultAction

Returns:
boolean
 o setIgnoreDefaultAction
 public void setIgnoreDefaultAction(boolean ignoreDefaultAction)
setIgnoreDefaultAction

Parameters:
ignoreDefaultAction - - TBD
 o getColumns
 public int getColumns()
getColumns

Returns:
int
 o setColumns
 public void setColumns(int columns)
setColumns

Parameters:
columns - - TBD
 o run
 public void run()
run

 o addActionListener
 public synchronized void addActionListener(ActionListener l)
Adds the specified listener to be notified when component events occur on this component.

Parameters:
l - the listener to receive the events
 o removeActionListener
 public synchronized void removeActionListener(ActionListener l)
Removes the specified listener so it no longer receives action events on this action.

Parameters:
l - the listener to remove
 o processEvent
 protected void processEvent(AWTEvent e)
processEvent

Parameters:
e - a ActionEvent
Returns:
boolean result
Overrides:
processEvent in class ContainerGadget
 o processActionEvent
 protected void processActionEvent(ActionEvent e)
 o isFocusTraversable
 public boolean isFocusTraversable()
isFocusTraversable

Returns:
boolean
Overrides:
isFocusTraversable in class Gadget
 o getFocusOffset
 public Point getFocusOffset()
Returns the offset used to calculate the next focus gadget, usually the value of getOffset(), but might be an ancestors offset in some cases (like combo box).

Returns:
Point
Overrides:
getFocusOffset in class Gadget
See Also:
getOffset
 o invokeAction
 public void invokeAction(AWTEvent e)
invokeAction

Parameters:
e - - TBD
 o processKeyEvent
 protected void processKeyEvent(KeyEvent e)
processKeyEvent

Parameters:
e - the KeyEvent
Overrides:
processKeyEvent in class Gadget
 o processFocusEvent
 protected void processFocusEvent(FocusEvent e)
processFocusEvent

Parameters:
e - the firing FocusEvent
Overrides:
processFocusEvent in class Gadget
 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
processMouseEvent

Parameters:
mouse - the MouseEvent
Overrides:
processMouseEvent in class Gadget
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent

Parameters:
mouse - the MouseEvent
Overrides:
processMouseMotionEvent in class Gadget
 o getSelectedText
 public String getSelectedText()
Returns the selected text contained in this TextComponent.

Returns:
String
See Also:
setText
 o isAllowedToShrink
 public boolean isAllowedToShrink()
Returns the boolean indicating whether this TextComponent is allowedToShrink or not.

Returns:
boolean
See Also:
setEditable
 o setAllowedToShrink
 public void setAllowedToShrink(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be allowedToShrink.

Parameters:
b - - the boolean to be set
See Also:
isEditable
 o isEditable
 public final boolean isEditable()
Returns the boolean indicating whether this TextComponent is editable or not.

Returns:
boolean
See Also:
setEditable
 o setEditable
 public final void setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.

Parameters:
editable - - the boolean to be set
See Also:
isEditable
 o getCursorPos
 public int getCursorPos()
Returns the cursor position.

Returns:
int
 o getCaretPosition
 public int getCaretPosition()
Returns the cursor position.

Returns:
int
 o setCaretPosition
 public void setCaretPosition(int caretPosition)
Returns the cursor position.

Parameters:
caretPosition - - TBD
 o getSelectionStart
 public int getSelectionStart()
Returns the selected text's start position.

Parameters:
int - - TBD
Returns:
int
 o setSelectionStart
 public void setSelectionStart(int selectionStart)
Sets the selection start to the specified position. The new starting point is constrained to be before or at the current selection end.

Parameters:
selectionStart - - the start position of the text
 o getSelectionEnd
 public int getSelectionEnd()
Returns the selected text's end position.

Returns:
int
 o setSelectionEnd
 public void setSelectionEnd(int selectionEnd)
Sets the selection end to the specified position. The new end point is constrained to be at or after the current selection start.

Parameters:
selectionEnd - - the start position of the text
 o select
 public void select(int selectionStart,
                    int selectionEnd)
Selects the text found between the specified start and end locations.

Parameters:
selectionStart - - the start position of the text
selectionEnd - - the end position of the text
 o select
 public void select(int pos)
select

Parameters:
pos - - TBD
 o selectAll
 public void selectAll()
Selects all the text in the TextComponent.

 o getEchoChar
 public char getEchoChar()
Returns the character to be used for echoing.

Returns:
char
See Also:
setEchoChar, echoCharIsSet
 o setEchoChar
 public void setEchoChar(char c)
Sets the echo character for this TextField. This is useful for fields where the user input shouldn't be echoed to the screen, as in the case of a TextField that represents a password.

Parameters:
c - - the echo character for this TextField
See Also:
echoCharIsSet, getEchoChar
 o echoCharIsSet
 public boolean echoCharIsSet()
Returns true if this TextField has a character set for echoing.

Returns:
boolean
See Also:
setEchoChar, getEchoChar
 o getPreferredSize
 public Dimension getPreferredSize(int columns)
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.

Parameters:
columns - - the number of columns in this TextField
Returns:
Dimension
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size Dimensions needed for this TextField. Overrides: getPreferredSize in class Component

Returns:
Dimension
Overrides:
getPreferredSize in class ContainerGadget
 o getMinimumSize
 public Dimension getMinimumSize(int columns)
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.

Parameters:
columns - - the number of columns in this TextField
Returns:
Dimension
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.

Returns:
Dimensions
Overrides:
getMinimumSize in class ContainerGadget

All Packages  Class Hierarchy  This Package  Previous  Next  Index