|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.editor.widgets.AbstractUserInputWidget sk.uniba.euromath.editor.widgets.namelist.NameListItemChooser<R>
R
- accepts namelists containing this type of BaseRule
.public class NameListItemChooser<R extends BaseRule>
Allows the user to pick one item from given namelist. Automatically handles schema loading when needed.
Nested Class Summary | |
---|---|
static class |
NameListItemChooser.State<R extends BaseRule>
The state of the widget. |
Field Summary | |
---|---|
protected QName |
_selectedQName
Valid after the component is disposed. |
protected R |
_selectedRule
Valid after the component is disposed. |
protected String |
_selectedValue
Valid after the component is disposed. |
protected Combo |
cmbAttrName
Combo containing all names from the namelist. |
protected Composite |
composite
All controls are placed here. |
DisplayableNameList<R> |
dnl
Allow to select item from this namelist. |
protected ValidityMessages |
lastMessages
Error messages. |
protected Label |
lNamespace
Displays namespace of selected name. |
protected Label |
lNamespaceDescription
Displays description of namespace of selected name. |
protected Label |
lValueType
Displays string describing allowed textual value. |
NamespaceManager |
nsManager
Namespace manager. |
protected Text |
prefix
Textbox that allows modification of the XML namespace prefix. |
protected Text |
textValue
Allows to change textual value if the name is name of attribute. |
protected XMLAccess |
xmlAccess
Document instance. |
Fields inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget |
---|
listeners, msgListeners |
Constructor Summary | |
---|---|
NameListItemChooser(Composite parent,
XMLAccess xmlAccess,
DisplayableNameList<R> dnl,
String text,
NamespaceManager nsManager)
Constructs instance of the object. |
Method Summary | |
---|---|
void |
checkErrors()
Checks wrong values on component. |
static NameListItemChooser<AttributeRule> |
createAttributeCreator(Composite parent,
INameList<AttributeRule> nameList,
XMLAccess xmlAccess,
NamespaceManager nsManager)
Constructs an instance of the component, that will be used to create an attribute. |
static NameListItemChooser<AttributeRule> |
createAttributeEditor(Composite parent,
Attr attr,
AttributeRule rule,
XMLAccess xmlAccess,
NamespaceManager nsManager)
Constructs an instance of the component, that will be using for edit an attribute value. |
Composite |
getComposite()
Returns composite that is encapsulated in this object. |
ValidityMessages |
getMessages()
Checks if data contained in the widget are correct. |
QName |
getSelectedQName()
Returns qname of selected namelist item. |
protected QName |
getSelectedQNameFromControl()
Retrieves selected qname from the combobox. |
R |
getSelectedRule()
Returns rule for selected item. |
protected R |
getSelectedRuleFromControl()
Retrieves rule for selected item from the combobox. |
String |
getSelectedValue()
Contains value of the attribute. |
NameListItemChooser.State<R> |
getState()
Returns the state of this widget. |
Class<?> |
getStateClass()
Returns the class of the state that the widget accepts. |
protected void |
refreshControls()
Refreshes the controls that the form shows. |
void |
setState(Object model)
Sets new state for the widget. |
protected void |
update()
Recreates the namelists and updates combobox. |
Methods inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget |
---|
addMessageListener, addModifyListener, allowModifyEvent, fireDataModified, removeMessageListener, removeModifyListener, suppressModifyEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Composite composite
protected final XMLAccess xmlAccess
public final NamespaceManager nsManager
public final DisplayableNameList<R extends BaseRule> dnl
protected final Combo cmbAttrName
protected final Text prefix
protected final Label lNamespace
protected final Label lNamespaceDescription
protected final Text textValue
null
if namelist contain element names.
protected final Label lValueType
null
if
namelist contain element names.
protected QName _selectedQName
protected String _selectedValue
protected R extends BaseRule _selectedRule
protected ValidityMessages lastMessages
Constructor Detail |
---|
public NameListItemChooser(Composite parent, XMLAccess xmlAccess, DisplayableNameList<R> dnl, String text, NamespaceManager nsManager)
parent
- here a composite with components will be placed.xmlAccess
- the document instance.dnl
- Allow to select item from this namelist.text
- this text will be displayed above all controls.nsManager
- namespace manager. If null
then the one
from xmlAccess
will be used.Method Detail |
---|
public static NameListItemChooser<AttributeRule> createAttributeCreator(Composite parent, INameList<AttributeRule> nameList, XMLAccess xmlAccess, NamespaceManager nsManager)
parent
- here a composite with components will be placed.nameList
- list of attributes that can be created.xmlAccess
- the XMLAccess
instance.nsManager
- the namespace manager. If null
then the
one from xmlAccess
will be used.
public static NameListItemChooser<AttributeRule> createAttributeEditor(Composite parent, Attr attr, AttributeRule rule, XMLAccess xmlAccess, NamespaceManager nsManager)
parent
- here a composite with components will be placed.attr
- the attribute. The window will not change the attribute value
itself.rule
- the rule for the attribute.xmlAccess
- the XMLAccess
instance.nsManager
- namespace manager. If null
then the one
from xmlAccess
will be used.
public Composite getComposite()
IUserInputWidget
protected void refreshControls()
protected void update()
public QName getSelectedQName()
null
if no item
is selected.protected QName getSelectedQNameFromControl()
null
if no item
is selected.public final String getSelectedValue()
null
if namelist contains element
names.public R getSelectedRule()
protected R getSelectedRuleFromControl()
null
if no item is selected.public void checkErrors()
public ValidityMessages getMessages()
IUserInputWidget
null
if data is correct, or instance of
ValidityMessages
if there is error, warning or info
message.public NameListItemChooser.State<R> getState()
IUserInputWidget
public Class<?> getStateClass()
IUserInputWidget
null
.public void setState(Object model)
IUserInputWidget
model
- the model to set. You may use the construct
setModel(getModel())
to reflect changes made in the model.
Please note that nearly all widgets rejects null
value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |