/** * Creates and returns a new XML document. * * @return a new XML document * @throws CoreException if unable to create a new document */ protected Document newDocument()throws CoreException { return DebugPlugin.newDocument(); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("directorySourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("path", getDirectory().getAbsolutePath()); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("directorySourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("path", getDirectory().getAbsolutePath()); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaSourceLocator"); //$NON-NLS-1$ doc.appendChild(node); IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { Element child = doc.createElement("javaSourceLocation"); //$NON-NLS-1$ child.setAttribute("class", locations[i].getClass().getName()); //$NON-NLS-1$ child.setAttribute("memento", locations[i].getMemento()); //$NON-NLS-1$ node.appendChild(child); } return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc= DebugPlugin.newDocument(); Element root = doc.createElement("runtimeClasspathEntry"); //$NON-NLS-1$ doc.appendChild(root); root.setAttribute("id", getTypeId()); //$NON-NLS-1$ Element memento = doc.createElement("memento"); //$NON-NLS-1$ root.appendChild(memento); buildMemento(doc, memento); return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaSourceLocator"); //$NON-NLS-1$ doc.appendChild(node); IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { Element child = doc.createElement("javaSourceLocation"); //$NON-NLS-1$ child.setAttribute("class", locations[i].getClass().getName()); //$NON-NLS-1$ child.setAttribute("memento", locations[i].getMemento()); //$NON-NLS-1$ node.appendChild(child); } return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc= DebugPlugin.newDocument(); Element root = doc.createElement("runtimeClasspathEntry"); //$NON-NLS-1$ doc.appendChild(root); root.setAttribute("id", getTypeId()); //$NON-NLS-1$ Element memento = doc.createElement("memento"); //$NON-NLS-1$ root.appendChild(memento); buildMemento(doc, memento); return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaProjectSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("name", getJavaProject().getElementName()); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("archiveSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("archivePath", getName()); //$NON-NLS-1$ if (getRootPath() != null) { node.setAttribute("rootPath", getRootPath().toString()); //$NON-NLS-1$ } return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaProjectSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("name", getJavaProject().getElementName()); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("archiveSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("archivePath", getName()); //$NON-NLS-1$ if (getRootPath() != null) { node.setAttribute("rootPath", getRootPath().toString()); //$NON-NLS-1$ } return DebugPlugin.serializeDocument(doc); }
/** * Return the VM definitions contained in this object as a String of XML. The String * is suitable for storing in the workbench preferences. * <p> * The resulting XML is compatible with the static method <code>parseXMLIntoContainer</code>. * </p> * @return String the results of flattening this object into XML * @throws CoreException if this method fails. Reasons include:<ul> * <li>serialization of the XML document failed</li> * </ul> */ private static String getLibraryInfoAsXML() throws CoreException { Document doc = DebugPlugin.newDocument(); Element config = doc.createElement("libraryInfos"); //$NON-NLS-1$ doc.appendChild(config); // Create a node for each info in the table Iterator<String> locations = fgLibraryInfoMap.keySet().iterator(); while (locations.hasNext()) { String home = locations.next(); LibraryInfo info = fgLibraryInfoMap.get(home); Element locationElemnet = infoAsElement(doc, info); locationElemnet.setAttribute("home", home); //$NON-NLS-1$ config.appendChild(locationElemnet); } // Serialize the Document and return the resulting String return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaPackageFragmentRootSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); String handle = ""; //$NON-NLS-1$ if (getPackageFragmentRoot() != null) { handle = getPackageFragmentRoot().getHandleIdentifier(); } node.setAttribute("handleId", handle); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
Document doc = DebugPlugin.newDocument(); Element config = doc.createElement("libraryInfos"); //$NON-NLS-1$ doc.appendChild(config);
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaPackageFragmentRootSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); String handle = ""; //$NON-NLS-1$ if (getPackageFragmentRoot() != null) { handle = getPackageFragmentRoot().getHandleIdentifier(); } node.setAttribute("handleId", handle); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public synchronized String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element rootNode = doc.createElement(DIRECTOR_ROOT_NODE); doc.appendChild(rootNode); Element pathNode = doc.createElement(CONTAINERS_NODE); if(fDuplicates) { pathNode.setAttribute(DUPLICATES_ATTR, "true"); //$NON-NLS-1$ } else { pathNode.setAttribute(DUPLICATES_ATTR, "false"); //$NON-NLS-1$ } rootNode.appendChild(pathNode); if(fSourceContainers !=null){ for(int i=0; i<fSourceContainers.length; i++){ Element node = doc.createElement(CONTAINER_NODE); ISourceContainer container = fSourceContainers[i]; ISourceContainerType type = container.getType(); node.setAttribute(CONTAINER_TYPE_ATTR, type.getId()); node.setAttribute(CONTAINER_MEMENTO_ATTR, type.getMemento(container)); pathNode.appendChild(node); } } return DebugPlugin.serializeDocument(doc); }
/** * Save view binding settings that differ from extension settings */ private void saveViewBindings() { try { Document document = DebugPlugin.newDocument(); Element root = document.createElement(XML_ELEMENT_VIEW_BINDINGS); document.appendChild(root); Set<String> done = new HashSet<>(); for (DebugContextViewBindings binding : fContextIdsToBindings.values()) { binding.saveBindings(document, root, done); } String prefValue = IInternalDebugCoreConstants.EMPTY_STRING; if (root.hasChildNodes()) { prefValue = DebugPlugin.serializeDocument(document); } fIgnoreChanges = true; DebugUITools.getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS, prefValue); } catch (CoreException e) { DebugUIPlugin.log(e); } finally { fIgnoreChanges = false; } }
Document doc = DebugPlugin.newDocument(); Element config = doc.createElement("vmSettings"); //$NON-NLS-1$ doc.appendChild(config);
int count = 0; try { Document doc = DebugPlugin.newDocument(); Element envs = doc.createElement(DEFAULT_ENVIRONMENTS); doc.appendChild(envs);
int count = 0; try { Document doc = DebugPlugin.newDocument(); Element envs = doc.createElement(DEFAULT_ENVIRONMENTS); doc.appendChild(envs);