Changeset 10122 in josm for trunk/src/org


Ignore:
Timestamp:
2016-04-08T22:13:47+02:00 (8 years ago)
Author:
Don-vip
Message:

add more debug messages to debug failing unit test

File:
1 edited

Legend:

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

    r10035 r10122  
    2727import javax.swing.event.ChangeListener;
    2828
     29import org.openstreetmap.josm.Main;
    2930import org.openstreetmap.josm.gui.help.HelpBrowser;
    3031import org.openstreetmap.josm.gui.help.HelpUtil;
     
    229230        }
    230231
    231         if (msg instanceof String) {
    232             msg = new JMultilineLabel((String) msg, true);
    233         }
    234 
    235232        final JOptionPane pane = new JOptionPane(
    236                 msg,
     233                msg instanceof String ? new JMultilineLabel((String) msg, true) : msg,
    237234                messageType,
    238235                JOptionPane.DEFAULT_OPTION,
     
    241238                defaultButton
    242239        );
     240
     241        // Log message. Useful for bug reports and unit tests
     242        switch (messageType) {
     243            case JOptionPane.ERROR_MESSAGE:
     244                Main.error(title + " - " + msg);
     245                break;
     246            case JOptionPane.WARNING_MESSAGE:
     247                Main.warn(title + " - " + msg);
     248                break;
     249            default:
     250                Main.info(title + " - " + msg);
     251        }
    243252
    244253        if (!GraphicsEnvironment.isHeadless()) {
Note: See TracChangeset for help on using the changeset viewer.