public void actionPerformed(ActionEvent e) { String value = ahelper.getStandardPropertyEvaluator().evaluate(reference); updateReference(value, reference, true); //now process source reference String source = reference.replace("${file.reference", "${source.reference"); //NOI18N value = ahelper.getStandardPropertyEvaluator().evaluate(source); if (!value.startsWith("${source.")) { //NOI18N updateReference(value, source.replace("${", "").replace("}", ""), false); } //now process javadoc reference String javadoc = reference.replace("${file.reference", "${javadoc.reference"); //NOI18N value = ahelper.getStandardPropertyEvaluator().evaluate(javadoc); if (!value.startsWith("${javadoc.")) { //NOI18N updateReference(value, javadoc.replace("${", "").replace("}", ""), false); } }
@Override public FileObject resolveProjectLocation(@NonNull String path) { String evaluated = evaluator.evaluate(path); if (evaluated != null) { return antHelper.resolveFileObject(evaluated); } else { return null; } }
@Override public FileObject resolveProjectLocation(@NonNull String path) { String evaluated = evaluator.evaluate(path); if (evaluated != null) { return antHelper.resolveFileObject(evaluated); } else { return null; } }
/** * Returns the property value evaluated by J2SEProject's PropertyEvaluator. * * @param p project * @param value of property * @return evaluated value of given property or null if the property not set or * if the project doesn't provide AntProjectHelper */ public static Object getEvaluatedProperty(Project p, String value) { if (value == null) { return null; } J2SEProject j2seprj = (J2SEProject) p.getLookup().lookup(J2SEProject.class); if (j2seprj != null) { return j2seprj.evaluator().evaluate(value); } else { return null; } }
/** Tests whether evaluated URI can be resolved. To support library entry * like "${MAVEN_REPO}/struts/struts.jar". */ private static boolean canResolveEvaluatedUri(PropertyEvaluator eval, URL libBase, URI libUri) { if (libUri.isAbsolute()) { return false; } String path = LibrariesSupport.convertURIToFilePath(libUri); String newPath = eval.evaluate(path); if (newPath.equals(path)) { return false; } URI newUri = LibrariesSupport.convertFilePathToURI(newPath); return null != LibrariesSupport.resolveLibraryEntryFileObject(libBase, newUri); }
public void saveLicenseFile() throws IOException { if (licenseContent != null) { assert licensePath != null; //path needs to exist once we have content? String evaluated = evaluator.evaluate(licensePath); assert evaluated != null; File file = antHelper.resolveFile(evaluated); FileObject fo; if (!file.exists()) { fo = FileUtil.createData(file); } else { fo = FileUtil.toFileObject(file); } OutputStream out = fo.getOutputStream(); try { FileUtil.copy(new ByteArrayInputStream(licenseContent.getBytes()), out); } finally { out.close(); } } }
public void saveLicenseFile() throws IOException { if (licenseContent != null) { assert licensePath != null; //path needs to exist once we have content? String evaluated = evaluator.evaluate(licensePath); assert evaluated != null; File file = antHelper.resolveFile(evaluated); FileObject fo; if (!file.exists()) { fo = FileUtil.createData(file); } else { fo = FileUtil.toFileObject(file); } OutputStream out = fo.getOutputStream(); try { FileUtil.copy(new ByteArrayInputStream(licenseContent.getBytes()), out); } finally { out.close(); } } }
protected @Override Node[] createNodes(String key) { String locEval = project.getEvaluator().evaluate(key); FileObject file = project.getProjectHelper().resolveFileObject(locEval); try { Node orig = DataObject.find(file).getNodeDelegate(); return new Node[]{createSpecialFileNode(orig, FILES.get(key))}; } catch (DataObjectNotFoundException e) { throw new AssertionError(e); } }
public void actionPerformed(ActionEvent e) { try { String value = ahelper.getStandardPropertyEvaluator().evaluate(reference); File absFile = ahelper.resolveFile(value); String location = ahelper.getLibrariesLocation(); value = ahelper.getStandardPropertyEvaluator().evaluate(source); if (!value.startsWith("${source.")) { //NOI18N absFile = ahelper.resolveFile(value); value = ahelper.getStandardPropertyEvaluator().evaluate(javadoc); if (!value.startsWith("${javadoc.")) { //NOI18N absFile = ahelper.resolveFile(value);
public List<Item> itemsList(String... values) { List<Item> items = new ArrayList<>(values.length); for (String p : values) { Item item; if (isWellKnownPath(p)) { // some well know classpath item = Item.create(p); } else { File f = null; String eval = evaluator.evaluate(p); if (eval != null) { f = antProjectHelper.resolveFile(eval); } if (f == null || !f.exists()) { item = Item.createBroken(eval, p); } else { item = Item.create(eval, p); } } items.add(item); } return items; }
@Override public FileObject resolveProjectLocation(@NonNull String path) { PhpProject project = uiProps.getProject(); String evaluated = ProjectPropertiesSupport.getPropertyEvaluator(project).evaluate(path); assert evaluated != null : path; return project.getHelper().resolveFileObject(evaluated); }
private FileObject getSharedLibraryFolderLocation() { String libLoc = helper.getLibrariesLocation(); if (libLoc != null) { String libLocEval = evaluator.evaluate(libLoc); File file = null; if (libLocEval != null) { file = helper.resolveFile(libLocEval); } FileObject libLocFO = FileUtil.toFileObject(file); if (libLocFO != null) { //#126366 this can happen when people checkout the project but not the libraries description //that is located outside the project FileObject libLocParent = libLocFO.getParent(); return libLocParent; } } return null; }
} else if (val instanceof String) { String ref = (String) val; String value = helper.getStandardPropertyEvaluator().evaluate(ref); File absFile = helper.resolveFile(value); String text = LBL_BinaryDesc(absFile.getAbsolutePath()); String source = ref.replace("${file.reference", "${source.reference"); //NOI18N value = helper.getStandardPropertyEvaluator().evaluate(source); if (!value.startsWith("${source.")) { //NOI18N absFile = helper.resolveFile(value); value = helper.getStandardPropertyEvaluator().evaluate(javadoc); if (!value.startsWith("${javadoc.")) { //NOI18N absFile = helper.resolveFile(value);
private String getToolTipText(BasePathSupport.Item item) { switch (item.getType()) { case FOLDER: if (item.isBroken()) { if (evaluator != null) { return evaluator.evaluate(item.getReference()); } return item.getReference(); } return item.getAbsoluteFilePath(projectFolder); //break; default: // noop } return null; }
licensePath = helper.getStandardPropertyEvaluator().evaluate(licensePath); if (licensePath != null) { File path = FileUtil.normalizeFile(helper.resolveFile(licensePath));
licensePath = helper.getStandardPropertyEvaluator().evaluate(licensePath); if (licensePath != null) { File path = FileUtil.normalizeFile(helper.resolveFile(licensePath));
String value = helper.getStandardPropertyEvaluator().evaluate(jar); if (!value.startsWith("${")) { //NOI18N File jarFile = helper.resolveFile(value);
private static String convertPath(AntProjectHelper helper, String path, boolean javadoc) { String val = addVariableMarkup(path); String eval = helper.getStandardPropertyEvaluator().evaluate(val); if (eval == null) { return val;
"Source Entry (folder, ZIP or JAR file)", new String[]{"ZIP", "JAR"})); // NOI18N File curDir = helper.resolveFile(helper.getStandardPropertyEvaluator().evaluate(item.getJarFile())); chooser.setCurrentDirectory(curDir); int option = chooser.showOpenDialog(SwingUtilities.getWindowAncestor(this)); // Sow the chooser
"Javadoc Entry (folder, ZIP or JAR file)", new String[]{"ZIP", "JAR"})); // NOI18N File curDir = helper.resolveFile(helper.getStandardPropertyEvaluator().evaluate(item.getJarFile())); chooser.setCurrentDirectory(curDir); int option = chooser.showOpenDialog(SwingUtilities.getWindowAncestor(this)); // Sow the chooser