public class HTMLTreeElement extends java.lang.Object implements HTMLTagElement, java.io.Serializable
This example creates an HTMLTreeElement object.
Once the elements are added to an HTMLTree object and the elements are expanded, the HTMLTreeElements will look like this:// Create parent HTMLTreeElement. HTMLTreeElement parentElement = new HTMLTreeElement(); parentElement.setTextUrl(new HTMLHyperlink("http://myWebPage", "My Web Page")); // Create HTMLTreeElement Child. HTMLTreeElement childElement = new HTMLTreeElement(); childElement.setTextUrl(new HTMLHyperlink("http://anotherWebPage", "Another Web Page")); parentElement.addElement(childElement);
- | My Web Page | ||
|
HTMLTreeElement objects generate the following events:
HTMLTree
,
URLParser
,
Serialized FormConstructor and Description |
---|
HTMLTreeElement()
Constructs a default HTMLTreeElement object.
|
HTMLTreeElement(HTMLHyperlink textUrl)
Constructs an HTMLTreeElement with the specified textUrl.
|
HTMLTreeElement(HTMLTagElement text)
Constructs an HTMLTreeElement with the specified text.
|
HTMLTreeElement(java.lang.String text)
Constructs an HTMLTreeElement with the specified text.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(HTMLTreeElement element)
Adds a child element to the parent HTMLTreeElement
|
void |
addElementListener(ElementListener listener)
Adds an addElementListener.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
java.lang.String |
getCollapsedGif()
Returns the collapsed gif.
|
java.lang.String |
getDocGif()
Returns the document gif.
|
java.lang.String |
getExpandedGif()
Returns the expanded gif.
|
java.lang.String |
getFOTag()
Returns a comment tag.
|
HTMLHyperlink |
getIconUrl()
Returns the icon URL.
|
java.lang.String |
getTag()
Returns the HTMLTreeElement tag.
|
HTMLTagElement |
getText()
Returns the visible text of the HTMLTreeElement.
|
HTMLHyperlink |
getTextUrl()
Returns the text URL.
|
boolean |
isExpanded()
Indicates if the HTMLTreeElement is expanded.
|
boolean |
isLeaf()
Indicates if the HTMLTreeElement is a leaf.
|
void |
removeElement(HTMLTreeElement element)
Removes a child element from the parent HTMLTreeElement
|
void |
removeElementListener(ElementListener listener)
Removes this ElementListener from the internal list.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list.
|
void |
selected(int hashcode)
Indicates which HTMLTreeElement is selected.
|
static void |
setCollapsedGif(java.lang.String gifUrl)
Set the gif to use when the HTMLTree is collapsed.
|
static void |
setDocGif(java.lang.String gifUrl)
Set the gif to use when the element in the tree
contains documents or files and not directories.
|
void |
setExpanded(boolean expanded)
Set the HTMLTreeElement to be expanded.
|
static void |
setExpandedGif(java.lang.String gifUrl)
Set the gif to use when the HTMLTree is expanded.
|
void |
setIconUrl(HTMLHyperlink iconUrl)
Set the URL for the expanded/collapsed icon and all the corresponding icons for the
elements under this HTMLTreeElement.
|
void |
setText(HTMLTagElement element)
Set the visible text of the HTMLTreeElement.
|
void |
setText(java.lang.String text)
Set the visigble test of the HTMLTreeElement.
|
void |
setTextUrl(HTMLHyperlink textUrl)
Set the URL of the HTMLTreeElement text.
|
void |
sort(boolean sort)
Sorts the tree elements.
|
public HTMLTreeElement()
public HTMLTreeElement(java.lang.String text)
text
- The text.public HTMLTreeElement(HTMLTagElement text)
text
- The text.public HTMLTreeElement(HTMLHyperlink textUrl)
textUrl
- The HTMLHyperlink.public void addElement(HTMLTreeElement element)
element
- The HTMLTreeElement.public void addElementListener(ElementListener listener)
listener
- The ElementListener.removeElementListener(com.ibm.as400.util.html.ElementListener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public java.lang.String getCollapsedGif()
public java.lang.String getDocGif()
public java.lang.String getExpandedGif()
public HTMLHyperlink getIconUrl()
public HTMLTagElement getText()
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public HTMLHyperlink getTextUrl()
public boolean isExpanded()
public boolean isLeaf()
public void removeElement(HTMLTreeElement element)
element
- The HTMLTreeElement.public void removeElementListener(ElementListener listener)
listener
- The ElementListener.addElementListener(com.ibm.as400.util.html.ElementListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void selected(int hashcode)
hashcode
- The hashcode.public static void setCollapsedGif(java.lang.String gifUrl)
gifUrl
- The collapsed gif location.public static void setDocGif(java.lang.String gifUrl)
gifUrl
- The document gif location.public static void setExpandedGif(java.lang.String gifUrl)
gifUrl
- The expanded gif location.public void setExpanded(boolean expanded)
expanded
- true if element is expanded; false if collapsed.public void setIconUrl(HTMLHyperlink iconUrl)
iconUrl
- The icon url.public void setText(HTMLTagElement element)
element
- The HTMLTagElement.public void setText(java.lang.String text)
text
- The text.public void setTextUrl(HTMLHyperlink textUrl)
textUrl
- The HTMLHyperlink.public void sort(boolean sort)
sort
- true if the elements are sorted; false otherwise.
The default is true.