Changeset 2219 in josm for trunk/src/org


Ignore:
Timestamp:
2009-09-30T16:49:46+02:00 (15 years ago)
Author:
Gubaer
Message:

toward fixing #3624: OpenStreetBugs plugin fails to load in trunk with java.lang.NoClassDefFoundError

Location:
trunk/src/org/openstreetmap/josm/gui/widgets
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java

    r2218 r2219  
    3939    private int maxSize = 10;
    4040
     41    private List<HistoryChangedListener> listeners = new ArrayList<HistoryChangedListener>();
     42
    4143    public ComboBoxHistory(int size) {
    4244        maxSize = size;
     
    6971        // set selected item to the one just added
    7072        setSelectedItem(o);
     73
     74        fireHistoryChanged();
    7175    }
    7276
     
    110114        return list;
    111115    }
     116
     117    public void addHistoryChangedListener(HistoryChangedListener l) {
     118        listeners.add(l);
     119    }
     120
     121    public void removeHistoryChangedListener(HistoryChangedListener l) {
     122        listeners.remove(l);
     123    }
     124
     125    private void fireHistoryChanged() {
     126        for (HistoryChangedListener l : listeners) {
     127            l.historyChanged(asList());
     128        }
     129    }
    112130}
Note: See TracChangeset for help on using the changeset viewer.