diff options
author | nitind | 2011-03-02 15:27:00 +0000 |
---|---|---|
committer | nitind | 2011-03-02 15:27:00 +0000 |
commit | 0bc10cc56f010247a7a473af8e1b2d2782457a74 (patch) | |
tree | 8b5ebc8cbf894e1257acbd7549f1db3f7835bd50 /bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java | |
parent | 9039eeb528e8460702d9820f089c077f10c70ea5 (diff) | |
download | webtools.sourceediting-201103021533.tar.gz webtools.sourceediting-201103021533.tar.xz webtools.sourceediting-201103021533.zip |
This commit was manufactured by cvs2svn to create tag 'v201103021533'.v201103021533
Diffstat (limited to 'bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java')
-rw-r--r-- | bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java deleted file mode 100644 index c06af5e212..0000000000 --- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.core.internal.commentelement; - - - -import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; -import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementConfiguration; -import org.eclipse.wst.xml.core.internal.document.TagAdapter; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; - - -/** - */ -public class CommentElementAdapter implements TagAdapter { - private CommentElementConfiguration fConfiguration; - - private boolean fEndTag; - private CommentElementHandler fHandler; - - public CommentElementAdapter(boolean isEndTag, CommentElementHandler handler) { - fEndTag = isEndTag; - fHandler = handler; - } - - private String generateCommentClose(IDOMElement element) { - return (element.isJSPTag()) ? "--%>" : "-->"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - private String generateCommentOpen(IDOMElement element) { - return (element.isJSPTag()) ? "<%--" : "<!--"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - private CommentElementConfiguration getConfiguration() { - return fConfiguration; - } - - public String getEndTag(IDOMElement element) { - String content = fHandler.generateEndTagContent(element); - if (content == null) { - return null; - } - StringBuffer buffer = new StringBuffer(); - - buffer.append(generateCommentOpen(element)); - buffer.append(content); - buffer.append(generateCommentClose(element)); - - return buffer.toString(); - } - - public String getHandlerID() { - return getConfiguration().getHandlerID(); - } - - - public String getProperty(String name) { - return getConfiguration().getProperty(name); - } - - public String getStartTag(IDOMElement element) { - String content = fHandler.generateStartTagContent(element); - if (content == null) { - return null; - } - StringBuffer buffer = new StringBuffer(); - - buffer.append(generateCommentOpen(element)); - buffer.append(content); - buffer.append(generateCommentClose(element)); - - return buffer.toString(); - } - - public boolean isAdapterForType(Object type) { - return (type == CommentElementAdapter.class || type == TagAdapter.class); - } - - public boolean isContainer() { - return (!fHandler.isEmpty()); - } - - public boolean isEndTag() { - return fEndTag; - } - - public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) { - } - - public void setConfiguration(CommentElementConfiguration configuration) { - fConfiguration = configuration; - } -} |