|
||||||||||
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.InsertListChooser
public class InsertListChooser
Allows the user to choose between multiple insertlists, and to choose the name of each element. These user settings are returned. Alternatively, user may choose to enter some text if it is permitted by the rule.
Nested Class Summary | |
---|---|
protected class |
InsertListChooser.ComboSelected
Event handler for each combobox. |
protected class |
InsertListChooser.IlItemData
Contains information on insertlist's comboboxes. |
class |
InsertListChooser.State
The state of the chooser. |
Field Summary | |
---|---|
protected int |
_selected
Stores the index of the insertlist radio button, that is checked (selected). |
protected String |
_text
Stores the text value that new element may contain. |
protected Composite |
composite
Here all controls will be placed. |
protected List<List<InsertListChooser.IlItemData>> |
ilControls
Controls (comboboxes) containing chosen qnames for each insertlist. |
protected List<InsertList> |
insertLists
Insertlists. |
protected ValidityMessages |
lastMessages
Last messages. |
protected NamespaceManager |
nsManager
Current namespace manager. |
protected List<Button> |
radioButtons
List of radio buttons. |
protected Button |
radioText
This controls is valid (non- null ) when the user can
enter some text as an alternative to the insertlists. |
protected IValueRule |
textRule
User may choose to enter text contents of an element instead. |
protected Text |
textText
This control is valid (non- null ) when the user can enter
some text as an alternative to the insertlists. |
protected XMLAccess |
xmlAccess
The XML Access instance. |
Fields inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget |
---|
listeners, msgListeners |
Constructor Summary | |
---|---|
InsertListChooser(Composite parent,
XMLAccess xmlAccess,
List<InsertList> insertLists,
NamespaceManager nsManager,
String parentName,
IValueRule textRule)
Creates an instance of the window. |
Method Summary | |
---|---|
Set<String> |
getAllNamespaces()
Retrieves all namespaces of currently selected attributes. |
Composite |
getComposite()
Returns composite that is encapsulated in this object. |
InsertList |
getInsertList()
Returns selected insertlist as a list of qnames. |
List<QName> |
getInsertListNames()
Returns selected insertlist as a list of qnames. |
ValidityMessages |
getMessages()
Checks if data contained in the widget are correct. |
int |
getSelected()
Returns the index of the insert list, that is checked (selected). |
protected int |
getSelectedFromControl()
Returns the index of the radio button, that is checked (selected). |
protected int |
getSelectedInternal()
Returns the index of the radio button, that is checked (selected). |
Object |
getState()
Returns the state of this widget. |
Class<?> |
getStateClass()
Returns the class of the state that the widget accepts. |
String |
getText()
Returns new textual value of element. |
void |
setState(Object state)
Sets new state for the widget. |
protected void |
updateMessages()
Updates error messages. |
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
protected final List<InsertList> insertLists
protected final IValueRule textRule
protected final NamespaceManager nsManager
protected final List<List<InsertListChooser.IlItemData>> ilControls
IlItemData
instances, one instance
depicts one ElementLoc
.
protected final List<Button> radioButtons
protected final Text textText
null
) when the user can enter
some text as an alternative to the insertlists.
protected final Button radioText
null
) when the user can
enter some text as an alternative to the insertlists.
protected int _selected
protected String _text
textText
is disposed.
protected ValidityMessages lastMessages
Constructor Detail |
---|
public InsertListChooser(Composite parent, XMLAccess xmlAccess, List<InsertList> insertLists, NamespaceManager nsManager, String parentName, IValueRule textRule)
parent
- where to place controls.xmlAccess
- the XML Access instance.insertLists
- the list of choosable insertlists.nsManager
- the map of namespace>prefix mapping. It will not get
modified. If null
then manager from xmlAccess
will be used.parentName
- the displayable qname of the parent. It is only
displayed in a window as a text - it is not used in other way.textRule
- if not null
then it is possible to choose
a text value also. This value must comply this rule.Method Detail |
---|
protected int getSelectedFromControl()
protected int getSelectedInternal()
public int getSelected()
public String getText()
null
.public List<QName> getInsertListNames()
getInsertList()
.
null
. May contain
null
s if appropriate qnames were not selected.
IllegalStateException
- if insertlist is not selected.public InsertList getInsertList()
null
.
IllegalStateException
- if insertlist is not selected.public Composite getComposite()
IUserInputWidget
public ValidityMessages getMessages()
IUserInputWidget
null
if data is correct, or instance of
ValidityMessages
if there is error, warning or info
message.protected void updateMessages()
public Set<String> getAllNamespaces()
public Object getState()
IUserInputWidget
public Class<?> getStateClass()
IUserInputWidget
null
.public void setState(Object state)
IUserInputWidget
state
- 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 |