Changeset 3561 in josm


Ignore:
Timestamp:
2010-09-24T18:48:14+02:00 (14 years ago)
Author:
bastiK
Message:

applied #5502 (patch by cmuelle8) - Relations editor: order of buttons

File:
1 edited

Legend:

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

    r3518 r3561  
    6767import org.openstreetmap.josm.gui.DefaultNameFormatter;
    6868import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     69import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    6970import org.openstreetmap.josm.gui.SideButton;
    70 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    7171import org.openstreetmap.josm.gui.dialogs.properties.PresetListPanel.PresetHandler;
    7272import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
     
    537537        tb.setFloatable(false);
    538538
     539        // -- add at start action
     540        AddSelectedAtStartAction addSelectionAction = new AddSelectedAtStartAction();
     541        selectionTableModel.addTableModelListener(addSelectionAction);
     542        tb.add(addSelectionAction);
     543
     544        // -- add before selected action
     545        AddSelectedBeforeSelection addSelectedBeforeSelectionAction = new AddSelectedBeforeSelection();
     546        selectionTableModel.addTableModelListener(addSelectedBeforeSelectionAction);
     547        memberTableModel.getSelectionModel().addListSelectionListener(addSelectedBeforeSelectionAction);
     548        tb.add(addSelectedBeforeSelectionAction);
     549
     550        // -- add after selected action
     551        AddSelectedAfterSelection addSelectedAfterSelectionAction = new AddSelectedAfterSelection();
     552        selectionTableModel.addTableModelListener(addSelectedAfterSelectionAction);
     553        memberTableModel.getSelectionModel().addListSelectionListener(addSelectedAfterSelectionAction);
     554        tb.add(addSelectedAfterSelectionAction);
     555
    539556        // -- add at end action
    540557        AddSelectedAtEndAction addSelectedAtEndAction = new AddSelectedAtEndAction();
    541558        selectionTableModel.addTableModelListener(addSelectedAtEndAction);
    542559        tb.add(addSelectedAtEndAction);
     560
     561        tb.addSeparator();
    543562
    544563        // -- select members action
     
    548567        tb.add(selectMembersForSelectionAction);
    549568
     569        // -- select action
     570        SelectPrimitivesForSelectedMembersAction selectAction = new SelectPrimitivesForSelectedMembersAction();
     571        memberTable.getSelectionModel().addListSelectionListener(selectAction);
     572        tb.add(selectAction);
     573
    550574        tb.addSeparator();
    551575
     
    554578        selectionTableModel.addTableModelListener(removeSelectedAction);
    555579        tb.add(removeSelectedAction);
    556 
    557         // -- select action
    558         SelectPrimitivesForSelectedMembersAction selectAction = new SelectPrimitivesForSelectedMembersAction();
    559         memberTable.getSelectionModel().addListSelectionListener(selectAction);
    560         tb.add(selectAction);
    561 
    562         tb.addSeparator();
    563 
    564         // -- add at start action
    565         AddSelectedAtStartAction addSelectionAction = new AddSelectedAtStartAction();
    566         selectionTableModel.addTableModelListener(addSelectionAction);
    567         tb.add(addSelectionAction);
    568 
    569         // -- add before selected action
    570         AddSelectedBeforeSelection addSelectedBeforeSelectionAction = new AddSelectedBeforeSelection();
    571         selectionTableModel.addTableModelListener(addSelectedBeforeSelectionAction);
    572         memberTableModel.getSelectionModel().addListSelectionListener(addSelectedBeforeSelectionAction);
    573         tb.add(addSelectedBeforeSelectionAction);
    574 
    575         // -- add after selected action
    576         AddSelectedAfterSelection addSelectedAfterSelectionAction = new AddSelectedAfterSelection();
    577         selectionTableModel.addTableModelListener(addSelectedAfterSelectionAction);
    578         memberTableModel.getSelectionModel().addListSelectionListener(addSelectedAfterSelectionAction);
    579         tb.add(addSelectedAfterSelectionAction);
    580580
    581581        return tb;
     
    735735
    736736        protected void refreshEnabled() {
    737             setEnabled(selectionTableModel.getRowCount() > 0 && memberTableModel.getRowCount() > 0);
     737            setEnabled(selectionTableModel.getRowCount() > 0);
    738738        }
    739739
Note: See TracChangeset for help on using the changeset viewer.