|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.html.XHtmlWidget
net.xoetrope.html.XLabel
public class XLabel
Draws text. The text may be wrapped over multiple lines. Double buffering is switched off by default.
Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| Field Summary | |
|---|---|
protected netscape.javascript.JSObject |
obj
|
protected XTextRenderer |
renderer
The renderer that will draw the content |
protected java.lang.String |
text
The content of the label |
| Fields inherited from class net.xoetrope.html.XHtmlWidget |
|---|
currentProject, divElement, htmlDoc, imageElement, inputElement, labelElement, metaElement, olElement, selectElement, tableElement, textareaElement, ulElement |
| Constructor Summary | |
|---|---|
XLabel()
Create a new XLabel component. |
|
XLabel(org.w3c.dom.html.HTMLLabelElement labelElement)
Create a new XLabel based on an existing HTML label element. |
|
XLabel(java.lang.String txt,
java.lang.String id)
Create a new XLabel component with a specific value and id. |
|
| Method Summary | |
|---|---|
int |
getAlignment()
Get the text alignment |
java.lang.String |
getBackgroundColor()
Get the background color of the XLabel. |
java.lang.String |
getFontColor()
Get the font color of the XLabel. |
int |
getFontSize()
Get the size of the XLabel's text. |
org.w3c.dom.html.HTMLFormElement |
getForm()
Get the form this XLabel belongs to. |
org.w3c.dom.html.HTMLLabelElement |
getHTMLElement()
Get the HTML element at which refers the XLabel |
java.lang.String |
getHtmlFor()
Get the element this XLabel depends on. |
java.lang.String |
getText()
Get the text. |
boolean |
isVisible()
Method used to know if the XLabel is visible or hidden on the HTML page. |
void |
setAlignment(int align)
Set the alignment of the text. |
int |
setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
Set one or more attributes of the component. |
void |
setBackgroundColor(java.lang.String hexColor)
Set the background color of the XLabel. |
void |
setBold(boolean bold)
Put the XLabels's text in bold. |
void |
setFontColor(java.lang.String hexColor)
Set the font color of the XLabel. |
void |
setFontSize(int fontsize)
Set the size of the XLabel's text. |
void |
setHtmlFor(java.lang.String htmlFor)
Set the element this XLabel depends on. |
void |
setText(java.lang.String str)
Set the text content of the XLabel. |
void |
setVisible(boolean visible)
Set the XLabel visible or invisible. |
| Methods inherited from class net.xoetrope.html.XHtmlWidget |
|---|
addEvent, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected netscape.javascript.JSObject obj
protected java.lang.String text
protected XTextRenderer renderer
| Constructor Detail |
|---|
public XLabel()
public XLabel(java.lang.String txt,
java.lang.String id)
txt - the text of this XLabelid - the id at which the user has to refer to act on this componentpublic XLabel(org.w3c.dom.html.HTMLLabelElement labelElement)
labelElement - the HTML label tag the XLabel refers to| Method Detail |
|---|
public void setText(java.lang.String str)
setText in interface XTextHolderstr - the new text valuepublic java.lang.String getText()
getText in interface XTextHolderpublic int getAlignment()
public void setAlignment(int align)
align - 1 to right align the text, 0 for left alignment and 2 for centered
text
public int setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
setAttribute in interface XAttributedComponentattribName - the attribute nameattribValue - the attribute value
public void setHtmlFor(java.lang.String htmlFor)
htmlFor - the id of this HTML elementpublic java.lang.String getHtmlFor()
public org.w3c.dom.html.HTMLFormElement getForm()
public int getFontSize()
public void setFontSize(int fontsize)
fontsize - the int value of the font sizepublic java.lang.String getBackgroundColor()
public void setBackgroundColor(java.lang.String hexColor)
hexColor - the hexadecimal value of the background colorpublic java.lang.String getFontColor()
public void setFontColor(java.lang.String hexColor)
hexColor - the hexadecimal value of the font colorpublic void setVisible(boolean visible)
visible - true if visible, false otherwisepublic boolean isVisible()
public void setBold(boolean bold)
bold - true to put the text in bold, false otherwisepublic org.w3c.dom.html.HTMLLabelElement getHTMLElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||