public String getMemento() throws CoreException { return entry.getMemento(); }
public String getMemento() throws CoreException { return entry.getMemento(); }
public String getMemento() throws CoreException { return delegate.getMemento(); }
public void performApply(ILaunchConfigurationWorkingCopy configuration) { if (isDirty()) { IRuntimeClasspathEntry[] classpath = getCurrentClasspath(); try { List mementos = new ArrayList(classpath.length); for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento()); } configuration.setAttribute(ATTR_ASPECTPATH, mementos); } catch (CoreException e) { JDIDebugUIPlugin.errorDialog(LauncherMessages.JavaClasspathTab_Unable_to_save_classpath_1, e); //$NON-NLS-1$ } } }
/** * Convert a VariableClasspathEntry to a IClasspathEntry. * * <p> * This is a workaround as entry.getClasspathEntry() returns null. */ private IClasspathEntry convertVariableClasspathEntry(IRuntimeClasspathEntry entry) { try { Document doc = ExportUtil.parseXmlString(entry.getMemento()); Element element = (Element) doc.getElementsByTagName("memento").item(0); //$NON-NLS-1$ String variableString = element.getAttribute("variableString"); //$NON-NLS-1$ ExportUtil.addVariable(variable2valueMap, variableString, ExportUtil.getProjectRoot(project)); // remove ${...} from string to be conform for handleVariables() variableString = ExportUtil.removePrefix(variableString, "${");//$NON-NLS-1$ int i = variableString.indexOf('}'); if (i != -1) { variableString = variableString.substring(0, i) + variableString.substring(i + 1); } IPath path = new Path(variableString); return JavaCore.newVariableEntry(path, null, null); } catch (Exception e) { AntUIPlugin.log(e); return null; } } }
private void saveEntries(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true); IRuntimeClasspathEntry[] customClasspath = getCurrentCustomClasspath(); try { List<String> mementos = new ArrayList<String>( customClasspath.length); for (int i = 0; i < customClasspath.length; i++) { IRuntimeClasspathEntry entry = customClasspath[i]; mementos.add(entry.getMemento()); } configuration.setAttribute(getCustomAttributeName(), mementos); configuration.doSave(); } catch (CoreException e) { Plugin.statusDialog( RunJettyRunMessages.JavaClasspathTab_Unable_to_save_classpath_1, e.getStatus()); } }
public void performApply(ILaunchConfigurationWorkingCopy configuration) { if (isDirty()) { boolean def = fDefaultButton.getSelection(); if (def) { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, (String)null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH, (List)null); } else { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, def); try { IRuntimeClasspathEntry[] entries = fPathViewer.getEntries(); List mementos = new ArrayList(entries.length); for (int i = 0; i < entries.length; i++) { mementos.add(entries[i].getMemento()); } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH, mementos); } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(LauncherMessages.SourceLookupBlock_Unable_to_save_source_lookup_path_1, e.getStatus()); } } boolean dup = fDuplicatesButton.getSelection(); if (dup) { configuration.setAttribute(JavaUISourceLocator.ATTR_FIND_ALL_SOURCE_ELEMENTS, true); } else { configuration.setAttribute(JavaUISourceLocator.ATTR_FIND_ALL_SOURCE_ELEMENTS, (String)null); } } }
public void performApply(ILaunchConfigurationWorkingCopy configuration) { if (isDirty()) { IRuntimeClasspathEntry[] classpath = getCurrentClasspath(); boolean def = isDefaultClasspath(classpath, configuration.getOriginal()); if (def) { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, (String)null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, (String)null); } else { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false); try { List mementos = new ArrayList(classpath.length); for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento()); } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos); } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(LauncherMessages.JavaClasspathTab_Unable_to_save_classpath_1, e.getStatus()); } } } }
for (int index= 0; index < classPath.length; index++) { entry= classPath[index]; mementos.add(entry.getMemento());
for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento());
public void performApply(ILaunchConfigurationWorkingCopy configuration) { if (isDirty()) { IRuntimeClasspathEntry[] classpath = getCurrentClasspath(); boolean def = isDefaultClasspath(classpath, configuration.getOriginal()); if (def) { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, (String)null); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, (String)null); } else { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false); try { List mementos = new ArrayList(classpath.length); for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento()); } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos); } catch (CoreException e) { JDIDebugUIPlugin.errorDialog(LauncherMessages.JavaClasspathTab_Unable_to_save_classpath_1, e); //$NON-NLS-1$ } } } }
IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry) iterator.next(); try { list.add(entry.getMemento()); } catch (Exception e) { Trace.trace(Trace.SEVERE, "Could not resolve classpath entry: " + entry, e);
public ILaunchConfigurationWorkingCopy createLaunchConfiguration() throws CoreException { DebugPlugin debugPlugin = DebugPlugin.getDefault(); ILaunchManager manager = debugPlugin.getLaunchManager(); ILaunchConfigurationType type = manager.getLaunchConfigurationType(launchConfigTypeId); String name = manager.generateLaunchConfigurationName(getNewLaunchConfigurationName()); ILaunchConfigurationWorkingCopy launchConfig = type.newInstance(null, name); launchConfig.setAttribute("org.eclipse.debug.ui.ATTR_CAPTURE_IN_CONSOLE", isLaunchCaptureInConsole()); launchConfig.setAttribute("org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", isLaunchInBackground()); launchConfig.setAttribute("org.eclipse.debug.ui.ATTR_PRIVATE", isLaunchIsPrivate()); IRuntimeClasspathEntry[] classpath = getClasspath(launchConfig); List<String> mementos = new ArrayList<>(classpath.length); for (IRuntimeClasspathEntry entry : classpath) { mementos.add(entry.getMemento()); } launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, Boolean.FALSE); launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos); if (getMainClass() != null) { launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, getMainClass()); } if (ListUtil.isNotEmpty(launchArgs)) { StringBuilder sb = new StringBuilder(); for (String s : launchArgs) { sb.append("\""); sb.append(s); sb.append("\" "); } launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, sb.toString()); } return launchConfig; }
for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento());
classpathList.add(classPath[i].getMemento());
for (int i = 0; i < classpath.length; i++) { IRuntimeClasspathEntry entry = classpath[i]; mementos.add(entry.getMemento());