diff options
| author | 2020-06-07 17:26:41 +0200 | |
|---|---|---|
| committer | 2020-06-07 17:26:41 +0200 | |
| commit | 50d4fc8430573757c5fe4f4a1d3b1c4871dbfb46 (patch) | |
| tree | d79202cc803018f04580f166a1a11e89e65786ad /enigma-swing/src/main | |
| parent | Fix yet another navigateToToken crash (diff) | |
| download | enigma-50d4fc8430573757c5fe4f4a1d3b1c4871dbfb46.tar.gz enigma-50d4fc8430573757c5fe4f4a1d3b1c4871dbfb46.tar.xz enigma-50d4fc8430573757c5fe4f4a1d3b1c4871dbfb46.zip | |
Add remap crash handler
Diffstat (limited to 'enigma-swing/src/main')
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java index a45ecc93..bf1d5fb2 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java | |||
| @@ -57,7 +57,7 @@ public class PanelEditor { | |||
| 57 | private final JProgressBar decompilingProgressBar = new JProgressBar(0, 100); | 57 | private final JProgressBar decompilingProgressBar = new JProgressBar(0, 100); |
| 58 | 58 | ||
| 59 | // error display UI | 59 | // error display UI |
| 60 | private final JLabel errorLabel = new JLabel(I18n.translate("editor.decompile_error")); | 60 | private final JLabel errorLabel = new JLabel(); |
| 61 | private final JTextArea errorTextArea = new JTextArea(); | 61 | private final JTextArea errorTextArea = new JTextArea(); |
| 62 | private final JScrollPane errorScrollPane = new JScrollPane(this.errorTextArea); | 62 | private final JScrollPane errorScrollPane = new JScrollPane(this.errorTextArea); |
| 63 | private final JButton retryButton = new JButton(I18n.translate("general.retry")); | 63 | private final JButton retryButton = new JButton(I18n.translate("general.retry")); |
| @@ -336,6 +336,18 @@ public class PanelEditor { | |||
| 336 | 336 | ||
| 337 | public void displayError(ClassHandleError t) { | 337 | public void displayError(ClassHandleError t) { |
| 338 | this.setDisplayMode(DisplayMode.ERRORED); | 338 | this.setDisplayMode(DisplayMode.ERRORED); |
| 339 | String str; | ||
| 340 | switch(t.type) { | ||
| 341 | case DECOMPILE: | ||
| 342 | str = "editor.decompile_error"; | ||
| 343 | break; | ||
| 344 | case REMAP: | ||
| 345 | str = "editor.remap_error"; | ||
| 346 | break; | ||
| 347 | default: | ||
| 348 | throw new IllegalStateException("unreachable"); | ||
| 349 | } | ||
| 350 | this.errorLabel.setText(I18n.translate(str)); | ||
| 339 | this.errorTextArea.setText(t.getStackTrace()); | 351 | this.errorTextArea.setText(t.getStackTrace()); |
| 340 | this.errorTextArea.setCaretPosition(0); | 352 | this.errorTextArea.setCaretPosition(0); |
| 341 | } | 353 | } |