|
||||||||||
| 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.XButton
public class XButton
A wrapper for the AWT Button class. In addition to wrapping the button this object can hold a value.
Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| Field Summary | |
|---|---|
protected netscape.javascript.JSObject |
obj
|
| Fields inherited from class net.xoetrope.html.XHtmlWidget |
|---|
currentProject, divElement, htmlDoc, imageElement, inputElement, labelElement, metaElement, olElement, selectElement, tableElement, textareaElement, ulElement |
| Constructor Summary | |
|---|---|
XButton(boolean isImage)
Create a new button |
|
XButton(org.w3c.dom.html.HTMLInputElement inputElement)
Create a new XButton based on an existing HTML button element. |
|
XButton(java.lang.String value,
java.lang.String id)
Create a new text button with a value and an id |
|
XButton(java.lang.String src,
java.lang.String id,
java.lang.String alt)
Create a new image button with a src, an id and an alt attribute |
|
| Method Summary | |
|---|---|
void |
click()
Simulate a click on the XButton. |
void |
deleteElement()
Delete the current XButton. |
java.lang.String |
getAccessKey()
Get the shortcut key to click on this XButton |
java.lang.String |
getAlign()
Get the align attribute of the XButton. |
java.lang.String |
getAlternativeName()
Get the alt attribute of the XButton. |
java.lang.String |
getAttribute(java.lang.String attribName)
Get an attribute value |
java.lang.String |
getBackgroundColor()
Get the background color of the XButton. |
java.lang.String |
getFontColor()
Get the font color of the XButton. |
int |
getFontSize()
Get the size of the XButton's text. |
org.w3c.dom.html.HTMLFormElement |
getForm()
Get the form this XButton belongs to. |
org.w3c.dom.html.HTMLInputElement |
getHTMLElement()
Get the HTML element at which refers the XButton |
java.lang.String |
getSize()
Get the size of the XButton |
java.lang.String |
getText()
Get teh button text/caption |
java.lang.String |
getType()
Get the button type |
java.lang.Object |
getValue()
Get teh button text/caption |
void |
insertAfter(java.lang.String element,
java.lang.String id)
Insert a new button after the current one |
void |
insertBefore(java.lang.String element,
java.lang.String id)
Insert a new button before the current one |
void |
setAccessKey(java.lang.String accessKey)
Set a shortcut to click on this XButton |
void |
setAlign(java.lang.String align)
Set the align attribute of the XButton |
void |
setAlternativeName(java.lang.String name)
Set the alt attribute of the XButton. |
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 XButton. |
void |
setEnabled(boolean enabled)
Set the XButton enabled or disabled. |
void |
setFontColor(java.lang.String hexColor)
Set the font color of the XButton. |
void |
setFontSize(int fontsize)
Set the size of the XButton's text. |
void |
setSize(int width)
Set the size of the XButton. |
void |
setText(java.lang.String s)
Set the button text/caption |
void |
setValue(java.lang.Object obj)
Set teh button text/caption |
void |
setVisible(boolean visible)
Set the XButton 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
| Constructor Detail |
|---|
public XButton(boolean isImage)
isImage - true if the button is an image button, false otherwise
public XButton(java.lang.String value,
java.lang.String id)
value - the button valueid - the button id
public XButton(java.lang.String src,
java.lang.String id,
java.lang.String alt)
src - the image sourceid - the button idalt - the alternative text to display if the button can't loadpublic XButton(org.w3c.dom.html.HTMLInputElement inputElement)
inputElement - the HTML input tag the XButton refers to| Method Detail |
|---|
public void click()
public void setText(java.lang.String s)
setText in interface XTextHoldersetText in interface XValueHolders - the new textpublic java.lang.String getText()
getText in interface XTextHoldergetText in interface XValueHolderpublic void setValue(java.lang.Object obj)
setValue in interface XValueHolders - the new textpublic java.lang.Object getValue()
getValue in interface XValueHolderpublic java.lang.String getType()
public void setVisible(boolean visible)
visible - true if visible, false otherwisepublic void setEnabled(boolean enabled)
enabled - true if enabled, false otherwise
public void insertAfter(java.lang.String element,
java.lang.String id)
element - the displayed name of the buttonid - the unique identifier of the button
public void insertBefore(java.lang.String element,
java.lang.String id)
element - the displayed name of the buttonid - the unique identifier of the buttonpublic void deleteElement()
public int setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
setAttribute in interface XAttributedComponentattribName - the name of the attributeattribValue - the value of the attribute
public java.lang.String getAttribute(java.lang.String attribName)
attribName - the attribute which value is requested
public void setAccessKey(java.lang.String accessKey)
accessKey - the key used as a shortcutpublic java.lang.String getAccessKey()
public void setAlign(java.lang.String align)
align - the alignment of the XButton (left, right, center, justified)public java.lang.String getAlign()
public void setAlternativeName(java.lang.String name)
name - the alternative name to be displayedpublic java.lang.String getAlternativeName()
public org.w3c.dom.html.HTMLFormElement getForm()
public void setSize(int width)
width - the width of the buttonpublic java.lang.String getSize()
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 org.w3c.dom.html.HTMLInputElement getHTMLElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||