public class NewXMLCollection extends NewXMLElement
NOTE: Although this class is not declared abstract, it is
uselles without redefining it's methods (especially
generateNewElement() method}.
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
coloringTable |
protected NewXMLTablePanel |
controlledPanel
Visually presents the collection of elements.
|
protected NewXMLTableControlPanel |
controlPanel
The panel consisted of control buttons.
|
protected String |
IDPrefix
Used as a textual prefix for a generated numerical ID
|
protected XMLComplexElement |
myOwner
The owner class which element is this class instance.
|
protected ArrayList |
refCollectionElements
The collection of elements.
|
atts, isCollapsed, isReadOnly, isRequired, labelName, name, NEWLINE, OFFSET, value| 构造器和说明 |
|---|
NewXMLCollection(XMLComplexElement myOwner)
Create collection which is owned by specified owner.
|
NewXMLCollection(XMLComplexElement myOwner,
String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(NewXMLElement el)
Adds new element to collection.
|
boolean |
canInsertElement(XMLElement el)
Returns true if element can be inserted into collection.
|
boolean |
canRemoveElement(XMLElement el)
Returns true if element can be removed from collection.
|
void |
clear()
Clears the collection.
|
Object |
clone()
Used to create exact copy of instance of this class.
|
protected void |
decrementID()
Decrements an ID.
|
void |
fromXML(Node node)
Supposed to be overriden by derived classes to implement
element specific reading from an XML file.
|
String |
generateID()
Generates numerical ID for elements that need it, and
converts that ID to string by adding it a prefix that
is set using #setIDPrefix method.
|
NewXMLElement |
generateNewElement()
Generates the new element that made collection.
|
Object |
get(int no)
Gets the element that is placed at specified no. from collection.
|
Collection |
getChoosable()
Gets elements that can be choosed within some combo box.
|
XMLComplexElement |
getCollectionElement(String IDOrName)
Returnes the element specified by ID or Name attribute.
|
NewXMLPanel |
getControlledPanel() |
NewXMLPanel |
getControlPanel() |
long |
getCurrentID()
Gets the ID upon further IDs are generated.
|
Collection |
getElementStructure()
Gets the structure of elements contained within collection,
that is the all elements that element is made of.
|
String |
getIDPrefix()
Returns the prefix of some ID generated by #generateID.
|
String |
getInUseMessageName(XMLElement el)
Returns the name of the message defined within property file
that explains the reason why element that is in use
can't be deleted.
|
int[] |
getInvisibleTableFieldOrdinals()
Returns the ordinal numbers of elements not to be displayed
within table panel.
|
DefaultMutableTreeNode |
getNode()
Make tree node for this element and all subelements.
|
XMLComplexElement |
getOwner() |
NewXMLPanel |
getPanel()
Returns the panel for editing the element.
|
String |
getPrintDescription(String indent,
StyledDocument doc)
Make print description of this element and all subelements and attributes.
|
String |
getReadOnlyMessageName(XMLElement el)
Returns the name of the message defined within property file
that explains the reason why element marked as read only
can't be deleted.
|
Collection |
getTableElements()
Gets elements that can be choosed within table.
|
boolean |
isEmpty()
Returns true if there is no elements within collection.
|
static boolean |
isIdValid(String id)
Checks if Id is valid NMTOKEN string.
|
void |
onElementCreated(NewXMLElement newElement)
Some specific things to be done after element is created.
|
void |
onElementDeleted(XMLElement el)
Some specific things to be done after element is deleted from
collection.
|
void |
onElementInserted(XMLElement el)
Some specific things to be done after element is inserted.
|
void |
onElementModified(XMLElement el)
Some specific things to be done after element from collection
is modified.
|
void |
onElementRemoved(XMLElement el)
Some specific things to be done after element is removed from
collection.
|
void |
refreshCollection(Set elementsToAddOrRemove,
boolean append)
Refreshes the collection.
|
void |
refreshLabelName() |
void |
remove(Object el)
Removes specified element from collection.
|
protected void |
resetID()
Resets an ID generator.
|
protected void |
setCurrentID(long ID)
Sets the ID upon further IDs are generated.
|
void |
setIDPrefix(String idPref)
Sets the prefix for some ID generated by #generateID.
|
void |
setReadOnly(boolean ro)
Sets the collection and all contained elements to be read only or not.
|
int |
size()
Returns the number of elements within collection.
|
Collection |
toCollection()
Returns the collection of all elements within collection.
|
String |
toString()
Returns the text representation of element's 'value'.
|
void |
toXML(Node parent)
Supposed to be overriden by derived classes to implement
element specific writting to an XML file.
|
protected void |
updateID(String someID)
Updates an ID.
|
fromXML, getPrintDescription, isCollapsed, isReadOnly, isRequired, isValid, isValidEnter, setCollapsed, setLabelName, setRequired, setValue, toLabel, toName, toValueprotected transient String IDPrefix
protected transient ArrayList refCollectionElements
protected transient NewXMLTablePanel controlledPanel
XMLTablePanel class.protected transient NewXMLTableControlPanel controlPanel
XMLTableControlPanel class.protected transient XMLComplexElement myOwner
protected boolean coloringTable
public NewXMLCollection(XMLComplexElement myOwner)
myOwner - the program equivalence to an XML schema defined
element that holds the XML schema collection presented
by this class instance.public NewXMLCollection(XMLComplexElement myOwner, String name)
public XMLComplexElement getOwner()
public void add(NewXMLElement el)
public void remove(Object el)
public Object get(int no)
public int size()
public void clear()
public void refreshCollection(Set elementsToAddOrRemove, boolean append)
elementsToAddOrRemove - Set of elements that has to be added to or
removed from collection.append - true if adding elements to collection,
false otherwise.public XMLComplexElement getCollectionElement(String IDOrName)
IDOrName - ID or Name attribute of wanted element.public Collection getElementStructure()
public int[] getInvisibleTableFieldOrdinals()
XMLComplexElement.fillStructure()
method.public void setReadOnly(boolean ro)
setReadOnly 在类中 NewXMLElementro - true if element will be 'read only',
false otherwise.public Collection toCollection()
public Collection getTableElements()
public Collection getChoosable()
public NewXMLElement generateNewElement()
public void onElementCreated(NewXMLElement newElement)
public void onElementInserted(XMLElement el)
public void onElementModified(XMLElement el)
public void onElementDeleted(XMLElement el)
public void onElementRemoved(XMLElement el)
public boolean canInsertElement(XMLElement el)
public boolean canRemoveElement(XMLElement el)
public NewXMLPanel getControlledPanel()
public NewXMLPanel getControlPanel()
public boolean isEmpty()
isEmpty 在类中 NewXMLElementpublic NewXMLPanel getPanel()
NewXMLElementgetPanel 在类中 NewXMLElementpublic void toXML(Node parent) throws DOMException
NewXMLElementtoXML 在类中 NewXMLElementparent - parent nodeDOMExceptionpublic void fromXML(Node node)
NewXMLElementfromXML 在类中 NewXMLElementnode - root nodepublic String toString()
NewXMLElementtoString method
of it's value member, if value is null,
returns labelName member.toString 在类中 NewXMLElementpublic String getReadOnlyMessageName(XMLElement el)
public String getInUseMessageName(XMLElement el)
public Object clone()
NewXMLElementclone 在类中 NewXMLElementpublic void setIDPrefix(String idPref)
public String getIDPrefix()
protected void setCurrentID(long ID)
public long getCurrentID()
public String generateID()
protected void resetID()
protected void decrementID()
protected void updateID(String someID)
someID - the ID value upon the update is performed.public void refreshLabelName()
refreshLabelName 在类中 NewXMLElementpublic static boolean isIdValid(String id)
public DefaultMutableTreeNode getNode()
NewXMLElementgetNode 在类中 NewXMLElementpublic String getPrintDescription(String indent, StyledDocument doc)
getPrintDescription 在类中 NewXMLElementCopyright © 2023 onecode. All rights reserved.