Example usage for javax.swing JDialog toString

List of usage examples for javax.swing JDialog toString

Introduction

In this page you can find the example usage for javax.swing JDialog toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of this component and its values.

Usage

From source file:shuffle.fwk.ShuffleController.java

@Override
public void reportBug(final String givenMessage) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override/* ww w .j av a 2  s . c o m*/
        public void run() {
            StringBuilder sb = new StringBuilder();
            sb.append("MESSAGE READS:\r\n");
            sb.append(givenMessage);
            sb.append("\r\nEND OF MESSAGE");
            sb.append("\r\n\r\n");
            sb.append("Selected result:");
            SimulationResult curResult = getModel().getCurrentResult();
            if (curResult == null) {
                sb.append(" No result selected.");
            } else {
                sb.append("\r\n");
                sb.append(curResult.toString());
            }
            sb.append("\r\n\r\n");
            sb.append("Current results:");
            Collection<SimulationResult> results = getModel().getResults();
            if (results == null) {
                sb.append("No results.");
            } else {
                for (SimulationResult result : results) {
                    if (result != null) {
                        sb.append("\r\n");
                        sb.append(result.toString());
                    }
                }
            }
            sb.append("\r\n\r\n");
            sb.append("Current running windows:");
            List<String> info = new ArrayList<String>();
            info.add(getFrame().toString());
            Collection<JDialog> serviceDialogs = BaseServiceManager.getAllDialogs();
            for (JDialog d : serviceDialogs) {
                info.add(d.toString());
            }
            for (String s : info) {
                sb.append("\r\n\r\n");
                sb.append(s);
            }
            getModel().saveAllData();
            getModel().reportBug(sb.toString());
        }
    });
}