Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-04-23 15:14:04 +0000
committerjames2002-04-23 15:14:04 +0000
commit61a427a3cf4151e1b8676f1ca5ce73b5de6c9a07 (patch)
treeb7fcfa5e787e8b1c77496110e948862c063d158a /bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java
parentdd356eba6e31d73f9b0b9493f2dcf9005a8e143a (diff)
downloadeclipse.platform.team-61a427a3cf4151e1b8676f1ca5ce73b5de6c9a07.tar.gz
eclipse.platform.team-61a427a3cf4151e1b8676f1ca5ce73b5de6c9a07.tar.xz
eclipse.platform.team-61a427a3cf4151e1b8676f1ca5ce73b5de6c9a07.zip
Initial release of project set functionality.
14361: "Project Set" should be "Team Project Set" 14364: Project Sets: would be good to remember last path used 14365: Project set wizard: .psf file suffix 14366: Casing inconsistency in export Project Set wizard 14372: Project Sets: many CVS operations fail after importing
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java')
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java87
1 files changed, 87 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java
new file mode 100644
index 000000000..308680152
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetContentHandler.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2002 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ ******************************************************************************/
+package org.eclipse.team.internal.ui;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ProjectSetContentHandler extends DefaultHandler {
+ boolean inPsf = false;
+ boolean inProvider = false;
+ boolean inProject = false;
+ Map map;
+ String id;
+ List references;
+ boolean isVersionOne = false;
+
+ /**
+ * @see ContentHandler#startElement(String, String, String, Attributes)
+ */
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+ if (localName.equals("psf")) { //$NON-NLS-1$
+ map = new HashMap();
+ inPsf = true;
+ String version = atts.getValue("version"); //$NON-NLS-1$
+ isVersionOne = version.equals("1.0"); //$NON-NLS-1$
+ return;
+ }
+ if (isVersionOne) return;
+ if (localName.equals("provider")) { //$NON-NLS-1$
+ if (!inPsf) throw new SAXException(Policy.bind("ProjectSetContentHandler.Element_provider_must_be_contained_in_element_psf_4")); //$NON-NLS-1$
+ inProvider = true;
+ id = atts.getValue("id"); //$NON-NLS-1$
+ references = new ArrayList();
+ return;
+ }
+ if (localName.equals("project")) { //$NON-NLS-1$
+ if (!inProvider) throw new SAXException(Policy.bind("ProjectSetContentHandler.Element_project_must_be_contained_in_element_provider_7")); //$NON-NLS-1$
+ inProject = true;
+ String reference = atts.getValue("reference"); //$NON-NLS-1$
+ references.add(reference);
+ return;
+ }
+ }
+
+ /**
+ * @see ContentHandler#endElement(String, String, String)
+ */
+ public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+ if (localName.equals("psf")) { //$NON-NLS-1$
+ inPsf = false;
+ return;
+ }
+ if (isVersionOne) return;
+ if (localName.equals("provider")) { //$NON-NLS-1$
+ map.put(id, references);
+ references = null;
+ inProvider = false;
+ return;
+ }
+ if (localName.equals("project")) { //$NON-NLS-1$
+ inProject = false;
+ return;
+ }
+ }
+
+ public Map getReferences() {
+ return map;
+ }
+
+ public boolean isVersionOne() {
+ return isVersionOne;
+ }
+}

Back to the top