Class HistoryComboBoxModel
- java.lang.Object
-
- javax.swing.AbstractListModel<E>
-
- org.openstreetmap.josm.gui.widgets.JosmComboBoxModel<E>
-
- org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel<String>
-
- org.openstreetmap.josm.gui.widgets.HistoryComboBoxModel
-
- All Implemented Interfaces:
Serializable
,Iterable<String>
,ComboBoxModel<String>
,ListModel<String>
,MutableComboBoxModel<String>
public class HistoryComboBoxModel extends AutoCompComboBoxModel<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
-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description HistoryComboBoxModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllStrings(List<String> strings)
Adds strings to the model.List<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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
-
-
-
Constructor Detail
-
HistoryComboBoxModel
HistoryComboBoxModel()
-
-
Method Detail
-
addAllStrings
public void addAllStrings(List<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 List<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
-
-