com.jaxfront.core.type
Interface ListType

All Superinterfaces:
java.util.Collection, java.lang.Iterable, java.util.List, Type
All Known Implementing Classes:
AbstractListType, ComplexGroupList, SimpleGroupList, SimpleTypeList, XPathDummyChoiceTypeWrapper

public interface ListType
extends Type, java.util.List

This interface defines a JAXFront ListType. A ListType manages a list of other types which can be either of the types ComplexGroup, SimpleGroup or SimpleType.

Version:
1.60

Field Summary
static int VALIDATE_ADD
           
static int VALIDATE_DELETE
           
static int VALIDATE_NOCHANGE
           
 
Fields inherited from interface com.jaxfront.core.type.Type
ComplexGroup, ComplexGroupList, CompositeType, DummyType, EmptyType, GroupType, ListType, NONE, SimpleGroup, SimpleGroupList, SimpleType, SimpleTypeList, VirtualType
 
Method Summary
 Type add(Type type)
          Adds a new type to the list.
 Type addNewChild()
          Adds a new child to the list.
 Type addNewChild(int index)
           
 Type addNewChild(Type template)
          Adds a new child to the list.
 Type addNewChild(Type templateType, int targetIndex)
          Copies the given templateType and adds it to the list at the given index position.
 void addNoTargetXUIDefinition(Type xuiType)
          Adds an information to a XUI type if a list doesn't contain any types for which a XUI definition would exist.
 void autoCreateEntries()
          Create the initial number of required min occur list items.
 void bind(Document DOM, org.w3c.dom.Element instanceElement, boolean bindOnlyAvailable, boolean removeChilds)
           
 void checkCardinality(int changes)
          Checks if removing or adding a new list entry violates the cardinality.
 void copyAndPasteChild(java.lang.Integer typeToCopyIndex, java.lang.Integer targetIndex)
           
 void copyAndPasteChild(Type typeToCopy)
           
 void copyAndPasteChild(Type typeToCopy, java.lang.Integer targetIndex)
           
 Type copyChild(java.lang.Integer index)
          Copies the child with the given index and returns it.
 java.lang.Object delete(Type type)
          Deletes a type from the list.
 Type getEditingType()
          Gets the current editable type of the list.
 java.util.List getList()
          Gets the list of types.
 int getMaxOccurs()
          Returns the maximum number of allowed list entries.
 int getMinOccurs()
          Returns the minimum number of allowed list entries.
 int[] getSortIndexes()
          Returns the sort indexes or null.
 boolean isListItemRemoveable(Type type)
           
 void maintainXUIDefinitions(Type type)
          Traverses down the editing type and maintains all the xui definitions set on the editing type axis to the passed type.
 void move(int from, int to)
          Deprecated. use swap
 void removeAll(boolean isTemporary, boolean checkCardinality)
          Removes all childs of the list.
 java.lang.Object removeChild(int index)
          Removes the list item with the given index from the list.
 java.lang.Object removeLastChild(boolean temporary)
          Removes the last list item from the list.
 void removeNoTargetXUIDefinition(Type xuiType)
          Removes an information of a XUI type if a list doesn't contain any types for which a XUI definition would exist.
 void setEditingType(Type editingType)
          Resets the editing type.
 void setList(java.util.List list)
          Sets the list entries.
 void setSortIndexes(int[] sortIndexes)
          Set the sort indexes.
 void swap(int from, int to)
          Swaps the position of two given types in the list
 boolean violateCardinality(int changes)
          Checks if removing or adding a new list entry violates the cardinality.
 
Methods inherited from interface com.jaxfront.core.type.Type
addTreeNode, bind, bind, bind, bind, deepClone, deepClone, getChild, getChild, getChoosenType, getClientProperty, getDerivedTypes, getDirectChild, getDirectChild, getDirectChildren, getDirectChildren, getDirectChildValue, getDisplayValue, getDOM, getFullCaption, getFullCaption, getId, getMixedContent, getName, getNamespace, getNextSibling, getParent, getParent, getParentList, getPrefixedXPathLocation, getPreviousSibling, getPropertyChangeSupport, getQName, getRepresentedTableLayoutParent, getRepresentedTabParent, getRepresentedTreeNodeHolder, getRepresentedTreeNodeParent, getRepresentedTreeNodeParentIcon, getRepresentedTreeNodeParentIconName, getSchemaElement, getSchemaType, getSerializationName, getShortCaption, getStyle, getTemplate, getTreeHierarchyContext, getTypeClassification, getUserObject, getVisualName, getW3CXPathLocation, getXPathLocation, getXUIDefinition, getXUIDefinition, hasChoosenType, hasRecursionBeenBuilt, hasRepresentableTreeChildren, hasUIDefinition, hasUnChoosenChoiceParent, hasUndefinedChildren, hasValidationError, isAbstract, isAnonymous, isAttribute, isChoice, isComposite, isDerived, isDerivedFrom, isDerivedFromEditingType, isEditingType, isEmpty, isGlobal, isIncluded, isKey, isKeyContext, isKeyRef, isList, isLocked, isRecursive, isReleased, isRenderable, isRepresentedAsHeader, isRepresentedAsTab, isRepresentedAsTreeNode, isRequired, isRoot, isSerializable, isSerializable, isSimple, isUserInstanciated, isVirtual, markAsDirtyXPath, putClientProperty, release, remove, removeAll, removeChild, removeClientProperty, removeMessage, removeTreeNode, serialize, serialize, setApplicationRequired, setBackground, setChoosenType, setChoosenType, setCodeSetValues, setDirectChildValue, setDOM, setEditable, setEnabled, setForeground, setId, setIsKeyContext, setLabelColor, setLabelText, setParent, setRenderable, setSchemaElement, setSerializable, setSerializable, setTemplate, setTreeIcon, setUIDefinition, setUserInstanciated, setUserObject, setVisible, setVisibleAndSerializable, showLabel, showMessage, unChoosenBranch
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

