public interface ElementList extends ElementListBase
The starting point is a DOM element list with almost a child element, this first child element is saved as the pattern (really a deep clone), and new elements are created using this element as the pattern. The initial element list (including the pattern) may be initially cleared or kept as is when this object is created and attached to the underlying DOM list.
This type of list helps to render a list of values into the DOM element list,
for instance, this interface support "out the box" the typical DOM element list where
every child element contains some value usually as the data of a text node.
Methods to add new elements include optionally a value parameter.
The structure and renderer objects are used to customize how and where this value is saved in the list
beyond the default cases.
A pattern based DOM Element list ever works in "master" mode, see ElementListFree.isMaster().
ElementGroupManager.createElementList(org.w3c.dom.Element,boolean)| Modifier and Type | Method and Description |
|---|---|
Element |
addElement()
Adds a new child element at the end of the list using the pattern (the new element is a clone).
|
Element |
addElement(Object value)
Adds a new child element at the end of the list and renders the specified value using
the current structure and renderer.
|
DocumentFragment |
getChildContentPatternFragment()
Returns the pattern used to render values if
isUsePatternMarkupToRender()
is true. |
Element |
getChildPatternElement()
Returns the element used as a pattern.
|
Element |
getContentElementAt(int index)
Returns the "content" element, this element is used to render below
the associated value of the child element.
|
ElementListRenderer |
getElementListRenderer()
Returns the current renderer used by this list.
|
ElementListStructure |
getElementListStructure()
Returns the current structure used by this list.
|
Element |
insertElementAt(int index)
Inserts a new child element at the specified position using the pattern (the new element is a clone).
|
Element |
insertElementAt(int index,
Object value)
Inserts a new child element at the specified position and renders the specified value using
the current structure and renderer.
|
boolean |
isUsePatternMarkupToRender()
Informs whether the original (saved as pattern) markup is used to render.
|
void |
setElementListRenderer(ElementListRenderer renderer)
Sets the renderer used by this list.
|
void |
setElementListStructure(ElementListStructure structure)
Sets the structure used by this list.
|
void |
setElementValueAt(int index,
Object value)
Renders the specified value into the element with the given position
using the current structure and renderer.
|
void |
setLength(int len)
Increases or shrinks the list to fit the new size.
|
void |
setUsePatternMarkupToRender(boolean value)
Sets whether the original (saved as pattern) markup is used to render.
|
getElementAt, getElementFromNode, getElements, getFirstElement, getLastElement, getListElementInfoAt, getListElementInfoFromNode, indexOfElement, isEmpty, lastIndexOfElement, moveElement, removeAllElements, removeElementAt, removeElementRangegetItsNatDocument, getParentElementcontainsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValueElementListStructure getElementListStructure()
setElementListStructure(ElementListStructure)void setElementListStructure(ElementListStructure structure)
structure - the new structure.getElementListStructure()ElementListRenderer getElementListRenderer()
setElementListRenderer(ElementListRenderer)void setElementListRenderer(ElementListRenderer renderer)
renderer - the new renderer.getElementListRenderer()Element getChildPatternElement()
void setLength(int len)
If the new size is bigger new elements are added at the end, if the size is lower tail elements are removed.
Note: getLength() returns the current length, this method
is defined in org.w3c.dom.NodeList.getLength().
len - the new length.addElement(),
ElementListBase.removeElementAt(int)Element addElement()
addElement(Object)Element addElement(Object value)
value - the value to render.addElement(),
getElementListStructure(),
getElementListRenderer(),
ElementListStructure.getContentElement(ElementList,int,Element),
ElementListRenderer.renderList(ElementList,int,Object,Element,boolean)Element insertElementAt(int index)
index - index of the new element.insertElementAt(int,Object)Element insertElementAt(int index, Object value)
index - index of the element.value - the value to render.insertElementAt(int),
getElementListStructure(),
getElementListRenderer(),
ElementListStructure.getContentElement(ElementList,int,Element),
ElementListRenderer.renderList(ElementList,int,Object,Element,boolean)void setElementValueAt(int index,
Object value)
index - index of the element.value - the value to render.insertElementAt(int,Object),
getElementListStructure(),
getElementListRenderer(),
ElementListStructure.getContentElement(ElementList,int,Element),
ElementListRenderer.renderList(ElementList,int,Object,Element,boolean)Element getContentElementAt(int index)
index - index of the element.getElementListStructure(),
ElementListStructure.getContentElement(ElementList,int,Element),
ElementListRenderer.renderList(ElementList,int,Object,Element,boolean)boolean isUsePatternMarkupToRender()
The default value is defined by ItsNatDocument.isUsePatternMarkupToRender()
setUsePatternMarkupToRender(boolean)void setUsePatternMarkupToRender(boolean value)
value - true to enable the use of original markup to render.isUsePatternMarkupToRender()DocumentFragment getChildContentPatternFragment()
isUsePatternMarkupToRender()
is true.Copyright © Innowhere Software, Jose Maria Arranz Santamaria.