| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 59dd00f commit 2ecdc36
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ | |||
| 33 | 33 | import processing.mode.java.pdex.LineMarker; | |
| 34 | 34 | import processing.mode.java.pdex.JavaTextArea; | |
| 35 | 35 | import processing.mode.java.pdex.Problem; | |
| 36 | + import processing.mode.java.preproc.PdePreprocessor; | ||
| 36 | 37 | import processing.mode.java.runner.Runner; | |
| 37 | 38 | import processing.mode.java.tweak.ColorControlBox; | |
| 38 | 39 | import processing.mode.java.tweak.Handle; | |
@@ -136,17 +137,7 @@ public void actionPerformed(ActionEvent e) { | |||
| 136 | 137 | hasJavaTabs = checkForJavaTabs(); | |
| 137 | 138 | //initializeErrorChecker(); | |
| 138 | 139 | ||
| 139 | - { // Init error checker | ||
| 140 | - errorCheckerService = new ErrorCheckerService(this); | ||
| 141 | - for (SketchCode code : getSketch().getCode()) { | ||
| 142 | - Document document = code.getDocument(); | ||
| 143 | - if (document != null) { | ||
| 144 | - errorCheckerService.addListener(document); | ||
| 145 | - } | ||
| 146 | - } | ||
| 147 | - errorCheckerService.start(); | ||
| 148 | - errorCheckerService.request(); | ||
| 149 | - } | ||
| 140 | + initErrorChecker(); | ||
| 150 | 141 | ||
| 151 | 142 | // hack to add a JPanel to the right-hand side of the text area | |
| 152 | 143 | JPanel textAndError = new JPanel(); | |
@@ -180,7 +171,25 @@ public void caretUpdate(CaretEvent e) { | |||
| 180 | 171 | }); | |
| 181 | 172 | } | |
| 182 | 173 | ||
| 183 | - | ||
| 174 | + | ||
| 175 | + public PdePreprocessor createPreprocessor(final String sketchName) { | ||
| 176 | + return new PdePreprocessor(sketchName); | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + | ||
| 180 | + protected void initErrorChecker() { | ||
| 181 | + errorCheckerService = new ErrorCheckerService(this); | ||
| 182 | + for (SketchCode code : getSketch().getCode()) { | ||
| 183 | + Document document = code.getDocument(); | ||
| 184 | + if (document != null) { | ||
| 185 | + errorCheckerService.addListener(document); | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + errorCheckerService.start(); | ||
| 189 | + errorCheckerService.request(); | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + | ||
| 184 | 193 | protected JEditTextArea createTextArea() { | |
| 185 | 194 | return new JavaTextArea(new PdeTextAreaDefaults(mode), this); | |
| 186 | 195 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1336,7 +1336,8 @@ protected Class<?> findClassIfExists(String className){ | |||
| 1336 | 1336 | //log("Doesn't exist in (code folder) imp package: " + impS.getImportName()); | |
| 1337 | 1337 | } | |
| 1338 | 1338 | ||
| 1339 | - PdePreprocessor p = new PdePreprocessor(null); | ||
| 1339 | + // PdePreprocessor p = new PdePreprocessor(null); | ||
| 1340 | + PdePreprocessor p = editor.createPreprocessor(null); | ||
| 1340 | 1341 | for (String impS : p.getCoreImports()) { | |
| 1341 | 1342 | tehClass = loadClass(impS.substring(0,impS.length()-1) + className); | |
| 1342 | 1343 | if (tehClass != null) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,9 +54,10 @@ public class XQPreprocessor { | |||
| 54 | 54 | ||
| 55 | 55 | public XQPreprocessor(ErrorCheckerService ecs) { | |
| 56 | 56 | this.ecs = ecs; | |
| 57 | - | ||
| 57 | + | ||
| 58 | 58 | // get parameters from the main preproc | |
| 59 | - PdePreprocessor p = new PdePreprocessor(null); | ||
| 59 | + // PdePreprocessor p = new PdePreprocessor(null); | ||
| 60 | + PdePreprocessor p = ecs.editor.createPreprocessor(null); | ||
| 60 | 61 | defaultImports = p.getDefaultImports(); | |
| 61 | 62 | coreImports = p.getCoreImports(); | |
| 62 | 63 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments