/** Utility method. See {@link #getLibDir()}. */ public synchronized FileObject getLibDirFO() { if (libDirFO == null) { String lib = getLibDir(); if (lib != null) { libDirFO = FileUtil.toFileObject(new File(lib)); } } return libDirFO; }
/** * Test whether the platform is valid, i.e. has appropriate interpreter, * <em>lib</em> and <em>bin</em> directories. * * @param warn whether to show the dialog to the user if platform is invalid * @return whether the platform is valid */ public boolean isValid(final boolean warn) { boolean valid = new File(interpreter).isFile() && getLibDir() != null; if (valid) { String binDir = getBinDir(); if (binDir != null) { valid = new File(binDir).isDirectory(); } } if (warn && !valid) { showWarning(this); } return valid; }
private void initProjectInfo() { FileObject fo = element.getFileObject(); if (fo != null) { File f = FileUtil.toFile(fo); Project p = FileOwnerQuery.getOwner(fo); if (p != null) { RubyPlatform platform = RubyPlatform.platformFor(p); if (platform != null) { String lib = platform.getLibDir(); if (lib != null && f.getPath().startsWith(lib)) { projectName = "Ruby Library"; isLibrary = true; } } else { // TODO - check to see if we're a library - and if so include the language icon ProjectInformation pi = ProjectUtils.getInformation(p); projectName = pi.getDisplayName(); projectIcon = pi.getIcon(); } } } else { isLibrary = true; Logger.getLogger(RubyTypeSearcher.class.getName()).fine("No fileobject for " + element.toString() + " with fileurl=" + element.getFileUrl()); } if (projectName == null) { projectName = ""; } }
"#\n" + "# You may need to copy derby.jar into\n" + "# TODO: location " + platform.getLibDir() + "\n" + "# With Java SE 6 and later this is not necessary.\n" + "development:\n" + // NOI18N