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>
A data model for the
HistoryComboBox.
This model is an AutoCompComboBoxModel specialized in Strings. It offers
convenience functions to serialize to and from the JOSM preferences.
- Since:
- 18173
- See Also:
-
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, selectedFields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllStrings(List<String> strings) Adds strings to the model.Gets all items in the history as a list of strings.prefs()Gets a preference loader and saver for this model.Methods inherited from class org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel
findBestCandidate, setComparatorMethods 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, setSizeMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
Constructor Details
-
HistoryComboBoxModel
-
-
Method Details
-
addAllStrings
Adds strings to the model.Strings are added only until the max. history size is reached.
- Parameters:
strings- the strings to add
-
asStringList
Gets all items in the history as a list of strings.- Returns:
- the items in the history
-
prefs
Gets a preference loader and saver for this model.- Returns:
- the instance
-