diff options
author | nsandonato | 2011-03-02 20:53:29 +0000 |
---|---|---|
committer | nsandonato | 2011-03-02 20:53:29 +0000 |
commit | ee046e964ec9dc0eba3a2df4c35b0366b95af58e (patch) | |
tree | eb83502a1ad349c19ae165538e32dfd9907cbd3d /bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui | |
parent | 9039eeb528e8460702d9820f089c077f10c70ea5 (diff) | |
download | webtools.sourceediting-ee046e964ec9dc0eba3a2df4c35b0366b95af58e.tar.gz webtools.sourceediting-ee046e964ec9dc0eba3a2df4c35b0366b95af58e.tar.xz webtools.sourceediting-ee046e964ec9dc0eba3a2df4c35b0366b95af58e.zip |
[109045] [outline] Hide comments in XML outline
Diffstat (limited to 'bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui')
4 files changed, 83 insertions, 1 deletions
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java new file mode 100644 index 0000000000..d41706a5bb --- /dev/null +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2011 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 + * + *******************************************************************************/ +package org.eclipse.wst.xml.ui.views.contentoutline; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.w3c.dom.CDATASection; + +public class XMLCDATASectionFilter extends ViewerFilter { + + public boolean select(Viewer viewer, Object parent, Object element) { + return !(element instanceof CDATASection); + } + +}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java new file mode 100644 index 0000000000..a747c90147 --- /dev/null +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2011 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 + *******************************************************************************/ +package org.eclipse.wst.xml.ui.views.contentoutline; + + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.w3c.dom.Comment; + + +/** + * Filters package declarations + */ +public class XMLCommentFilter extends ViewerFilter { + + /* + * @see ViewerFilter + */ + public boolean select(Viewer viewer, Object parent, Object element) { + return !(element instanceof Comment); + } +} diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java index caecf23ca5..015c8c41c4 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java @@ -266,7 +266,8 @@ public class XMLContentOutlineConfiguration extends AbstractXMLContentOutlineCon * Preference key for Show Attributes */ private final String OUTLINE_SHOW_ATTRIBUTE_PREF = "outline-show-attribute"; //$NON-NLS-1$ - + private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.xml.ui.OutlinePage"; //$NON-NLS-1$ + /** * Create new instance of XMLContentOutlineConfiguration */ @@ -408,4 +409,8 @@ public class XMLContentOutlineConfiguration extends AbstractXMLContentOutlineCon } return filteredSelection; } + + protected String getOutlineFilterTarget(){ + return OUTLINE_FILTER_PREF ; + } } diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java new file mode 100644 index 0000000000..59b74e9b14 --- /dev/null +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2011 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 + *******************************************************************************/ +package org.eclipse.wst.xml.ui.views.contentoutline; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.w3c.dom.ProcessingInstruction; + +public class XMLProcessingInstructionFilter extends ViewerFilter { + + public boolean select(Viewer viewer, Object parent, Object element) { + return !(element instanceof ProcessingInstruction); + } + +}
\ No newline at end of file |