Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CommentHistoryContentHandler.java')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CommentHistoryContentHandler.java85
1 files changed, 0 insertions, 85 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CommentHistoryContentHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CommentHistoryContentHandler.java
deleted file mode 100644
index f3f3d58f2..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CommentHistoryContentHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.team.internal.ccvs.ui.repo;
-
-import java.util.Vector;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.Attributes;
-
-class CommentHistoryContentHandler extends DefaultHandler {
-
- private StringBuffer buffer;
- private Vector comments;
- public CommentHistoryContentHandler() {
- }
-
- /**
- * @see ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] chars, int startIndex, int length) throws SAXException {
- if (buffer == null) return;
- buffer.append(chars, startIndex, length);
- }
-
- /**
- * @see ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(
- String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException {
-
- String elementName = getElementName(namespaceURI, localName, qName);
- if (elementName.equals(RepositoryManager.ELEMENT_COMMIT_COMMENT)) {
- buffer = new StringBuffer();
- return;
- }
- if (elementName.equals(RepositoryManager.ELEMENT_COMMIT_HISTORY)) {
- comments = new Vector(RepositoryManager.MAX_COMMENTS);
- return;
- }
- }
-
- /**
- * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void endElement(String namespaceURI, String localName, String qName) {
- String elementName = getElementName(namespaceURI, localName, qName);
- if (elementName.equals(RepositoryManager.ELEMENT_COMMIT_COMMENT)) {
- comments.add(buffer.toString());
- buffer = null;
- return;
- }
- if (elementName.equals(RepositoryManager.ELEMENT_COMMIT_HISTORY)) {
- RepositoryManager.previousComments = new String[comments.size()];
- comments.copyInto(RepositoryManager.previousComments);
- return;
- }
- }
-
- /*
- * Couldn't figure out from the SAX API exactly when localName vs. qName is used.
- * However, the XML for project sets doesn't use namespaces so either of the two names
- * is fine. Therefore, use whichever one is provided.
- */
- private String getElementName(String namespaceURI, String localName, String qName) {
- if (localName != null && localName.length() > 0) {
- return localName;
- } else {
- return qName;
- }
- }
-}

Back to the top