|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jolene.dom.HTMLElement
public abstract class HTMLElement
Base class for all html elements.
Method Summary | |
---|---|
void |
clear()
Clears this element's attributes. |
HTMLElement |
clone()
Core clone implementation. |
java.lang.String |
getAfterText()
Gets the afterText string for the object. |
java.lang.String |
getAttribute(java.lang.String key)
Return the html attribute specified by the key or null if it's not found. |
java.lang.String |
getBeforeText()
Gets the beforeText string for the object. |
java.lang.String |
getContent()
Returns the content of the HTMLElement. |
java.lang.String |
getName()
Gets the element name. |
java.lang.String |
getStyle(java.lang.String key)
Get the element style based on a style name. |
Tags |
getTag()
Get the tag for the element. |
java.lang.String |
getValue()
Gets the current value of the element. |
boolean |
hasAttribute(java.lang.String key)
Indicates if the specified attribute exists. |
boolean |
hasStyle(java.lang.String key)
Indicates if a style exists. |
boolean |
isChecked()
Returns true if a Radio or CheckBox is checked. |
boolean |
isDisabled()
Returns true if the element is disabled |
boolean |
isReadonly()
Returns true if the element is readonly |
boolean |
isRenderable()
Returns whether this element is rendered. |
java.util.Set<java.lang.String> |
keySet()
Returns the set of attribute names. |
java.lang.String |
removeAttribute(java.lang.String key)
Remove the specified attribute. |
java.lang.String |
removeStyle(java.lang.String key)
Removes a style from the element. |
void |
resetStyles(java.lang.String style)
Sets the styles on the element based on the formatted style string, clearing all exisiting styles first. |
void |
resetStyles(Styles style)
Sets the styles on the element based on the Style parameter, clearing all exisiting styles first. |
void |
setAfterText(java.lang.String string)
Sets the afterText string for the object. |
java.lang.String |
setAttribute(java.lang.String key,
java.lang.String value)
Sets the specified attribute. |
void |
setBeforeText(java.lang.String string)
Sets the beforeText string for the object. |
void |
setChecked(boolean checked)
Sets the element checked attribute. |
void |
setContent(java.lang.String content)
Sets the content of the HTMLElement. |
void |
setDisabled(boolean disabled)
Set the element to be disabled. |
void |
setName(java.lang.String name)
Set the element name. |
void |
setReadonly(boolean readonly)
Set the element to be readonly. |
void |
setRenderable(boolean renderable)
Sets whether this element is rendered. |
java.lang.String |
setStyle(java.lang.String key,
java.lang.String value)
Set the element style. |
void |
setStyles(java.lang.String style)
Sets the styles on the element based on a formatted style string. |
void |
setStyles(Styles styles)
Sets styles on the Style object based on the Style parameter. |
void |
setValue(java.lang.String value)
Sets the value of the element. |
void |
swapWith(java.lang.String swapWith)
Replace this element's string representation with the specified string. |
java.lang.String |
toString()
Renders the element as an html string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void clear()
clear
in interface ICollection
public HTMLElement clone()
clone
in class java.lang.Object
DocumentFactory
public java.lang.String getAfterText()
public final java.lang.String getAttribute(java.lang.String key)
getAttribute
in interface IAttributes
key
- case insensitive attribute name.
public java.lang.String getBeforeText()
public java.lang.String getContent()
public java.lang.String getName()
public java.lang.String getStyle(java.lang.String key)
getStyle
in interface IStyles
key
- case insensitive style name.
public Tags getTag()
public java.lang.String getValue()
public boolean hasAttribute(java.lang.String key)
hasAttribute
in interface IAttributes
key
- case insensitive attribute name.
public boolean hasStyle(java.lang.String key)
hasStyle
in interface IStyles
key
- case instensitive style key name.
public boolean isChecked()
public boolean isDisabled()
public boolean isReadonly()
public boolean isRenderable()
public java.util.Set<java.lang.String> keySet()
keySet
in interface ICollection
public java.lang.String removeAttribute(java.lang.String key)
removeAttribute
in interface IAttributes
key
- case insensitive attribute name.
public java.lang.String removeStyle(java.lang.String key)
removeStyle
in interface IStyles
key
- Style key name to remove.
public final void resetStyles(java.lang.String style)
resetStyles
in interface IStyles
style
- string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;public final void resetStyles(Styles style)
style
- a Style object.public void setAfterText(java.lang.String string)
document.forms(0).elements("Submit").setAfterText(" Click this button to submit this form.");This would render the following back to the browser:
<input type="SUBMIT" name="Submit" value="Submit"> Click this button to submit this form.
string
- text after objectpublic final java.lang.String setAttribute(java.lang.String key, java.lang.String value)
setAttribute
in interface IAttributes
key
- case insensitive attribute name.value
- value of the attribute.
public void setBeforeText(java.lang.String string)
document.forms(0).elements("Name").setBeforeText("Name: ");This would render the following back to the browser:
Name: <input type="text" name="Name">
string
- of textpublic void setChecked(boolean checked)
checked
- to indicate if the checkbox is checked or not.public void setContent(java.lang.String content)
content
- text or value to set.getContent()
public void setDisabled(boolean disabled)
disabled
- indicator for a disabled element.public void setName(java.lang.String name)
name
- name of the html element.public void setReadonly(boolean readonly)
readonly
- indicator for a readonly element.public void setRenderable(boolean renderable)
renderable
- true or falsepublic java.lang.String setStyle(java.lang.String key, java.lang.String value)
setStyle
in interface IStyles
key
- Style key name.value
- Style value.
public final void setStyles(java.lang.String style)
setStyles
in interface IStyles
style
- string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;public final void setStyles(Styles styles)
styles
- a Style object.public void setValue(java.lang.String value)
value
- value of objectpublic void swapWith(java.lang.String swapWith)
swapWith
- any string you wish to render instead of this object.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |