|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.models.MapToListModelAdapter
public class MapToListModelAdapter
The MapToListModelAdapter allows Maps that implement java.util.Map
to be used as the
model for a javax.swing.JList
. The Map must be set as the model for the adapter,
which can then used as the model for the viewer.
By default, all entries will be displayed. In order to show only the keys, you must set showKeysOnly to true.
Field Summary | |
---|---|
protected java.util.List |
delegate
Internal storage of data from Map |
protected java.util.Map |
model
Model for the adapter |
protected boolean |
showKeysOnly
Display mode for the adapter |
protected javax.swing.event.SwingPropertyChangeSupport |
spcs
Used to support property changes in the webAF customizer |
Constructor Summary | |
---|---|
MapToListModelAdapter()
Default constructor |
|
MapToListModelAdapter(int size)
Overloaded constructor that initializes the delegate to be of given size |
|
MapToListModelAdapter(java.util.Map m)
Overloaded constructor that intializes the adapter with the entire entrySet given by the Map |
|
MapToListModelAdapter(java.util.Map m,
boolean showKeysOnly)
Overloaded constructor that intializes the adapter with the data given by the Map and whether to display only the keys of the map or all entries |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
protected void |
createDelegate()
Create the delegate object |
java.lang.Object |
getElementAt(int i)
Returns the value at the specified index. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
java.util.Map |
getModel()
Returns the model of the adapter |
boolean |
getShowKeysOnly()
Returns whether only the keys of the map are displayed |
int |
getSize()
Returns the length of the list. |
void |
refresh()
Force a refresh on the adapter |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
setModel(java.util.Map model)
Sets the model of the adapter to the given Map |
void |
setShowKeysOnly(boolean showKeysOnly)
Sets the display mode of the adapter to either all entries when false or keys only when true |
Field Detail |
---|
protected java.util.List delegate
protected java.util.Map model
protected boolean showKeysOnly
protected javax.swing.event.SwingPropertyChangeSupport spcs
Constructor Detail |
---|
public MapToListModelAdapter()
public MapToListModelAdapter(int size)
size
- Initial size of the delegate representing the Mappublic MapToListModelAdapter(java.util.Map m)
m
- Map whose data will be used within the adapterpublic MapToListModelAdapter(java.util.Map m, boolean showKeysOnly)
m
- Map whose data will be used within the adaptershowKeysOnly
- display all entries when false or keys only when trueMethod Detail |
---|
public int getSize()
getSize
in interface javax.swing.ListModel
public java.lang.Object getElementAt(int i)
getElementAt
in interface javax.swing.ListModel
public void setModel(java.util.Map model)
model
- Map whose data will be used within the adapterpublic java.util.Map getModel()
public void setShowKeysOnly(boolean showKeysOnly)
public boolean getShowKeysOnly()
protected void createDelegate()
public void refresh()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface com.sas.beans.PropertyChangeSource
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface com.sas.beans.PropertyChangeSource
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |