|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel javax.swing.DefaultComboBoxModel biz.chitec.quarterback.swing.LocaleComboBoxModel
Special model to allow selection of a locale All installed locales are shown for selection. It is possible to have a special entry "not selected", which is selected if an empty locale is set (null or empty string).
In this model, locales can be handled and identified either by instances of the Locale class or by the usual Strings in underscore-notation.
Field Summary | |
private java.util.ResourceBundle |
rb
|
private boolean |
withunselected
|
Fields inherited from class javax.swing.DefaultComboBoxModel |
|
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
LocaleComboBoxModel()
Initializes the model with the list of locales without "not selected" entry |
|
LocaleComboBoxModel(boolean withunselectedx)
|
|
LocaleComboBoxModel(boolean withunselectedx,
java.util.List locales)
Initializes the model either with or without the "unselected" entry. |
Method Summary | |
java.util.Locale |
indexToLocale(int index)
Returns the locale at the given index. |
java.lang.String |
indexToLocaleID(int index)
Returns the ID of the locale at the given index. |
private void |
initEntries(java.util.List locales)
Initializes the list of locales. |
int |
localeIDToIndex(java.lang.String id)
Returns the index of the locale with the given ID. |
int |
localeToIndex(java.util.Locale locale)
Returns the index in the model of the given locale. |
Methods inherited from class javax.swing.DefaultComboBoxModel |
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, setSelectedItem |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
addListDataListener, removeListDataListener |
Field Detail |
private java.util.ResourceBundle rb
private boolean withunselected
Constructor Detail |
public LocaleComboBoxModel(boolean withunselectedx, java.util.List locales)
withunselectedx
- Flag whether the list should contain an "unselected" entry.public LocaleComboBoxModel(boolean withunselectedx)
public LocaleComboBoxModel()
Method Detail |
private void initEntries(java.util.List locales)
public int localeToIndex(java.util.Locale locale)
locale
- locale to find, null to find "unselected"
public int localeIDToIndex(java.lang.String id)
id
- ID of the locale to find.
public java.util.Locale indexToLocale(int index)
index
- Index to give locale to.
public java.lang.String indexToLocaleID(int index)
index
- Index to give locale ID to.
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |