Ignore:
Timestamp:
2012-01-15T11:56:33+01:00 (13 years ago)
Author:
stoecker
Message:

use createLayout function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java

    r26509 r27464  
    99import java.awt.event.ItemListener;
    1010import java.awt.event.MouseEvent;
     11import java.util.Arrays;
    1112import java.util.Collection;
    1213import java.util.HashSet;
     
    9495
    9596    /**
    96      * Builds the panel with the checkbox for switching between the two
    97      * list views
    98      *
    99      * @return the panel
    100      */
    101     protected JPanel buildInSelectionOnlyTogglePanel(){
     97     * Builds the UI
     98     */
     99    protected void build() {
    102100        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    103101        pnl.setBorder(null);
     
    106104           "<html>Select to display turn restrictions related to object in the current selection only.<br>"
    107105         + "Deselect to display all turn restrictions in the current data set.</html>"));
    108         return pnl;
    109     }
    110    
    111     /**
    112      * Builds the panel with the action buttons
    113      *
    114      * @return the panel
    115      */
    116     protected JPanel buildCommandPanel() {
    117         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    118         pnl.setBorder(null);
    119         pnl.add(new SideButton(actNew = new NewAction(), false /* don't show the name */));
    120         pnl.add(new SideButton(actEdit = new EditAction(), false /* don't show the name */));
    121         pnl.add(new SideButton(actDelete = new DeleteAction(), false /* don't show the name */));
    122        
     106
     107        pnlContent = new JPanel(new BorderLayout(0,0));
     108        pnlContent.setBorder(null);
     109        pnlContent.add(pnl,  BorderLayout.NORTH);
     110
     111        actNew = new NewAction();
     112        actEdit = new EditAction();
     113        actDelete = new DeleteAction();
    123114        actSelectSelectedTurnRestrictions = new SelectSelectedTurnRestrictions();
    124115        actZoomTo = new ZoomToAction();
    125         return pnl;
    126     }
    127    
    128     /**
    129      * Builds the UI
    130      */
    131     protected void build() {
    132         pnlContent = new JPanel(new BorderLayout(0,0));
    133         pnlContent.setBorder(null);
    134         pnlContent.add(buildInSelectionOnlyTogglePanel(),  BorderLayout.NORTH);
    135         pnlContent.add(buildCommandPanel(), BorderLayout.SOUTH);
    136        
    137         add(pnlContent, BorderLayout.CENTER);
     116
     117        createLayout(pnlContent, false, Arrays.asList(new SideButton[] {
     118            new SideButton(actNew, false /* don't show the name */),
     119            new SideButton(actEdit, false /* don't show the name */),
     120            new SideButton(actDelete, false /* don't show the name */)
     121        }));
    138122       
    139123        // create the two list views
Note: See TracChangeset for help on using the changeset viewer.