76 | | * Create a class {{{org.sophie2.main.func.help.bugreport.BugReportDialogInput}}} that extends {{{DialogInput<Void>}}} and represents the bug report data: |
77 | | * {{{Throwable throwable}}} - can be null |
78 | | * {{{String log}}} - the contents of the Sophie log file |
79 | | * {{{Properties systemProperties}}} - java system properties ([http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]) |
80 | | * {{{String email}}} |
81 | | * {{{String explanation}}} - can be empty |
82 | | * {{{File attachment}}} - can be null |
| 76 | * Create a class {{{org.sophie2.main.func.help.bugreport.BugReport}}} that represents the bug report data and has the following properties: |
| 77 | * String property {{{stackTrace}}} - can be empty |
| 78 | * String property {{{log}}} - the contents of Sophie log files |
| 79 | * String property {{{systemProperties}}} - java system properties, serialized ([http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]) |
| 80 | * String property {{{email}}} |
| 81 | * String property {{{userExplanation}}} - can be empty |
| 82 | * File property {{{attachment}}} - can be null |
| 83 | * String property {{{technicalInformation}}} - auto property which contains all technical data in this report, serialized to String. Includes everything that is automatically collected - stack trace, log files, system properties. |
| 84 | * String method {{{getContent()}}} - gets all data in this report, serialized to String. |
| 85 | |
| 86 | * Create a class {{{org.sophie2.main.func.help.bugreport.BugReportDialogInput}}} that extends {{{DialogInput<Void>}}}: |
| 87 | * {{{private final BugReport bugReport;}}} |
| 88 | * {{{private final String windowTitle;}}} |
97 | | * method {{{BugReportDialogInput collectReportData(Throwable t)}}} that collects all required report data: |
98 | | * the exception is taken as a parameter |
| 108 | * SHOW_BUG_REPORT_FORM: this should be called when the menu item is selected. Calls BugReportLogic.showBugReportForm(null); (null, because no exception is thrown) |
| 109 | * SAVE_REPORT_TO_FILE: opens a file dialog, saves the result of BugReport.getContent() and closes the form. |
| 110 | * Use UTF-8 encoding. |
| 111 | * ATTACH_FILE: opens a file dialog, sets the attachment field in the bugReport property of the event source (BugReportDialog). |
| 112 | * CLOSE: closes the form. |
| 113 | * SAVE_EMAIL: invoked when the user enters a valid e-mail in the form. Saves the address as described earlier. |
| 114 | * {{{static void showBugReportForm(Throwable throwable)}}}: calls {{{collectReportData(throwable)}}} and opens the form using DialogManager. |
| 115 | * {{{static BugReport collectReportData(Throwable t)}}}: collects all required report data: |
| 116 | * serializes the throwable's stack trace to string. |
105 | | * SHOW_BUG_REPORT_FORM: invokes the dialog using {{{DialogManager.get().showDialog}}} with argument - report generated by {{{generateReport}}}. |
106 | | * method {{{String generateReport(BugReportDialogInput)}}} that serializes all the data to string. |
107 | | * The exception is serialized using printStackTrace. |
108 | | * Use ISO format for the date. |
109 | | * Use UTF-8 encoding. |
110 | | * SAVE_TO_FILE: opens a file dialog, saves the result of {{{generateReport}}} (without the attached file) and closes the form. |
111 | | * LOAD_FROM_FILE: opens a file dialog, replaces the generated report. |
112 | | * ATTACH_FILE: opens a file dialog, sets the attachment field in BugReportDialogInput. |
113 | | * CLOSE: closes the form. |