Changeset 11283 in josm for trunk/src/org


Ignore:
Timestamp:
2016-11-18T22:42:23+01:00 (3 years ago)
Author:
michael2402
Message:

See #13976: Add progress monitor information to the bug report

File:
1 edited

Legend:

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

    r11100 r11283  
    1616import org.openstreetmap.josm.gui.PleaseWaitDialog;
    1717import org.openstreetmap.josm.gui.util.GuiHelper;
     18import org.openstreetmap.josm.tools.bugreport.BugReport;
    1819
    1920public class PleaseWaitProgressMonitor extends AbstractProgressMonitor {
     
    5253    private boolean cancelable;
    5354
    54     private static void doInEDT(Runnable runnable) {
     55    private void doInEDT(Runnable runnable) {
    5556        // This must be invoke later even if current thread is EDT because inside there is dialog.setVisible
    5657        // which freeze current code flow until modal dialog is closed
    57         SwingUtilities.invokeLater(runnable);
     58        SwingUtilities.invokeLater(() -> {
     59            try {
     60                runnable.run();
     61            } catch (RuntimeException e) {
     62                throw BugReport.intercept(e).put("monitor", this);
     63            }
     64        });
    5865    }
    5966
     
    172179            if (dialogParent != null && dialog == null) {
    173180                dialog = new PleaseWaitDialog(dialogParent);
    174             } else
     181            } else {
    175182                throw new ProgressException("PleaseWaitDialog parent must be set");
     183            }
    176184
    177185            if (windowTitle != null) {
     
    326334            return parent;
    327335    }
     336
     337    @Override
     338    public String toString() {
     339        return "PleaseWaitProgressMonitor [currentProgressValue=" + currentProgressValue + ", customText=" + customText
     340                + ", title=" + title + ", indeterminate=" + indeterminate + ", isInBackground=" + isInBackground
     341                + ", windowTitle=" + windowTitle + ", taskId=" + taskId + ", cancelable=" + cancelable + ", state="
     342                + state + "]";
     343    }
    328344}
Note: See TracChangeset for help on using the changeset viewer.