Changeset 17650 in josm for trunk/src/org


Ignore:
Timestamp:
2021-03-23T23:31:54+01:00 (4 years ago)
Author:
simon04
Message:

Extract IconTextCheckBox widget

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java

    r17609 r17650  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import java.awt.GridBagLayout;
    5 import java.awt.event.MouseAdapter;
    6 import java.awt.event.MouseEvent;
    74import java.util.ArrayList;
    85import java.util.Arrays;
     
    107import java.util.List;
    118
    12 import javax.swing.JLabel;
    139import javax.swing.JPanel;
    1410
     
    1713import org.openstreetmap.josm.data.osm.Tag;
    1814import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
     15import org.openstreetmap.josm.gui.widgets.IconTextCheckBox;
    1916import org.openstreetmap.josm.gui.widgets.QuadStateCheckBox;
    2017import org.openstreetmap.josm.tools.GBC;
     
    8885
    8986        if (icon != null) {
    90             JPanel checkPanel = new JPanel(new GridBagLayout());
    91             checkPanel.add(check, GBC.std());
    92             JLabel label = new JLabel(locale_text);
    93             addIcon(label);
    94             label.addMouseListener(new MouseAdapter() {
    95                 @Override
    96                 public void mousePressed(MouseEvent e) {
    97                     check.getMouseAdapter().mousePressed(e);
    98                 }
    99             });
    100             checkPanel.add(label);
    101             checkPanel.add(new JLabel(), GBC.eol().fill());
     87            JPanel checkPanel = IconTextCheckBox.wrap(check, locale_text, getIcon());
    10288            p.add(checkPanel, GBC.eol()); // Do not fill, see #15104
    10389        } else {
Note: See TracChangeset for help on using the changeset viewer.