public class XMLAttribute extends XMLChoice
XMLChoice class in order to be able to
select some predefined values for attribute if such exists, otherwise, it is intended to hold the attribute name and
it's user defined (or automaticaly) defined value.
Like any other class which base class is
XMLElement class, this class provides visual way to change the value that it is supposed to take care of.
| 限定符和类型 | 字段和说明 |
|---|---|
com.ds.enums.EnumsAttribute |
enumsAttribute |
protected XMLPanel |
p |
atts, isCollapsed, isReadOnly, isRequired, isVisible, labelName, name, NEWLINE, OFFSET, value| 构造器和说明 |
|---|
XMLAttribute(com.ds.enums.EnumsAttribute attribute) |
XMLAttribute(String name)
Creates an instance of class that represents specified XML attribute, with default value for text panel type
(XMLTextPanel).
|
XMLAttribute(String name,
int tpType)
Creates an instance of class that represents specified XML attribute, with specified value of text panel.
|
XMLAttribute(String name,
Object[] choices,
int choosenIndex) |
XMLAttribute(String name,
Object[] choices,
int choosenIndex,
boolean isComboPanel,
boolean isVertical) |
XMLAttribute(String name,
String title) |
XMLAttribute(String name,
String[] choices,
int choosenIndex)
Creates an instance of class that represents specified XML attribute that has a given set of choices to choose
for attribute value, and with specified index of choice to be choosen after creation.
|
XMLAttribute(String name,
String[] choices,
int choosenIndex,
boolean isComboPanel,
boolean isVertical)
Creates an instance of class that represents specified XML attribute that has a given set of choices to choose
for attribute value, the specified index of choice to be choosen after creation, the specified setting for panel
type and specified layout for label and edit box.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
clone()
Used to create exact copy of instance of this class.
|
void |
fromXML(Node node)
Overrides super-class method to return an attribute specific XML input.
|
Object[] |
getChoices()
Overrides super-class method to return this class specific representation of choices.
|
Object |
getChoosen()
Gets the choosen value for attribute.
|
com.ds.enums.EnumsAttribute |
getEnumsAttribute() |
XMLPanel |
getOldPanel() |
XMLPanel |
getPanel()
Returns the panel for editing an attribute element value.
|
boolean |
isEmpty()
Indicates if element is empty.
|
void |
refreshDisplayValue() |
void |
refreshLabelName() |
void |
refreshPanelValue() |
void |
setChoices(Object[] choices) |
void |
setEnumsAttribute(com.ds.enums.EnumsAttribute enumsAttribute) |
void |
setValue(Object v)
If this is not an attribute with restricted set of values, the super-class method is called, and if it is not,
the value that is passed is the value of language specific choice, so this value is put into the
choosen member of this class, and the real value that corresponds to this language specific value is
put into valuemember. of this class. |
Object |
toKey()
得到属性Value
|
String |
toString()
Overrides super-class method.
|
Object |
toValue()
得到属性Value
|
void |
toXML(Node parent)
Overrides super-class method to return an attribute specific XML output.
|
getChoosenIndex, itemChanged, setChoosenIndex, setReadOnlyfromXML, getNode, getPrintDescription, getPrintDescription, isCollapsed, isReadOnly, isRequired, isValid, isValidEnter, isVisible, setCollapsed, setLabelName, setRequired, setVisible, toLabel, toNamepublic com.ds.enums.EnumsAttribute enumsAttribute
protected XMLPanel p
public XMLAttribute(String name)
name - The XML attribute name.public XMLAttribute(String name, int tpType)
name - The XML attribute name.tpType - The type of text panel, 1=XMLLocationPanel, 2=XMLTextPanel with password text field,
3=XMLMultiLineTextPanel, 0 or anything else=ordinary XMLTextPanelpublic XMLAttribute(String name, String[] choices, int choosenIndex)
name - The XML attribute name.choices - The valid choices for this attribute value.choosenIndex - The index of value to be choosen after creation.public XMLAttribute(com.ds.enums.EnumsAttribute attribute)
public XMLAttribute(String name, String[] choices, int choosenIndex, boolean isComboPanel, boolean isVertical)
name - The XML attribute name.choices - The valid choices for this attribute value.choosenIndex - The index of value to be choosen after creation.isComboPanel - The type of panel:true if XMLComboPanel will be used, false if XMLRadioPanel will be
used.isVertical - The type of layout:true if vertical layout will be used, false if horizontal layout
will be used.public com.ds.enums.EnumsAttribute getEnumsAttribute()
public void setEnumsAttribute(com.ds.enums.EnumsAttribute enumsAttribute)
public Object[] getChoices()
getChoices 在类中 XMLChoicepublic Object getChoosen()
getChoosen 在类中 XMLChoiceXMLChoice.getChoices()public boolean isEmpty()
isEmpty 在类中 XMLElementpublic String toString()
toString 在类中 XMLElementpublic void toXML(Node parent) throws DOMException
toXML 在类中 XMLElementparent - indicates how much tabulators to put before element tag.DOMExceptionpublic void fromXML(Node node)
fromXML 在类中 XMLElementnode - The content retrieved from XML file, that represents tag for
this element.public XMLPanel getPanel()
getPanel 在类中 XMLChoiceXMLTextPanel or XMLLocationPanel if attribute is not an attribute with restricted
values. Which of those two types of panel will be returned depends of how particular object of this class
is created.
XMLComboPanel or XMLRadioPanel if attribute has a set of restricted values. Which of
those two types of panel will be returned depends of how particular object of this class is created.
public void setValue(Object v)
choosen member of this class, and the real value that corresponds to this language specific value is
put into valuemember. of this class.public Object clone()
public void refreshLabelName()
refreshLabelName 在类中 XMLChoicepublic Object toKey()
public Object toValue()
toValue 在类中 XMLElementpublic void refreshDisplayValue()
public void setChoices(Object[] choices)
public void refreshPanelValue()
public XMLPanel getOldPanel()
Copyright © 2023 onecode. All rights reserved.