net.sf.jzeno.echo.viewer
Class AbstractNumberViewer

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.viewer.AbstractNumberViewer
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, Component, FastComponent, FastComponentContainer
Direct Known Subclasses:
BigDecimalViewer, ByteViewer, DoubleViewer, FloatViewer, IntegerViewer, LongViewer, ShortViewer

public class AbstractNumberViewer
extends CustomComponent
implements Precreation

Base class for number-based viewers.

See Also:
Serialized Form

Field Summary
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
AbstractNumberViewer()
           
AbstractNumberViewer(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
           
 
Method Summary
 void applyContext()
           
 Color getBackground()
           Gets the background color.
 Font getFont()
          Returns the font.
 Color getForeground()
           Gets the text color.
 int getHorizontalAlignment()
           Gets the horizontal alignment of the label.
 java.lang.String getNullLabel()
           Gets the label that is shown if the bound property is null.
 java.lang.String getText()
           
 java.lang.String getToolTipText()
           Sets the tooltip that is shown when the user hoovers over this label.
 int getVerticalAlignment()
           Gets the vertical alignment of the label.
 int getWidth()
           
 int getWidthUnits()
           
 void setBackground(Color color)
           Sets the background color.
 void setFont(Font font)
          Sets the font of the component.
 void setForeground(Color color)
           Sets the text color.
 void setHorizontalAlignment(int alignment)
           Sets the horizonal alignment of the label.
 void setNullLabel(java.lang.String nullLabel)
           Sets the label that is shown if the bound property is null
 void setToolTipText(java.lang.String toolTipText)
           Gets the tooltip that is shown when the user hoovers over this label.
 void setVerticalAlignment(int alignment)
           Sets the vertical alignment of the label.
 void setWidth(int i)
           
 void setWidthUnits(int i)
           
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isRequired, isValid, markInvalid, markValid, preRender, rebind, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setReadOnly, setRequired, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setClientId, setEnabled, setFocused, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PIXEL_UNITS

public static int PIXEL_UNITS

PERCENT_UNITS

public static int PERCENT_UNITS
Constructor Detail

AbstractNumberViewer

public AbstractNumberViewer()

AbstractNumberViewer

public AbstractNumberViewer(java.lang.Class beanClass,
                            java.lang.String property,
                            java.lang.String constructionHints)
Method Detail

getText

public java.lang.String getText()

getNullLabel

public java.lang.String getNullLabel()

Gets the label that is shown if the bound property is null. This allows you to show a sensible message for null values.


setNullLabel

public void setNullLabel(java.lang.String nullLabel)

Sets the label that is shown if the bound property is null


getToolTipText

public java.lang.String getToolTipText()

Sets the tooltip that is shown when the user hoovers over this label.


setToolTipText

public void setToolTipText(java.lang.String toolTipText)

Gets the tooltip that is shown when the user hoovers over this label.


setHorizontalAlignment

public void setHorizontalAlignment(int alignment)

Sets the horizonal alignment of the label. Use the constants in nextapp.echo.EchoConstants .


getHorizontalAlignment

public int getHorizontalAlignment()

Gets the horizontal alignment of the label.


setVerticalAlignment

public void setVerticalAlignment(int alignment)

Sets the vertical alignment of the label. Use the constants in nextapp.echo.EchoConstants .


getVerticalAlignment

public int getVerticalAlignment()

Gets the vertical alignment of the label.


setBackground

public void setBackground(Color color)

Sets the background color.

Specified by:
setBackground in interface Component
Overrides:
setBackground in class AbstractComponent
Parameters:
color - The new background color of the component.

getBackground

public Color getBackground()

Gets the background color.

Specified by:
getBackground in interface Component
Overrides:
getBackground in class AbstractComponent
Returns:
The background color of the component.

setForeground

public void setForeground(Color color)

Sets the text color.

Specified by:
setForeground in interface Component
Overrides:
setForeground in class AbstractComponent
Parameters:
color - The new foreground color of the component.

getForeground

public Color getForeground()

Gets the text color.

Specified by:
getForeground in interface Component
Overrides:
getForeground in class AbstractComponent
Returns:
The foreground of the component.

setWidth

public void setWidth(int i)

getWidth

public int getWidth()

setWidthUnits

public void setWidthUnits(int i)

getWidthUnits

public int getWidthUnits()

setFont

public void setFont(Font font)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
font - The new font of the component.

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation