org.itsnat.comp.list
Interface ItsNatListMultSel

All Superinterfaces:
ItsNatComponent, ItsNatElementComponent, ItsNatList, ItsNatUserData
All Known Subinterfaces:
ItsNatFreeListMultSel, ItsNatHTMLSelectMult

public interface ItsNatListMultSel
extends ItsNatList

Is the base interface of multiple selection lists.

This component family uses a javax.swing.ListSelectionModel to keep track of selection states. When a list item is selected (usually by clicking it) the selection state is updated accordingly using the selection model (this one fires any listener registered).

By default this component type uses a javax.swing.DefaultListModel data model.

Author:
Jose Maria Arranz Santamaria

Method Summary
 javax.swing.ListSelectionModel getListSelectionModel()
          Returns the current selection model.
 int[] getSelectedIndices()
          Returns an array with indices of the current selected elements.
 void setListData(java.util.List listData)
          Constructs a javax.swing.ListModel from a java.util.List and then applies ItsNatList.setListModel(javax.swing.ListModel) to it.
 void setListData(java.lang.Object[] listData)
          Constructs a javax.swing.ListModel from an array of objects and then applies ItsNatList.setListModel(javax.swing.ListModel) to it.
 void setListSelectionModel(javax.swing.ListSelectionModel selectionModel)
          Sets the new selection model.
 void setSelectedIndices(int[] indices)
          Sets the current selected elements.
 
Methods inherited from interface org.itsnat.comp.list.ItsNatList
createDefaultListModel, getEditingIndex, getEditorActivatorEvent, getItsNatListCellEditor, getItsNatListCellRenderer, getItsNatListStructure, getItsNatListUI, getListModel, getSelectedIndex, indexOf, isEditing, isEditingEnabled, setEditingEnabled, setEditorActivatorEvent, setItsNatListCellEditor, setItsNatListCellRenderer, setListModel, setSelectedIndex, startEditingAt
 
Methods inherited from interface org.itsnat.comp.ItsNatElementComponent
getElement, getItsNatElementComponentUI
 
Methods inherited from interface org.itsnat.comp.ItsNatComponent
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
 
Methods inherited from interface org.itsnat.core.ItsNatUserData
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
 

Method Detail

setListData

void setListData(java.lang.Object[] listData)
Constructs a javax.swing.ListModel from an array of objects and then applies ItsNatList.setListModel(javax.swing.ListModel) to it.

Submitted array must not change, because no changes are detected.

Parameters:
listData - an array of Objects containing the items of the new list model
See Also:
setListData(java.util.List)

setListData

void setListData(java.util.List listData)
Constructs a javax.swing.ListModel from a java.util.List and then applies ItsNatList.setListModel(javax.swing.ListModel) to it.

Submitted list must not change, because no changes are detected.

Parameters:
listData - a java.util.List containing the items of the new list model
See Also:
setListData(Object[])

getListSelectionModel

javax.swing.ListSelectionModel getListSelectionModel()
Returns the current selection model.

Returns:
the current selection model. By default a javax.swing.DefaultListSelectionModel instance.
See Also:
setListSelectionModel(javax.swing.ListSelectionModel)

setListSelectionModel

void setListSelectionModel(javax.swing.ListSelectionModel selectionModel)
Sets the new selection model.

If the new selection model is the current defined then is "reset", component listener is removed and added again. Use this technique if you want to add a listener to be executed before the default component listener.

Parameters:
selectionModel - the new selection model.
See Also:
getListSelectionModel()

getSelectedIndices

int[] getSelectedIndices()
Returns an array with indices of the current selected elements.

Returns:
an array with the current selected elements.
See Also:
setSelectedIndices(int[])

setSelectedIndices

void setSelectedIndices(int[] indices)
Sets the current selected elements.

Parameters:
indices - index array of the new selected elements.
See Also:
getSelectedIndices()


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.