public interface ItsNatList extends ItsNatElementComponent
A generic list component manages a javax.swing.ListModel
data list, item values are rendered as markup using a special object, the renderer,
and may be optionally edited "in place" using a user defined editor.
Any change to the data model is notified to the component and the markup is rendered again. The data model ever mandates over the markup, any initial markup content (initial child elements) is removed.
This component family is the "componentized" version of ElementList
and
follows a similar philosophy.
Modifier and Type | Method and Description |
---|---|
javax.swing.ListModel |
createDefaultListModel()
Creates a data model instance appropriated to this component.
|
int |
getEditingIndex()
Returns the index of the list item being edited.
|
java.lang.String |
getEditorActivatorEvent()
Returns the event type used to activate the list item edition process by the user.
|
ItsNatListCellEditor |
getItsNatListCellEditor()
Returns the current list item editor.
|
ItsNatListCellRenderer |
getItsNatListCellRenderer()
Returns the current component renderer.
|
ItsNatListStructure |
getItsNatListStructure()
Returns the component structure.
|
ItsNatListUI |
getItsNatListUI()
Returns the user interface manager of this component.
|
javax.swing.ListModel |
getListModel()
Returns the current data model of this component.
|
int |
getSelectedIndex()
Returns the index of the first selected list item.
|
int |
indexOf(java.lang.Object obj)
Returns the zero based position in the list of the specified value.
|
boolean |
isEditing()
Informs whether a list item value is being edited.
|
boolean |
isEditingEnabled()
Informs whether the in place edition is enabled.
|
void |
setEditingEnabled(boolean value)
Enables or disables temporally the in place edition.
|
void |
setEditorActivatorEvent(java.lang.String eventType)
Sets the event type used to activate the list item edition process by the user.
|
void |
setItsNatListCellEditor(ItsNatListCellEditor editor)
Sets the list item editor.
|
void |
setItsNatListCellRenderer(ItsNatListCellRenderer renderer)
Sets the component renderer.
|
void |
setListModel(javax.swing.ListModel dataModel)
Changes the data model of this component.
|
void |
setSelectedIndex(int index)
Selects the specified list item.
|
void |
startEditingAt(int index)
Used to start programmatically a list item edition process "in place".
|
getElement, getItsNatElementComponentUI
addEventListener, addEventListener, addEventListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, disableEventListener, disableEventListener, dispose, enableEventListener, enableEventListener, getArtifact, getArtifact, getItsNatComponentManager, getItsNatComponentUI, getItsNatDocument, getNode, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, isDisposed, isEnabled, registerArtifact, removeArtifact, removeEventListener, removeEventListener, removeEventListener, removeEventListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setEnabled, setEventListenerParams, setEventListenerParams, setNode
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
ItsNatListUI getItsNatListUI()
javax.swing.ListModel getListModel()
setListModel(javax.swing.ListModel)
void setListModel(javax.swing.ListModel dataModel)
Current data model is disconnected from this component, and the new data model is bound to this component, every change is tracked and updates the user interfaces accordingly.
If the specified data model is the same instance as the current data model, then is reset, component listener is removed and added again. Use this technique if you want to add a data model listener to be executed before the default component listener.
dataModel
- the new data model.getListModel()
javax.swing.ListModel createDefaultListModel()
int getSelectedIndex()
void setSelectedIndex(int index)
index
- the index of the item to selectint indexOf(java.lang.Object obj)
obj
- the object value to search.ItsNatListStructure getItsNatListStructure()
ItsNatListCellRenderer getItsNatListCellRenderer()
ItsNatComponentManager.createDefaultItsNatListCellRenderer()
)setItsNatListCellRenderer(ItsNatListCellRenderer)
void setItsNatListCellRenderer(ItsNatListCellRenderer renderer)
renderer
- the new renderer.getItsNatListCellRenderer()
ItsNatListCellEditor getItsNatListCellEditor()
ItsNatComponentManager.createDefaultItsNatListCellEditor(ItsNatComponent)
) with a null parameter.setItsNatListCellEditor(ItsNatListCellEditor)
void setItsNatListCellEditor(ItsNatListCellEditor editor)
List item edition works very much the same as label edition
(see ItsNatLabel.setItsNatLabelEditor(ItsNatLabelEditor)
).
Some differences:
The edition process starts programmatically by calling startEditingAt(int)
.
The edition takes place inside the list item content element
as returned by ItsNatListStructure.getContentElement(ItsNatList,int,org.w3c.dom.Element)
.
The new item value is set to the data model
calling javax.swing.DefaultListModel.setElementAt(Object,int)
,
if the data model is not DefaultListModel
is the programmer responsibility
to set the new value to the data model (detecting when the editor stops editing,
see javax.swing.CellEditor.addCellEditorListener(javax.swing.event.CellEditorListener)
).
editor
- the new editor. May be null (edition disabled).getItsNatListCellEditor()
void startEditingAt(int index)
isEditing()
boolean isEditing()
startEditingAt(int)
int getEditingIndex()
java.lang.String getEditorActivatorEvent()
If returns null edition activated by events is disabled .
setEditorActivatorEvent(String)
void setEditorActivatorEvent(java.lang.String eventType)
eventType
- the event type used to activate the edition.getEditorActivatorEvent()
boolean isEditingEnabled()
setEditingEnabled(boolean)
void setEditingEnabled(boolean value)
value
- true to enable in place edition.isEditingEnabled()
Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.