Ignore:
Timestamp:
2011-08-27T13:57:45+02:00 (15 years ago)
Author:
stoecker
Message:

see #6731 - introduce better layout function for ToggleDialogs, changed author and relation dialog

File:
1 edited

Legend:

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

    r4078 r4353  
    1515import java.text.NumberFormat;
    1616import java.util.ArrayList;
     17import java.util.Arrays;
    1718import java.util.Collection;
    1819import java.util.Collections;
     
    2930import javax.swing.JLabel;
    3031import javax.swing.JOptionPane;
    31 import javax.swing.JPanel;
    32 import javax.swing.JScrollPane;
    3332import javax.swing.JTable;
    3433import javax.swing.ListSelectionModel;
     
    8786    }
    8887
    89     protected JPanel buildButtonRow() {
    90         JPanel pnl = getButtonPanel(2);
    91 
    92         // -- select users primitives action
    93         //
    94         selectionUsersPrimitivesAction = new SelectUsersPrimitivesAction();
    95         userTable.getSelectionModel().addListSelectionListener(selectionUsersPrimitivesAction);
    96         pnl.add(new SideButton(selectionUsersPrimitivesAction));
    97 
    98         // -- info action
    99         //
    100         showUserInfoAction = new ShowUserInfoAction();
    101         userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
    102         pnl.add(new SideButton(showUserInfoAction));
    103 
    104         // -- load relicensing info action
    105         loadRelicensingInformationAction = new LoadRelicensingInformationAction();
    106         pnl.add(new SideButton(loadRelicensingInformationAction));
    107         return pnl;
    108     }
    109 
    11088    protected void build() {
    111         JPanel pnl = new JPanel();
    112         pnl.setLayout(new BorderLayout());
    11389        model = new UserTableModel();
    11490        userTable = new JTable(model);
    11591        userTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
     92        userTable.addMouseListener(new DoubleClickAdapter());
    11693        TableColumnModel columnModel = userTable.getColumnModel();
    11794        columnModel.getColumn(3).setPreferredWidth(20);
     
    125102            };
    126103        });
    127         pnl.add(new JScrollPane(userTable), BorderLayout.CENTER);
    128 
    129         // -- the button row
    130         pnl.add(buildButtonRow(), BorderLayout.SOUTH);
    131         userTable.addMouseListener(new DoubleClickAdapter());
    132         add(pnl, BorderLayout.CENTER);
     104
     105        // -- select users primitives action
     106        //
     107        selectionUsersPrimitivesAction = new SelectUsersPrimitivesAction();
     108        userTable.getSelectionModel().addListSelectionListener(selectionUsersPrimitivesAction);
     109
     110        // -- info action
     111        //
     112        showUserInfoAction = new ShowUserInfoAction();
     113        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
     114
     115        // -- load relicensing info action
     116        loadRelicensingInformationAction = new LoadRelicensingInformationAction();
     117
     118        createLayout(userTable, true, Arrays.asList(new SideButton[] {
     119            new SideButton(selectionUsersPrimitivesAction),
     120            new SideButton(showUserInfoAction),
     121            new SideButton(loadRelicensingInformationAction)
     122        }));
    133123    }
    134124
Note: See TracChangeset for help on using the changeset viewer.