javax.rad.genui.component
Class UILabel

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<ILabel>
          extended by javax.rad.genui.component.UILabel
All Implemented Interfaces:
ITranslatable, ILabel, IAlignmentConstants, IComponent, IResource, INamedObject, ITranslator

public class UILabel
extends UIComponent<ILabel>
implements ILabel

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

See Also:
Label, JLabel

Field Summary
 
Fields inherited from class javax.rad.genui.UIComponent
bTranslate, lLastTranslationModified, parent, popupMenu
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
  UILabel()
          Creates a new instance of UILabel.
protected UILabel(ILabel pLabel)
          Creates a new instance of UILabel with the given labe.
  UILabel(java.lang.String pText)
          Creates a new instance of UILabel.
  UILabel(java.lang.String pText, IFont pFont)
          Creates a new instance of UILabel.
  UILabel(java.lang.String pText, IFont pFont, int pHorizontalAlignment, int pVerticalAlignment)
          Creates a new instance of UILabel.
 
Method Summary
protected  java.lang.String createComponentName()
          Creates a name for this UIComponent.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 java.lang.String getText()
          Returns the text string that the label displays.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setText(java.lang.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, createComponentNamePrefix, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, incrementNameIfExists, 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, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setUIComponent, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, putObject, 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, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

UILabel

public UILabel()
Creates a new instance of UILabel.

See Also:
ILabel

UILabel

protected UILabel(ILabel pLabel)
Creates a new instance of UILabel with the given labe.

Parameters:
pLabel - the label
See Also:
ILabel

UILabel

public UILabel(java.lang.String pText)
Creates a new instance of UILabel.

Parameters:
pText - the text.
See Also:
ILabel

UILabel

public UILabel(java.lang.String pText,
               IFont pFont)
Creates a new instance of UILabel.

Parameters:
pText - the text.
pFont - the font.
See Also:
ILabel

UILabel

public UILabel(java.lang.String pText,
               IFont pFont,
               int pHorizontalAlignment,
               int pVerticalAlignment)
Creates a new instance of UILabel.

Parameters:
pText - the text.
pFont - the font.
pHorizontalAlignment - the horizontal alignment.
pVerticalAlignment - the vertical alignment.
See Also:
UIComponent.setFont(IFont), setHorizontalAlignment(int), setText(String), setVerticalAlignment(int)
Method Detail

getText

public java.lang.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(java.lang.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

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<ILabel>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()

createComponentName

protected java.lang.String createComponentName()
Creates a name for this UIComponent. The returned name needs to be unique in the current root/workscreen and is ideally, but not necessarily, prefixed with the UIComponent.sRootName, if there is any. Overriding classes should be aware that this method will be called in UIComponent.addNotify() and the returned name will only be assigned to the UIComponent if there isn't already a name set. Also UIComponent.stExistingNames can be used to find out if a name has already been assigned, and UIComponent.sRootName to get the root name. In rare cases UIComponent.stExistingNames and/or UIComponent.sRootName might be null when this method is called.

Overrides:
createComponentName in class UIComponent<ILabel>
Returns:
a unique name for this UIComponent.
See Also:
UIComponent.getExistingNames(), UIComponent.getRootName(), UIComponent.incrementNameIfExists(String, Set, boolean)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.