| java.lang.Object org.wings.SComponent org.wings.SLabel
All known Subclasses: org.wings.table.SDefaultTableCellRenderer, org.wings.SDefaultListCellRenderer, org.wingx.XInplaceEditor, desktop.DropLabel, org.wings.table.SDefaultTableRowSelectionRenderer, org.wings.tree.SDefaultTreeCellRenderer,
SLabel | public class SLabel extends SComponent (Code) | | Display area for a short text string or an image, or both.
You can specify where in the label's display area the label's contents
are aligned by setting the vertical and horizontal alignment.
You can also specify the position of the text relative to the image.
author: Armin Haaf |
Constructor Summary | |
public | SLabel(String text) Creates a new SLabel instance with the specified text
(left alligned) and no icon. | public | SLabel() Creates a new SLabel instance with no text and no icon. | public | SLabel(SIcon icon) Creates a new SLabel instance with the specified icon
(left alligned) and no text. | public | SLabel(SIcon icon, int horizontalAlignment) Creates a new SLabel instance with the specified icon
(alligned as specified) and no text. | public | SLabel(String text, SIcon icon) Creates a new SLabel instance with the specified icon
and the specified text (left alligned). | public | SLabel(String text, SIcon icon, int horizontalAlignment) Creates a new SLabel instance with the specified icon
and the specified text (alligned as specified). | public | SLabel(String text, int horizontalAlignment) Creates a new SLabel instance with the specified text
(alligned as specified) and no icon. |
horizontalTextPosition | protected int horizontalTextPosition(Code) | | |
iconTextGap | protected int iconTextGap(Code) | | |
verticalTextPosition | protected int verticalTextPosition(Code) | | |
wordWrap | protected boolean wordWrap(Code) | | |
SLabel | public SLabel(String text)(Code) | | Creates a new SLabel instance with the specified text
(left alligned) and no icon.
Parameters: text - The text to be displayed by the label. |
SLabel | public SLabel()(Code) | | Creates a new SLabel instance with no text and no icon.
|
SLabel | public SLabel(SIcon icon)(Code) | | Creates a new SLabel instance with the specified icon
(left alligned) and no text.
Parameters: icon - The image to be displayed by the label. |
SLabel | public SLabel(SIcon icon, int horizontalAlignment)(Code) | | Creates a new SLabel instance with the specified icon
(alligned as specified) and no text.
Parameters: icon - The image to be displayed by the label. Parameters: horizontalAlignment - One of the following constants defined inSConstants :LEFT , CENTER , RIGHT . See Also: SConstants |
SLabel | public SLabel(String text, SIcon icon)(Code) | | Creates a new SLabel instance with the specified icon
and the specified text (left alligned).
Parameters: text - The text to be displayed by the label. Parameters: icon - The image to be displayed by the label. |
SLabel | public SLabel(String text, SIcon icon, int horizontalAlignment)(Code) | | Creates a new SLabel instance with the specified icon
and the specified text (alligned as specified).
Parameters: text - The text to be displayed by the label. Parameters: icon - The image to be displayed by the label. Parameters: horizontalAlignment - One of the following constants defined inSConstants :LEFT , CENTER , RIGHT . See Also: SConstants |
SLabel | public SLabel(String text, int horizontalAlignment)(Code) | | Creates a new SLabel instance with the specified text
(alligned as specified) and no icon.
Parameters: text - The text to be displayed by the label. Parameters: horizontalAlignment - One of the following constants defined inSConstants :LEFT , CENTER , RIGHT . See Also: SConstants |
getDisabledIcon | public SIcon getDisabledIcon()(Code) | | Returns the icon that is displayed when the label is disabled.
the diabledIcon |
getIcon | public SIcon getIcon()(Code) | | Returns the icon the label displays.
the icon |
getIconTextGap | public int getIconTextGap()(Code) | | Returns the amount of space between the text and the icon
displayed in this label.
an int equal to the number of pixels between the textand the icon. See Also: SLabel.setIconTextGap |
getText | public String getText()(Code) | | Returns the text of the label
the text |
isWordWrap | public boolean isWordWrap()(Code) | | Determiens if the label text word wrap inside the browser. Defaults to false (Swing).
false if the label should not word wrap an be in line as in Swing. |
setDisabledIcon | public void setDisabledIcon(SIcon i)(Code) | | Set the icon that will be displayed if the label is disabled.
Parameters: i - |
setHorizontalTextPosition | public void setHorizontalTextPosition(int textPosition)(Code) | | Sets the horizontal position of the lable's text, relative to its icon.
The default value of this property is CENTER.
Parameters: textPosition - One of the following constants defined inSConstants :LEFT , CENTER , RIGHT . |
setIcon | public void setIcon(SIcon i)(Code) | | Defines the icon the component will display.
Parameters: i - |
setIconTextGap | public void setIconTextGap(int iconTextGap)(Code) | | If both the icon and text properties are set, this property
defines the space between them.
The default value of this property is 4 pixels.
See Also: SLabel.getIconTextGap |
setText | public void setText(String t)(Code) | | Sets the text of the label. Nothing will be displayed if the text is an empty string or null.
Parameters: t - The new text |
setVerticalTextPosition | public void setVerticalTextPosition(int textPosition)(Code) | | Sets the vertical position of the lable's text, relative to its icon.
The default value of this property is CENTER.
Parameters: textPosition - One of the following constants defined inSConstants :TOP , CENTER , BOTTOM . |
setWordWrap | public void setWordWrap(boolean wordWrap)(Code) | | Defines if the label is allowed to wrap.
Parameters: wordWrap - Set to true if you want labels to allow to break into more lines than passed. |
Methods inherited from org.wings.SComponent | final public void addComponentListener(SComponentListener l)(Code)(Java Doc) public void addDynamicStyle(Style style)(Code)(Java Doc) final protected void addEventListener(Class<T> type, T listener)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) final public void addParentFrameListener(SParentFrameListener l)(Code)(Java Doc) final public void addRenderListener(SRenderListener renderListener)(Code)(Java Doc) final public void addScriptListener(ScriptListener listener)(Code)(Java Doc) public void addStyle(String additionalCssClassName)(Code)(Java Doc) public Object clone()(Code)(Java Doc) protected void fireComponentChangeEvent(SComponentEvent aEvent)(Code)(Java Doc) public void fireFinalEvents()(Code)(Java Doc) protected void fireKeyEvents()(Code)(Java Doc) final public void fireRenderEvent(int type)(Code)(Java Doc) public ActionMap getActionMap()(Code)(Java Doc) public Color getBackground()(Code)(Java Doc) public SBorder getBorder()(Code)(Java Doc) public ComponentCG getCG()(Code)(Java Doc) final public Object getClientProperty(Object key)(Code)(Java Doc) public SPopupMenu getComponentPopupMenu()(Code)(Java Doc) public Style getDynamicStyle(Selector selector)(Code)(Java Doc) public Collection getDynamicStyles()(Code)(Java Doc) public int getFocusTraversalIndex()(Code)(Java Doc) public SFont getFont()(Code)(Java Doc) public Color getForeground()(Code)(Java Doc) public int getHorizontalAlignment()(Code)(Java Doc) public InputMap getInputMap()(Code)(Java Doc) public InputMap getInputMap(int condition)(Code)(Java Doc) final protected int getListenerCount(Class type)(Code)(Java Doc) final protected Object[] getListenerList()(Code)(Java Doc) final public EventListener[] getListeners(Class<? extends EventListener> type)(Code)(Java Doc) public String getLowLevelEventId()(Code)(Java Doc) final public String getName()(Code)(Java Doc) final public SContainer getParent()(Code)(Java Doc) public SFrame getParentFrame()(Code)(Java Doc) public SDimension getPreferredSize()(Code)(Java Doc) public RequestURL getRequestURL()(Code)(Java Doc) public boolean getResidesInForm()(Code)(Java Doc) public List<ScriptListener> getScriptListenerList()(Code)(Java Doc) public ScriptListener[] getScriptListeners()(Code)(Java Doc) final public Session getSession()(Code)(Java Doc) public boolean getShowAsFormComponent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) public String getToolTipText()(Code)(Java Doc) public int getVerticalAlignment()(Code)(Java Doc) public void invite(ComponentVisitor visitor) throws Exception(Code)(Java Doc) protected static boolean isDifferent(Object oldObject, Object newObject)(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isFocusOwner()(Code)(Java Doc) public boolean isRecursivelyVisible()(Code)(Java Doc) public boolean isReloadForced()(Code)(Java Doc) protected boolean isUpdatePossible()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) protected String paramString()(Code)(Java Doc) protected void processComponentEvent(SComponentListener listener, SComponentEvent e)(Code)(Java Doc) protected boolean processKeyEvents(String[] values)(Code)(Java Doc) protected void processLowLevelEvent(String name, String[] values)(Code)(Java Doc) final public void putClientProperty(Object key, Object value)(Code)(Java Doc) final void register()(Code)(Java Doc) public void reload()(Code)(Java Doc) final protected void reloadIfChange(Object oldVal, Object newVal)(Code)(Java Doc) final protected void reloadIfChange(int oldVal, int newVal)(Code)(Java Doc) final protected void reloadIfChange(boolean oldVal, boolean newVal)(Code)(Java Doc) final protected void reloadIfChange(byte oldVal, byte newVal)(Code)(Java Doc) final protected void reloadIfChange(short oldVal, short newVal)(Code)(Java Doc) final protected void reloadIfChange(long oldVal, long newVal)(Code)(Java Doc) final protected void reloadIfChange(float oldVal, float newVal)(Code)(Java Doc) final protected void reloadIfChange(double oldVal, double newVal)(Code)(Java Doc) final protected void reloadIfChange(char oldVal, char newVal)(Code)(Java Doc) final public void removeComponentListener(SComponentListener l)(Code)(Java Doc) public void removeDynamicStyle(Selector selector)(Code)(Java Doc) final protected void removeEventListener(Class<T> type, T listener)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) final public void removeParentFrameListener(SParentFrameListener l)(Code)(Java Doc) final public void removeRenderListener(SRenderListener renderListener)(Code)(Java Doc) final public void removeScriptListener(ScriptListener listener)(Code)(Java Doc) public void removeStyle(String cssStyleClassName)(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public void scrollRectToVisible(Rectangle aRect)(Code)(Java Doc) public void setActionMap(ActionMap actionMap)(Code)(Java Doc) public void setAttribute(String cssPropertyName, String value)(Code)(Java Doc) public void setAttribute(CSSProperty property, String propertyValue)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, String propertyValue)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, SIcon icon)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, Color color)(Code)(Java Doc) public void setAttributes(Selector selector, CSSAttributeSet attributes)(Code)(Java Doc) public void setBackground(Color color)(Code)(Java Doc) public void setBorder(SBorder border)(Code)(Java Doc) public void setCG(ComponentCG newCG)(Code)(Java Doc) public void setComponentPopupMenu(SPopupMenu popupMenu)(Code)(Java Doc) public void setDynamicStyles(Collection dynamicStyles)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocusTraversalIndex(int index)(Code)(Java Doc) public void setFont(SFont font)(Code)(Java Doc) public void setForeground(Color color)(Code)(Java Doc) public void setHorizontalAlignment(int alignment)(Code)(Java Doc) public void setInputMap(InputMap inputMap)(Code)(Java Doc) public void setInputMap(int condition, InputMap inputMap)(Code)(Java Doc) public void setName(String uniqueName)(Code)(Java Doc) public void setNameRaw(String uncheckedName)(Code)(Java Doc) public void setParent(SContainer parent)(Code)(Java Doc) protected void setParentFrame(SFrame parentFrame)(Code)(Java Doc) public void setPreferredSize(SDimension preferredSize)(Code)(Java Doc) public void setReloadForced(boolean forced)(Code)(Java Doc) public void setShowAsFormComponent(boolean showAsFormComponent)(Code)(Java Doc) public void setStyle(String cssClassName)(Code)(Java Doc) public void setToolTipText(String t)(Code)(Java Doc) public void setVerticalAlignment(int alignment)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public String toString()(Code)(Java Doc) final void unregister()(Code)(Java Doc) public void update(Update update)(Code)(Java Doc) public void updateCG()(Code)(Java Doc) public void write(Device s) throws IOException(Code)(Java Doc)
|
|
|