diff --git a/pdex/Todo, GSoC 2013.txt b/pdex/Todo, GSoC 2013.txt index a9cd7c736..f599eb465 100644 --- a/pdex/Todo, GSoC 2013.txt +++ b/pdex/Todo, GSoC 2013.txt @@ -122,7 +122,8 @@ Suggestion for missing imports x Barebones functionality done. x Add imports only to beginning of first tab. x Search within contributed libraries folder -* Search within code folder of sketch +x Hide suggestion list before showing import suggestions +x Search within code folder of sketch Labels for Java elements ======================== diff --git a/pdex/mode.properties b/pdex/mode.properties index 5029f1941..b5ac00702 100644 --- a/pdex/mode.properties +++ b/pdex/mode.properties @@ -1,4 +1,4 @@ -name=ExperimentalMode +name=PDE X authorList=[The Processing Foundation](http://processing.org) url=https://github.com/processing/processing-experimental sentence=The next generation of PDE diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index ce466f723..5e82877ca 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -3064,6 +3064,19 @@ public class ASTGenerator { log("Res: " + res); } } + + if (editor.getSketch().hasCodeFolder()) { + File codeFolder = editor.getSketch().getCodeFolder(); + // get a list of .jar files in the "code" folder + // (class files in subfolders should also be picked up) + ClassPath cp = factory.createFromPath(Base + .contentsToClassPath(codeFolder)); + resources = cp.findResources("", regf); + for (String res : resources) { + candidates.add(res); + log("Res: " + res); + } + } resources = new String[candidates.size()]; for (int i = 0; i < resources.length; i++) { @@ -3115,6 +3128,7 @@ public class ASTGenerator { editor.getY() + (editor.getHeight() - frmImportSuggest.getHeight()) / 2); + editor.ta.hideSuggestion(); frmImportSuggest.setVisible(true); } diff --git a/pdex/src/processing/mode/experimental/TextArea.java b/pdex/src/processing/mode/experimental/TextArea.java index 4abec789b..3e2a36f28 100644 --- a/pdex/src/processing/mode/experimental/TextArea.java +++ b/pdex/src/processing/mode/experimental/TextArea.java @@ -745,7 +745,7 @@ public class TextArea extends JEditTextArea { // }); } - private void hideSuggestion() { + protected void hideSuggestion() { if (suggestion != null) { suggestion.hide(); suggestion = null;