Class HistoryComboBoxModel
- java.lang.Object
-
- javax.swing.AbstractListModel<E>
-
- org.openstreetmap.josm.gui.widgets.JosmComboBoxModel<E>
-
- org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel<java.lang.String>
-
- org.openstreetmap.josm.gui.widgets.HistoryComboBoxModel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<java.lang.String>
,javax.swing.ComboBoxModel<java.lang.String>
,javax.swing.ListModel<java.lang.String>
,javax.swing.MutableComboBoxModel<java.lang.String>
public class HistoryComboBoxModel extends AutoCompComboBoxModel<java.lang.String>
A data model for theHistoryComboBox
.This model is an
AutoCompComboBoxModel
specialized inString
s. It offers convenience functions to serialize to and from the JOSM preferences.- Since:
- 18173
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.widgets.JosmComboBoxModel
JosmComboBoxModel.Preferences
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.gui.widgets.JosmComboBoxModel
elements, selected
-
-
Constructor Summary
Constructors Constructor Description HistoryComboBoxModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllStrings(java.util.List<java.lang.String> strings)
Adds strings to the model.java.util.List<java.lang.String>
asStringList()
Gets all items in the history as a list of strings.JosmComboBoxModel.Preferences
prefs()
Gets a preference loader and saver for this model.-
Methods inherited from class org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel
findBestCandidate, setComparator
-
Methods inherited from class org.openstreetmap.josm.gui.widgets.JosmComboBoxModel
addAllElements, addAllElements, addElement, addTopElement, asCollection, doAddElement, find, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, iterator, prefs, removeAllElements, removeElement, removeElementAt, setSelectedItem, setSize
-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
-
-
-
Constructor Detail
-
HistoryComboBoxModel
HistoryComboBoxModel()
-
-
Method Detail
-
addAllStrings
public void addAllStrings(java.util.List<java.lang.String> strings)
Adds strings to the model.Strings are added only until the max. history size is reached.
- Parameters:
strings
- the strings to add
-
asStringList
public java.util.List<java.lang.String> asStringList()
Gets all items in the history as a list of strings.- Returns:
- the items in the history
-
prefs
public JosmComboBoxModel.Preferences prefs()
Gets a preference loader and saver for this model.- Returns:
- the instance
-
-