@@ -126,7 +126,8 @@ protected JavaEditor(Base base, String path, EditorState state,
126126
127127 getJavaTextArea ().setMode (jmode );
128128
129- initPDEX ();
129+ preprocessingService = new PreprocessingService (this );
130+ pdex = new PDEX (this , preprocessingService );
130131
131132 Toolkit .setMenuMnemonics (textarea .getRightClickPopup ());
132133
@@ -146,18 +147,12 @@ public void caretUpdate(CaretEvent e) {
146147 });
147148 }
148149
149-
150+
150151 public PdePreprocessor createPreprocessor (final String sketchName ) {
151- return new PdePreprocessor (sketchName );
152+ return new PdePreprocessor (sketchName );
152153 }
153154
154-
155- protected void initPDEX () {
156- preprocessingService = new PreprocessingService (this );
157- pdex = new PDEX (this , preprocessingService );
158- }
159-
160-
155+
161156 protected JEditTextArea createTextArea () {
162157 return new JavaTextArea (new PdeTextAreaDefaults (mode ), this );
163158 }
@@ -1195,12 +1190,13 @@ public void handleContinue() {
11951190 }
11961191
11971192
1198- /** Toggle a breakpoint on the current line. */
1199- public void toggleBreakpoint () {
1200- debugger . toggleBreakpoint (getCurrentLineID ().lineIdx ());
1201- }
1193+ // /** Toggle a breakpoint on the current line. */
1194+ // public void toggleBreakpoint() {
1195+ // toggleBreakpoint(getCurrentLineID().lineIdx());
1196+ // }
12021197
12031198
1199+ @ Override
12041200 public void toggleBreakpoint (int lineIndex ) {
12051201 debugger .toggleBreakpoint (lineIndex );
12061202 }
@@ -1430,7 +1426,8 @@ public void actionPerformed(ActionEvent e) {
14301426 item .addActionListener (new ActionListener () {
14311427 public void actionPerformed (ActionEvent e ) {
14321428 Logger .getLogger (JavaEditor .class .getName ()).log (Level .INFO , "Invoked 'Toggle Breakpoint' menu item" );
1433- toggleBreakpoint ();
1429+ // TODO wouldn't getCaretLine() do the same thing with less effort?
1430+ toggleBreakpoint (getCurrentLineID ().lineIdx ());
14341431 }
14351432 });
14361433 debugMenu .add (item );
@@ -1522,8 +1519,8 @@ public void actionPerformed(ActionEvent e) {
15221519 }
15231520
15241521
1522+ @ Override
15251523 public boolean isDebuggerEnabled () {
1526- //return enableDebug.isSelected();
15271524 return debugEnabled ;
15281525 }
15291526
0 commit comments