VALIDATE_NOCHANGE

static final int VALIDATE_NOCHANGE
See Also:
Constant Field Values

VALIDATE_ADD

static final int VALIDATE_ADD
See Also:
Constant Field Values

VALIDATE_DELETE

static final int VALIDATE_DELETE
See Also:
Constant Field Values
Method Detail

add

Type add(Type type)
Adds a new type to the list.

Parameters:
type - a new type to add
Returns:
the type that was added to the list

addNewChild

Type addNewChild()
Adds a new child to the list.

Returns:
the new child that has been added to the list

addNewChild

Type addNewChild(int index)

addNewChild

Type addNewChild(Type templateType,
                 int targetIndex)
Copies the given templateType and adds it to the list at the given index position.

Parameters:
templateType - the child to be cloned or null if none
targetIndex - the index where to copy should be placed in the list
Returns:
the new child that has been added to the list

addNewChild

Type addNewChild(Type template)
Adds a new child to the list.

Parameters:
template - the child to be added to the list
Returns:
the new child that has been added to the list

bind

void bind(Document DOM,
          org.w3c.dom.Element instanceElement,
          boolean bindOnlyAvailable,
          boolean removeChilds)

addNoTargetXUIDefinition

void addNoTargetXUIDefinition(Type xuiType)
Adds an information to a XUI type if a list doesn't contain any types for which a XUI definition would exist. As soon as one or more types of the list exist(s), the XUI definition will be applied to them.

Parameters:
xuiType - the type for which a XUI definition exists but no subtypes were created

delete

java.lang.Object delete(Type type)
                        throws ListModificationException
Deletes a type from the list.

Parameters:
type - the type to delete
Throws:
ListModificationException

getEditingType

Type getEditingType()
Gets the current editable type of the list.

Returns:
the current editable type of the list

getList

java.util.List getList()
Gets the list of types.

Returns:
the list of types

removeAll

void removeAll(boolean isTemporary,
               boolean checkCardinality)
Removes all childs of the list.

Parameters:
isTemporary - indicates if this deletion is temporary
checkCardinality - indicates if cardinality violation should be checked

removeNoTargetXUIDefinition

void removeNoTargetXUIDefinition(Type xuiType)
Removes an information of a XUI type if a list doesn't contain any types for which a XUI definition would exist. As soon as one or more types of the list exist(s), the XUI definition will be applied to them.

Parameters:
xuiType - the type for which a XUI definition exists but no subtypes were created

setList

void setList(java.util.List list)
Sets the list entries.

Parameters:
list - list entries

getMaxOccurs

int getMaxOccurs()
Returns the maximum number of allowed list entries.


getMinOccurs

int getMinOccurs()
Returns the minimum number of allowed list entries.


checkCardinality

void checkCardinality(int changes)
                      throws ValidationException
Checks if removing or adding a new list entry violates the cardinality. The passed int value indicates: 0 = no change, simple validation 1 = try to add a new list entry -1 = try to remove a list entry

Parameters:
changes - number of new list entries
Throws:
ValidationException

violateCardinality

boolean violateCardinality(int changes)
Checks if removing or adding a new list entry violates the cardinality. The passed int value indicates: true = ok, false = violate cardinality 0 = no change, simple validation 1 = try to add a new list entry -1 = try to remove a list entry

Parameters:
changes - number of new list entries

getSortIndexes

int[] getSortIndexes()
Returns the sort indexes or null.


setSortIndexes

void setSortIndexes(int[] sortIndexes)
Set the sort indexes.

Parameters:
sortIndexes - new sort index array

removeChild

java.lang.Object removeChild(int index)
                             throws ListModificationException
Removes the list item with the given index from the list.

Parameters:
index - the index of the list item to should be removed from the list
Throws:
ListModificationException

removeLastChild

java.lang.Object removeLastChild(boolean temporary)
                                 throws ListModificationException
Removes the last list item from the list.

Parameters:
temporary - indicates if the deletion is temporary
Throws:
ListModificationException

copyChild

Type copyChild(java.lang.Integer index)
Copies the child with the given index and returns it.

Parameters:
typeToCopyIndex - the index of the child that should be copied

copyAndPasteChild

void copyAndPasteChild(java.lang.Integer typeToCopyIndex,
                       java.lang.Integer targetIndex)

copyAndPasteChild

void copyAndPasteChild(Type typeToCopy,
                       java.lang.Integer targetIndex)

copyAndPasteChild

void copyAndPasteChild(Type typeToCopy)

maintainXUIDefinitions

void maintainXUIDefinitions(Type type)
Traverses down the editing type and maintains all the xui definitions set on the editing type axis to the passed type.


swap

void swap(int from,
          int to)
Swaps the position of two given types in the list

Parameters:
from - the source position
to - the destination position

move

void move(int from,
          int to)
Deprecated. use swap

Moves the type from position "from" to position "to", shifting the other elements

Parameters:
from - the source position
to - the destination position

setEditingType

void setEditingType(Type editingType)
Resets the editing type.

Parameters:
editingType - template type for a list

autoCreateEntries

void autoCreateEntries()
Create the initial number of required min occur list items.


isListItemRemoveable

boolean isListItemRemoveable(Type type)
                             throws ListModificationException
Throws:
ListModificationException