Changeset 2581 in josm


Ignore:
Timestamp:
2009-12-06T12:57:06+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed #4109: Sorting button in relation editor is disabled
fixed #4097: Sort button in Relation Dialog is always disabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r2578 r2581  
    450450        // -- sort action
    451451        SortAction sortAction = new SortAction();
     452        memberTableModel.addTableModelListener(sortAction);
    452453        tb.add(sortAction);
    453454
     
    866867    }
    867868
    868     class SortAction extends AbstractAction implements ListSelectionListener {
     869    class SortAction extends AbstractAction implements TableModelListener {
    869870        public SortAction() {
    870871            putValue(SHORT_DESCRIPTION, tr("Sort the relation members"));
     
    881882
    882883        protected void updateEnabledState() {
    883             setEnabled(memberTable.getSelectedRowCount() > 0);
    884         }
    885 
    886         public void valueChanged(ListSelectionEvent e) {
     884            setEnabled(memberTableModel.getRowCount() > 0);
     885        }
     886
     887        public void tableChanged(TableModelEvent e) {
    887888            updateEnabledState();
    888889        }
Note: See TracChangeset for help on using the changeset viewer.