diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 34f731968..d060b3248 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -54,7 +54,7 @@ public class ContributionListing { final private ReentrantLock downloadingLock = new ReentrantLock(); final Set availableContribs; - final private Map packageToLibrary; + final private Map libraryExports; final private Set allContribs; Set listPanels; @@ -63,7 +63,7 @@ public class ContributionListing { private ContributionListing() { listPanels = new HashSet<>(); availableContribs = new HashSet<>(); - packageToLibrary = new HashMap<>(); + libraryExports = new HashMap<>(); allContribs = ConcurrentHashMap.newKeySet(); listingFile = Base.getSettingsFile(LOCAL_FILENAME); @@ -294,7 +294,7 @@ public class ContributionListing { // Only updated whenever the available list is loaded. // No need to do this after/during the installation process. - packageToLibrary.clear(); + libraryExports.clear(); for (Contribution available : availableContribs) { addContribution(available); @@ -304,7 +304,7 @@ public class ContributionListing { StringList exports = available.getExports(); if (exports != null) { for (String export : exports) { - packageToLibrary.put(export, available); + libraryExports.put(export, available); } } } @@ -402,7 +402,7 @@ public class ContributionListing { /** * Used by JavaEditor to auto-import. Not known to be used by other Modes. */ - public Map getLibraryImportMap() { - return packageToLibrary; + public Map getLibraryExports() { + return libraryExports; } } diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index cbcb27649..cc8917c1d 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -118,22 +118,6 @@ public class JavaEditor extends Editor { // setting breakpoints will flag sketch as modified, so override this here getSketch().setModified(false); - /* - // hack to add a JPanel to the right-hand side of the text area - JPanel textAndError = new JPanel(); - // parent is a vertical box with the toolbar, the header, and the text area - Box box = (Box) textarea.getParent(); - // remove the text area temporarily - box.remove(2); - textAndError.setLayout(new BorderLayout()); - errorColumn = new MarkerColumn(this, textarea.getMinimumSize().height); - textAndError.add(errorColumn, BorderLayout.EAST); - textarea.setBounds(0, 0, errorColumn.getX() - 1, textarea.getHeight()); - textAndError.add(textarea); - // add our hacked version back to the editor - box.add(textAndError); - */ - preprocService = new PreprocService(this.jmode, this.sketch); // long t5 = System.currentTimeMillis(); @@ -359,8 +343,8 @@ public class JavaEditor extends Editor { boolean contribToolMenuItemAdded; List contribTools = base.getContribTools(); - // Adding this in in case a reference folder is added for MovieMaker, or in case - // other core tools are introduced later + // Adding this in case a reference folder is added for MovieMaker, + // or in case other core tools are introduced later. coreToolMenuItemAdded = addToolReferencesToSubMenu(base.getCoreTools(), toolRefSubmenu); if (coreToolMenuItemAdded && !contribTools.isEmpty()) @@ -547,7 +531,7 @@ public class JavaEditor extends Editor { } else { // why it's not CANCEL_OPTION is beyond me (at least on the mac) - // but f-- it.. let's get this shite done.. + // but f-- it... let's get this shite done... //} else if (result == JOptionPane.CANCEL_OPTION) { statusNotice(Language.text("export.notice.cancel.unsaved_changes")); //toolbar.clear(); @@ -705,11 +689,10 @@ public class JavaEditor extends Editor { /** - * Add import statements to the current tab for all of packages inside + * Add import statements to the current tab for all packages inside * the specified jar file. */ public void handleImportLibrary(String libraryName) { - // make sure the user didn't hide the sketch folder sketch.ensureExistence(); @@ -1238,7 +1221,7 @@ public class JavaEditor extends Editor { */ private List getNotInstalledAvailableLibs(List importHeadersList) { Map importMap = - ContributionListing.getInstance().getLibraryImportMap(); + ContributionListing.getInstance().getLibraryExports(); List libList = new ArrayList<>(); for (String importHeaders : importHeadersList) { int dot = importHeaders.lastIndexOf('.'); @@ -1828,21 +1811,6 @@ public class JavaEditor extends Editor { } -// /** -// * 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 a full IDE -// * like Eclipse. Disable compilation check and some more features. -// */ -// private boolean checkForJavaTabs() { -// for (SketchCode code : getSketch().getCode()) { -// if (code.getExtension().equals("java")) { -// return true; -// } -// } -// return false; -// } - - @Override public void applyPreferences() { super.applyPreferences(); @@ -1926,8 +1894,8 @@ public class JavaEditor extends Editor { textarea.invalidate(); } } else { - // number values were not modified but we need to load the saved code - // because of some formatting changes + // number values were not modified, but we need to load + // the saved code because of some formatting changes loadSavedCode(); textarea.invalidate(); } @@ -2015,23 +1983,6 @@ public class JavaEditor extends Editor { } - /* - private void removeSpacesFromCode() { - SketchCode[] code = sketch.getCode(); - for (int i=0; i