/** * Returns a new runtime classpath entry for the given expression that * may contain string substitution variable references. The resulting expression * refers to an archive (jar or directory) containing class files. * * @param expression an expression that resolves to the location of an archive * @return runtime classpath entry * @since 3.0 */ public static IRuntimeClasspathEntry newStringVariableClasspathEntry(String expression) { return new VariableClasspathEntry(expression); }
@Override protected void buildMemento(Document document, Element memento) throws CoreException { memento.setAttribute("variableString", variableString); //$NON-NLS-1$ memento.setAttribute("path", Integer.toString(getClasspathProperty())); //$NON-NLS-1$ }
@Override public void initializeFrom(Element memento) throws CoreException { variableString = memento.getAttribute("variableString"); //$NON-NLS-1$ String property = memento.getAttribute("path"); //$NON-NLS-1$ if(property != null && !"".equals(property)) { //$NON-NLS-1$ try { setClasspathProperty(Integer.parseInt(property)); } catch(NumberFormatException nfe) {/*do nothing, but don't throw an exception*/} } }
private IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry) throws CoreException{ String variableString = ((VariableClasspathEntry)entry).getVariableString(); String strpath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(variableString); IPath path = new Path(strpath).makeAbsolute(); IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(path); return new IRuntimeClasspathEntry[] { archiveEntry }; }
public String getLabel(Object o) { if (o instanceof VariableClasspathEntry) { return ((VariableClasspathEntry)o).getName(); } return ""; //$NON-NLS-1$ } /* (non-Javadoc)
private IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry) throws CoreException{ String variableString = ((VariableClasspathEntry)entry).getVariableString(); String strpath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(variableString); IPath path = new Path(strpath).makeAbsolute(); IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(path); return new IRuntimeClasspathEntry[] { archiveEntry }; }
new Path(runtimeClasspathEntry.getVariableString()), null, null); VariableClasspathEntry vce = (VariableClasspathEntry)e; newEntry = JavaCore.newLibraryEntry(new Path(vce.getVariableString()), null, null);
/** * Returns a new runtime classpath entry for the given expression that * may contain string substitution variable references. The resulting expression * refers to an archive (jar or directory) containing class files. * * @param expression an expression that resolves to the location of an archive * @return runtime classpath entry * @since 3.0 */ public static IRuntimeClasspathEntry newStringVariableClasspathEntry(String expression) { return new VariableClasspathEntry(expression); }
@Override public void initializeFrom(Element memento) throws CoreException { variableString = memento.getAttribute("variableString"); //$NON-NLS-1$ String property = memento.getAttribute("path"); //$NON-NLS-1$ if(property != null && !"".equals(property)) { //$NON-NLS-1$ try { setClasspathProperty(Integer.parseInt(property)); } catch(NumberFormatException nfe) {/*do nothing, but don't throw an exception*/} } }
@Override protected void buildMemento(Document document, Element memento) throws CoreException { memento.setAttribute("variableString", variableString); //$NON-NLS-1$ memento.setAttribute("path", Integer.toString(getClasspathProperty())); //$NON-NLS-1$ }