echoxul.xom
Class XULElement

java.lang.Object
  extended byechoxul.xom.XULNode
      extended byechoxul.xom.XULElement
Direct Known Subclasses:
AbstractEchoXULElement

public class XULElement
extends XULNode

Most things in XUL are an Element. This is a piece of content in the document. Note that most of the fields on this class are not exposed with typical JavaBean accessors but are actually fields on the class. This is by design.


Constructor Summary
XULElement()
          Initialize an XULElement that does not supports children
XULElement(boolean supportsChildren)
          Initialize with a flag to support children or not
 
Method Summary
 void addChild(XULNode child)
          Add a child.
 void dump(java.io.PrintWriter out, java.lang.String prefix)
           
 void dumpChildren(java.io.PrintWriter out, java.lang.String prefix)
           
 XULAttributes getAttributes()
           
 java.util.List getChildren()
          Return a read-only list of children
 java.lang.String[] getCssClasses()
           
 XULDocument getDocument()
           
 java.lang.String getId()
          May be null
 java.lang.String getName()
           
 java.lang.String getNamespace()
           
 XULElement getParent()
          Null if root
 boolean hasChildren()
           
protected  void init()
          Override this method to perform initialization after setParameters is called by the creator.
 void lockChildren()
          Make the instance read-only
 void setParameters(XULDocument doc, XULElement parent, java.lang.String namespace, java.lang.String name, java.lang.String id, java.lang.String[] cssClasses, XULAttributes attributes)
          This method must be called to initialize an instance.
 boolean supportsChildren()
           
 
Methods inherited from class echoxul.xom.XULNode
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XULElement

public XULElement()
Initialize an XULElement that does not supports children


XULElement

public XULElement(boolean supportsChildren)
Initialize with a flag to support children or not

Parameters:
supportsChildren -
Method Detail

setParameters

public void setParameters(XULDocument doc,
                          XULElement parent,
                          java.lang.String namespace,
                          java.lang.String name,
                          java.lang.String id,
                          java.lang.String[] cssClasses,
                          XULAttributes attributes)
This method must be called to initialize an instance. It is left off of the ctor to aid inheritance. This method must be called prior to the instance being added to a parent.

Throws:
java.lang.IllegalStateException - if called more than once

init

protected void init()
Override this method to perform initialization after setParameters is called by the creator.


getDocument

public XULDocument getDocument()

getAttributes

public XULAttributes getAttributes()

getParent

public XULElement getParent()
Null if root


getId

public java.lang.String getId()
May be null


getCssClasses

public java.lang.String[] getCssClasses()

getNamespace

public java.lang.String getNamespace()

getName

public java.lang.String getName()

addChild

public void addChild(XULNode child)
Add a child. This method must only be called after the child has been inited with this as the parent.

Throws:
java.lang.IllegalStateException - if lock has been called

lockChildren

public void lockChildren()
Make the instance read-only


supportsChildren

public boolean supportsChildren()

getChildren

public java.util.List getChildren()
Return a read-only list of children


hasChildren

public boolean hasChildren()

dump

public void dump(java.io.PrintWriter out,
                 java.lang.String prefix)
Overrides:
dump in class XULNode

dumpChildren

public void dumpChildren(java.io.PrintWriter out,
                         java.lang.String prefix)


Copyright © 2004 Terry Laurenzo. All Rights Reserved.