| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2132,6 +2132,7 @@ public void toggleDebug() { | |||
| 2132 | 2132 | ||
| 2133 | 2133 | public void updateDebugToggle() { | |
| 2134 | 2134 | final boolean enabled = isDebuggerEnabled(); | |
| 2135 | + rebuildToolbar(); | ||
| 2135 | 2136 | /* | |
| 2136 | 2137 | if (enabled) { | |
| 2137 | 2138 | inspector.setFocusableWindowState(false); // to not get focus when set visible | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,6 @@ | |||
| 23 | 23 | import java.awt.event.ActionEvent; | |
| 24 | 24 | import java.awt.event.InputEvent; | |
| 25 | 25 | import java.util.ArrayList; | |
| 26 | - import java.util.Arrays; | ||
| 27 | 26 | import java.util.List; | |
| 28 | 27 | ||
| 29 | 28 | import javax.swing.Box; | |
@@ -50,8 +49,12 @@ public JavaToolbar(Editor editor) { | |||
| 50 | 49 | } | |
| 51 | 50 | ||
| 52 | 51 | ||
| 52 | + @Override | ||
| 53 | 53 | public List<EditorButton> createButtons() { | |
| 54 | - final boolean debug = jeditor.isDebuggerEnabled(); | ||
| 54 | + // jeditor not ready yet because this is called by super() | ||
| 55 | + final boolean debug = ((JavaEditor) editor).isDebuggerEnabled(); | ||
| 56 | + // System.out.println("creating buttons in JavaToolbar, debug:" + debug); | ||
| 57 | + List<EditorButton> outgoing = new ArrayList<>(); | ||
| 55 | 58 | ||
| 56 | 59 | final String runText = debug ? | |
| 57 | 60 | Language.text("toolbar.debug") : Language.text("toolbar.run"); | |
@@ -64,6 +67,7 @@ public void actionPerformed(ActionEvent e) { | |||
| 64 | 67 | handleRun(e.getModifiers()); | |
| 65 | 68 | } | |
| 66 | 69 | }; | |
| 70 | + outgoing.add(runButton); | ||
| 67 | 71 | ||
| 68 | 72 | if (debug) { | |
| 69 | 73 | stepButton = new EditorButton(mode, | |
@@ -76,6 +80,8 @@ public void actionPerformed(ActionEvent e) { | |||
| 76 | 80 | jeditor.handleStep(e.getModifiers()); | |
| 77 | 81 | } | |
| 78 | 82 | }; | |
| 83 | + outgoing.add(stepButton); | ||
| 84 | + | ||
| 79 | 85 | continueButton = new EditorButton(mode, | |
| 80 | 86 | "/lib/toolbar/continue", | |
| 81 | 87 | Language.text("menu.debug.continue")) { | |
@@ -84,6 +90,7 @@ public void actionPerformed(ActionEvent e) { | |||
| 84 | 90 | jeditor.handleContinue(); | |
| 85 | 91 | } | |
| 86 | 92 | }; | |
| 93 | + outgoing.add(continueButton); | ||
| 87 | 94 | } | |
| 88 | 95 | ||
| 89 | 96 | stopButton = new EditorButton(mode, | |
@@ -94,7 +101,9 @@ public void actionPerformed(ActionEvent e) { | |||
| 94 | 101 | handleStop(); | |
| 95 | 102 | } | |
| 96 | 103 | }; | |
| 97 | - return new ArrayList<>(Arrays.asList(runButton, stopButton)); | ||
| 104 | + outgoing.add(stopButton); | ||
| 105 | + | ||
| 106 | + return outgoing; | ||
| 98 | 107 | } | |
| 99 | 108 | ||
| 100 | 109 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments