diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index dc405da71..5918e8e4b 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -2066,6 +2066,7 @@ public class ASTGenerator { } public void handleShowUsage(){ + if(editor.hasJavaTabs) return; // show usage disabled if java tabs log("Last clicked word:" + lastClickedWord); if(lastClickedWord == null && editor.ta.getSelectedText() == null){ editor.statusMessage("Highlight the class/function/variable name first" @@ -2319,6 +2320,7 @@ public class ASTGenerator { protected SketchOutline sketchOutline; protected void showSketchOutline(){ + if(editor.hasJavaTabs) return; // sketch outline disabled if java tabs sketchOutline = new SketchOutline(codeTree, errorCheckerService); sketchOutline.show(); } @@ -2403,6 +2405,7 @@ public class ASTGenerator { } public void handleRefactor(){ + if(editor.hasJavaTabs) return; // refactoring disabled if java tabs log("Last clicked word:" + lastClickedWord); if(lastClickedWord == null && editor.ta.getSelectedText() == null){ editor.statusMessage("Highlight the class/function/variable name first", diff --git a/pdex/src/processing/mode/experimental/DebugEditor.java b/pdex/src/processing/mode/experimental/DebugEditor.java index f8d26e266..c278b680c 100755 --- a/pdex/src/processing/mode/experimental/DebugEditor.java +++ b/pdex/src/processing/mode/experimental/DebugEditor.java @@ -189,6 +189,11 @@ public class DebugEditor extends JavaEditor implements ActionListener { */ protected JCheckBoxMenuItem completionsEnabled; + /** + * If sketch contains java tabs, some editor features are disabled + */ + protected boolean hasJavaTabs; + /** * UNUSED. Disbaled for now. */ @@ -1687,19 +1692,20 @@ public class DebugEditor extends JavaEditor implements ActionListener { } /** - * Checks if the sketch contains java tabs. If it does, XQMode ain't built - * for it, yet. Also, user should really start looking at Eclipse. Disable - * compilation check. + * Checks if the sketch contains java tabs. If it does, the editor ain't built + * for it, yet. Also, user should really start looking at more powerful IDEs + * likeEclipse. Disable compilation check and some more features. */ private void checkForJavaTabs() { + hasJavaTabs = false; for (int i = 0; i < this.getSketch().getCodeCount(); i++) { if (this.getSketch().getCode(i).getExtension().equals("java")) { compilationCheckEnabled = false; + hasJavaTabs = true; JOptionPane.showMessageDialog(new Frame(), this .getSketch().getName() - + " contains .java tabs. Live compilation error checking isn't " - + "supported for java tabs. Only " - + "syntax errors will be reported for .pde tabs."); + + " contains .java tabs. Some editor features are not supported " + + "for .java tabs and will be disabled."); break; } } diff --git a/pdex/src/processing/mode/experimental/TextArea.java b/pdex/src/processing/mode/experimental/TextArea.java index 8e28eaf19..1396cd152 100644 --- a/pdex/src/processing/mode/experimental/TextArea.java +++ b/pdex/src/processing/mode/experimental/TextArea.java @@ -207,6 +207,7 @@ public class TextArea extends JEditTextArea { } super.processKeyEvent(evt); + if(editor.hasJavaTabs) return; // code completion disabled if java tabs if (evt.getID() == KeyEvent.KEY_TYPED) { char keyChar = evt.getKeyChar(); diff --git a/pdex/todo.txt b/pdex/todo.txt index 65e7c7116..8b2659193 100644 --- a/pdex/todo.txt +++ b/pdex/todo.txt @@ -22,7 +22,7 @@ Misc Tasks -[ ] New sketchbook layout --[ ] Better compatibility java tabs +-[ ] Better compatibility with java tabs -[x] Trim CompilationChecker class