public class XMLCollection extends XMLElement
NOTE: Although this class is not declared abstract, it is uselles without
redefining it's methods (especially generateNewElement() method}.
| 限定符和类型 | 字段和说明 |
|---|---|
protected XMLPanel |
controlledPanel
Visually presents the collection of elements.
|
protected XMLControlPanel |
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, isVisible, labelName, name, NEWLINE, OFFSET, value| 构造器和说明 |
|---|
XMLCollection(XMLComplexElement myOwner)
Create collection which is owned by specified owner.
|
XMLCollection(XMLComplexElement myOwner,
String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(XMLElement 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.
|
XMLElement |
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.
|
XMLPanel |
getControlledPanel() |
XMLPanel |
getControlPanel() |
long |
getCurrentID()
Gets the ID upon further IDs are generated.
|
DefaultCellEditor |
getEditableDefaultValue(int column) |
int[] |
getEditableTableFieldOrdinals() |
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(XMLComplexElement 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.
|
JList |
getJList() |
DefaultMutableTreeNode |
getNode()
Make tree node for this element and all subelements.
|
XMLComplexElement |
getOwner() |
XMLPanel |
getPanel()
Returns the panel for editing the element.
|
String |
getReadOnlyMessageName(XMLComplexElement 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.
|
Collection |
getValues() |
DefaultMutableTreeNode |
getXPDLNode() |
boolean |
isEmpty()
Returns true if there is no elements within collection.
|
static boolean |
isIdValid(String id)
Checks if Id is valid NMTOKEN string.
|
boolean |
isJCheckBox(int column) |
void |
onElementCreated(XMLElement el)
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. into
collection.
|
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 |
setOwner(XMLComplexElement myOwner) |
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, getPrintDescription, isCollapsed, isReadOnly, isRequired, isValid, isValidEnter, isVisible, setCollapsed, setLabelName, setRequired, setValue, setVisible, toLabel, toName, toValueprotected transient String IDPrefix
protected transient ArrayList refCollectionElements
protected transient XMLPanel controlledPanel
XMLTablePanel class.protected transient XMLControlPanel controlPanel
XMLTableControlPanel class.protected transient XMLComplexElement myOwner
public XMLCollection(XMLComplexElement myOwner)
myOwner - the program equivalence to an XML schema defined element that
holds the XML schema collection presented by this class
instance.public XMLCollection(XMLComplexElement myOwner, String name)
public XMLComplexElement getOwner()
public void add(XMLElement 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 在类中 XMLElementro - true if element will be 'read only', false
otherwise.public Collection toCollection()
public Collection getTableElements()
public Collection getChoosable()
public XMLElement generateNewElement()
public void onElementCreated(XMLElement el)
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 XMLPanel getControlledPanel()
public XMLPanel getControlPanel()
public boolean isEmpty()
isEmpty 在类中 XMLElementpublic XMLPanel getPanel()
XMLElementgetPanel 在类中 XMLElementpublic void toXML(Node parent) throws DOMException
XMLElementtoXML 在类中 XMLElementparent - indicates how much tabulators to put before element tag.DOMExceptionpublic void fromXML(Node node)
XMLElementfromXML 在类中 XMLElementnode - The content retrieved from XML file, that represents tag for
this element.public String toString()
XMLElementtoString method of it's value member, if value is
null, returns labelName member.toString 在类中 XMLElementpublic String getReadOnlyMessageName(XMLComplexElement el)
public String getInUseMessageName(XMLComplexElement el)
public Object clone()
XMLElementclone 在类中 XMLElementpublic 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 在类中 XMLElementpublic static boolean isIdValid(String id)
public int[] getEditableTableFieldOrdinals()
public DefaultCellEditor getEditableDefaultValue(int column)
public boolean isJCheckBox(int column)
public Collection getValues()
public JList getJList()
public void setOwner(XMLComplexElement myOwner)
public DefaultMutableTreeNode getNode()
XMLElementgetNode 在类中 XMLElementpublic DefaultMutableTreeNode getXPDLNode()
Copyright © 2023 onecode. All rights reserved.