com.inet.html
Class InetHtmlDocument.ImpliedElement

java.lang.Object
  extended by javax.swing.text.AbstractDocument.AbstractElement
      extended by javax.swing.text.AbstractDocument.BranchElement
          extended by com.inet.html.InetHtmlDocument.ImpliedElement
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.AttributeSet, javax.swing.text.Element, javax.swing.text.MutableAttributeSet, javax.swing.tree.TreeNode
Enclosing class:
InetHtmlDocument

public class InetHtmlDocument.ImpliedElement
extends javax.swing.text.AbstractDocument.BranchElement
implements javax.swing.text.AttributeSet

This is the implementation for an implied bloc element. It does not depend directly on the document, which means it doesn't change the documents structure in any case. An implied element has no attributes of it's own but inherits the parents ones by css. This is the only element that doesn't require a write. It can therefore be generated anywhere, especially within views.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet
javax.swing.text.AttributeSet.CharacterAttribute, javax.swing.text.AttributeSet.ColorAttribute, javax.swing.text.AttributeSet.FontAttribute, javax.swing.text.AttributeSet.ParagraphAttribute
 
Field Summary
 
Fields inherited from interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute
 
Constructor Summary
InetHtmlDocument.ImpliedElement(javax.swing.text.Element parent)
          Creates an implied paragraph element
 
Method Summary
 javax.swing.text.Element clone(javax.swing.text.Element parent)
          Creates a copy of this element, but sets it's type to P!
 boolean containsAttribute(java.lang.Object name, java.lang.Object value)
          
 javax.swing.text.AttributeSet copyAttributes()
          
 java.lang.Object getAttribute(java.lang.Object attrName)
          
 int getAttributeCount()
          
 java.util.Enumeration<?> getAttributeNames()
          
 javax.swing.text.AttributeSet getAttributes()
          Returns the attribute set of this element
 javax.swing.text.Document getDocument()
          
 javax.swing.text.Element getElement(int index)
          
 int getElementCount()
          
 int getElementIndex(int offset)
          
 int getEndOffset()
          
 java.lang.String getName()
          
 javax.swing.text.Element getParentElement()
          
 int getStartOffset()
          
 boolean isDefined(java.lang.Object attrName)
          
 boolean isEqual(javax.swing.text.AttributeSet attr)
          
 boolean isLeaf()
          
 void replace(int start, int len, javax.swing.text.Element[] newElements)
          
 
Methods inherited from class javax.swing.text.AbstractDocument.BranchElement
children, getAllowsChildren, positionToElement, toString
 
Methods inherited from class javax.swing.text.AbstractDocument.AbstractElement
addAttribute, addAttributes, containsAttributes, dump, getChildAt, getChildCount, getIndex, getParent, getResolveParent, removeAttribute, removeAttributes, removeAttributes, setResolveParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.text.AttributeSet
containsAttributes, getResolveParent
 

Constructor Detail

InetHtmlDocument.ImpliedElement

public InetHtmlDocument.ImpliedElement(javax.swing.text.Element parent)
Creates an implied paragraph element

Parameters:
parent - the parent element of the implied
Method Detail

getAttributes

public javax.swing.text.AttributeSet getAttributes()
Returns the attribute set of this element

Specified by:
getAttributes in interface javax.swing.text.Element
Overrides:
getAttributes in class javax.swing.text.AbstractDocument.AbstractElement
Returns:
the attribute set of this element

isDefined

public boolean isDefined(java.lang.Object attrName)

Specified by:
isDefined in interface javax.swing.text.AttributeSet
Overrides:
isDefined in class javax.swing.text.AbstractDocument.AbstractElement

getAttribute

public java.lang.Object getAttribute(java.lang.Object attrName)

Specified by:
getAttribute in interface javax.swing.text.AttributeSet
Overrides:
getAttribute in class javax.swing.text.AbstractDocument.AbstractElement

getAttributeCount

public int getAttributeCount()

Specified by:
getAttributeCount in interface javax.swing.text.AttributeSet
Overrides:
getAttributeCount in class javax.swing.text.AbstractDocument.AbstractElement

getAttributeNames

public java.util.Enumeration<?> getAttributeNames()

Specified by:
getAttributeNames in interface javax.swing.text.AttributeSet
Overrides:
getAttributeNames in class javax.swing.text.AbstractDocument.AbstractElement

isEqual

public boolean isEqual(javax.swing.text.AttributeSet attr)

Specified by:
isEqual in interface javax.swing.text.AttributeSet
Overrides:
isEqual in class javax.swing.text.AbstractDocument.AbstractElement

containsAttribute

public boolean containsAttribute(java.lang.Object name,
                                 java.lang.Object value)

Specified by:
containsAttribute in interface javax.swing.text.AttributeSet
Overrides:
containsAttribute in class javax.swing.text.AbstractDocument.AbstractElement

copyAttributes

public javax.swing.text.AttributeSet copyAttributes()

Specified by:
copyAttributes in interface javax.swing.text.AttributeSet
Overrides:
copyAttributes in class javax.swing.text.AbstractDocument.AbstractElement

getDocument

public javax.swing.text.Document getDocument()

Specified by:
getDocument in interface javax.swing.text.Element
Overrides:
getDocument in class javax.swing.text.AbstractDocument.AbstractElement

getElement

public javax.swing.text.Element getElement(int index)

Specified by:
getElement in interface javax.swing.text.Element
Overrides:
getElement in class javax.swing.text.AbstractDocument.BranchElement

getElementCount

public int getElementCount()

Specified by:
getElementCount in interface javax.swing.text.Element
Overrides:
getElementCount in class javax.swing.text.AbstractDocument.BranchElement

getElementIndex

public int getElementIndex(int offset)

Specified by:
getElementIndex in interface javax.swing.text.Element
Overrides:
getElementIndex in class javax.swing.text.AbstractDocument.BranchElement

getEndOffset

public int getEndOffset()

Specified by:
getEndOffset in interface javax.swing.text.Element
Overrides:
getEndOffset in class javax.swing.text.AbstractDocument.BranchElement

getName

public java.lang.String getName()

Specified by:
getName in interface javax.swing.text.Element
Overrides:
getName in class javax.swing.text.AbstractDocument.BranchElement

getParentElement

public javax.swing.text.Element getParentElement()

Specified by:
getParentElement in interface javax.swing.text.Element
Overrides:
getParentElement in class javax.swing.text.AbstractDocument.AbstractElement

getStartOffset

public int getStartOffset()

Specified by:
getStartOffset in interface javax.swing.text.Element
Overrides:
getStartOffset in class javax.swing.text.AbstractDocument.BranchElement

isLeaf

public boolean isLeaf()

Specified by:
isLeaf in interface javax.swing.text.Element
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class javax.swing.text.AbstractDocument.BranchElement

clone

public javax.swing.text.Element clone(javax.swing.text.Element parent)
Creates a copy of this element, but sets it's type to P!
NOTE: This may create unexprected results if P is not a normal block element anymore by CSS.

Parameters:
parent - the parent of the cloned element
Returns:
the cloned element

replace

public void replace(int start,
                    int len,
                    javax.swing.text.Element[] newElements)

Overrides:
replace in class javax.swing.text.AbstractDocument.BranchElement