javax.rad.genui.component
Class AbstractUITextField<C extends ITextField>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.component.AbstractUITextField<C>
Type Parameters:
C - instance of ITextField
All Implemented Interfaces:
ITranslatable, ILabel, ITextField, IAlignmentConstants, IComponent, IResource, INamedObject
Direct Known Subclasses:
UIPasswordField, UITextArea, UITextField

public abstract class AbstractUITextField<C extends ITextField>
extends UIComponent<C>
implements ITextField

Platform and technology independent text field. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .

See Also:
TextField, JTextField

Field Summary
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected AbstractUITextField(C pTextField)
          Creates a new instance of UITextField.
 
Method Summary
 int getColumns()
          Returns the number of columns in this ITextField.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 String getText()
          Returns the text string that the label displays.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 boolean isBorderVisible()
          Returns whether the the border of the text field is visible.
 boolean isEditable()
          Returns the boolean indicating whether this ITextField is editable or not.
 void selectAll()
          Selects the whole text, and sets the caret position to the end.
 void setBorderVisible(boolean pVisible)
          Sets the border of the text field visible or invisible.
 void setColumns(int pColumns)
          Sets the number of columns in this ITextField, and then invalidate the layout.
 void setEditable(boolean pEditable)
          Sets the specified boolean to indicate whether or not this ITextField should be editable.
 void setEnabled(boolean pEnabled)
          Enables or disables this component, depending on the value of the parameter pEnable.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setText(String pText)
          Defines the single line of text this component will display.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.UIComponent
addNotify, beforeAddNotify, capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, removeNotify, requestFocus, setBackground, setBounds, setBounds, setCursor, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

AbstractUITextField

protected AbstractUITextField(C pTextField)
Creates a new instance of UITextField.

Parameters:
pTextField - the ITextField.
See Also:
ITextField
Method Detail

getText

public String getText()
Returns the text string that the label displays.

Specified by:
getText in interface ILabel
Returns:
a String
See Also:
ILabel.setText(java.lang.String)

setText

public void setText(String pText)
Defines the single line of text this component will display. If the value of text is null or empty string, nothing is displayed.

Specified by:
setText in interface ILabel
Parameters:
pText - the text

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getHorizontalAlignment in interface IAlignmentConstants
Returns:
the horizontal alignment

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. Possible values are defined in AlignmentConstants.

Specified by:
setHorizontalAlignment in interface IAlignmentConstants
Parameters:
pHorizontalAlignment - the new vertical alignment

getVerticalAlignment

public int getVerticalAlignment()
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getVerticalAlignment in interface IAlignmentConstants
Returns:
the vertical alignment

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. Possible values are defined in AlignmentConstants.

Specified by:
setVerticalAlignment in interface IAlignmentConstants
Parameters:
pVerticalAlignment - the new vertical alignment

getColumns

public int getColumns()
Returns the number of columns in this ITextField.

Specified by:
getColumns in interface ITextField
Returns:
the number of columns >= 0

setColumns

public void setColumns(int pColumns)
Sets the number of columns in this ITextField, and then invalidate the layout.

Specified by:
setColumns in interface ITextField
Parameters:
pColumns - the number of columns >= 0

setEditable

public void setEditable(boolean pEditable)
Sets the specified boolean to indicate whether or not this ITextField should be editable.

Specified by:
setEditable in interface ITextField
Parameters:
pEditable - the boolean to be set

isEditable

public boolean isEditable()
Returns the boolean indicating whether this ITextField is editable or not.

Specified by:
isEditable in interface ITextField
Returns:
the boolean value
See Also:
ITextField.setEditable(boolean)

setBorderVisible

public void setBorderVisible(boolean pVisible)
Sets the border of the text field visible or invisible.

Specified by:
setBorderVisible in interface ITextField
Parameters:
pVisible - true to set the border visible or false to hide the border

isBorderVisible

public boolean isBorderVisible()
Returns whether the the border of the text field is visible.

Specified by:
isBorderVisible in interface ITextField
Returns:
true if the border is visible, false if the border is invisible

selectAll

public void selectAll()
Selects the whole text, and sets the caret position to the end.

Specified by:
selectAll in interface ITextField

setEnabled

public void setEnabled(boolean pEnabled)
Enables or disables this component, depending on the value of the parameter pEnable. An enabled component can respond to user input and generate events. Components are enabled initially by default.

Specified by:
setEnabled in interface IComponent
Overrides:
setEnabled in class UIComponent<C extends ITextField>
Parameters:
pEnabled - if true, this component is enabled; otherwise this component is disabled
See Also:
IComponent.isEnabled()

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIComponent<C extends ITextField>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.