Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hiesserich2013-08-09 13:35:50 -0400
committerCarsten Hiesserich2013-08-21 04:33:44 -0400
commita6134fcbdde2666a98efc305be1127c9c873d9f6 (patch)
tree821013a9cda21c8c3ba715a85ac180d8642a063d /org.eclipse.vex.docbook
parent5660b2f57675b3bd5428ad749512953299a2107d (diff)
downloadorg.eclipse.mylyn.docs.vex-a6134fcbdde2666a98efc305be1127c9c873d9f6.tar.gz
org.eclipse.mylyn.docs.vex-a6134fcbdde2666a98efc305be1127c9c873d9f6.tar.xz
org.eclipse.mylyn.docs.vex-a6134fcbdde2666a98efc305be1127c9c873d9f6.zip
Removed DocBookOutlineProvider. DocBook uses DefaultOutlineProvider now.
Change-Id: Ibe77cfc6799263529df5afde92f10bfcae7a9894 Signed-off-by: Carsten Hiesserich <carsten.hie@gmail.com>
Diffstat (limited to 'org.eclipse.vex.docbook')
-rw-r--r--org.eclipse.vex.docbook/.classpath13
-rw-r--r--org.eclipse.vex.docbook/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.vex.docbook/build.properties1
-rw-r--r--org.eclipse.vex.docbook/plugin.xml5
-rw-r--r--org.eclipse.vex.docbook/src/org/eclipse/vex/docbook/DocBookOutlineProvider.java242
-rw-r--r--org.eclipse.vex.docbook/styles/docbook-plain.css9
-rw-r--r--org.eclipse.vex.docbook/styles/vex-outline.css34
7 files changed, 46 insertions, 259 deletions
diff --git a/org.eclipse.vex.docbook/.classpath b/org.eclipse.vex.docbook/.classpath
index a9558867..76ed9a7d 100644
--- a/org.eclipse.vex.docbook/.classpath
+++ b/org.eclipse.vex.docbook/.classpath
@@ -1,7 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.vex.docbook/META-INF/MANIFEST.MF b/org.eclipse.vex.docbook/META-INF/MANIFEST.MF
index b49b49ac..8759d7d7 100644
--- a/org.eclipse.vex.docbook/META-INF/MANIFEST.MF
+++ b/org.eclipse.vex.docbook/META-INF/MANIFEST.MF
@@ -11,6 +11,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.4.1,3.0.0)",
org.eclipse.wst.xml.core
Bundle-Localization: plugin
-Export-Package: org.eclipse.vex.docbook
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
diff --git a/org.eclipse.vex.docbook/build.properties b/org.eclipse.vex.docbook/build.properties
index 25654737..93ada841 100644
--- a/org.eclipse.vex.docbook/build.properties
+++ b/org.eclipse.vex.docbook/build.properties
@@ -8,6 +8,5 @@ bin.includes = plugin.xml,\
src.includes = styles/,\
4.5/,\
5.0/
-source.. = src/
jars.compile.order = .
diff --git a/org.eclipse.vex.docbook/plugin.xml b/org.eclipse.vex.docbook/plugin.xml
index 483aa509..1079b51e 100644
--- a/org.eclipse.vex.docbook/plugin.xml
+++ b/org.eclipse.vex.docbook/plugin.xml
@@ -68,7 +68,6 @@
name="%doctype.docbook4_5"
point="org.eclipse.vex.ui.doctypes">
<doctype
- outlineProvider="org.eclipse.vex.docbook.DocBookOutlineProvider"
publicId="-//OASIS//DTD DocBook XML V4.5//EN"
systemId="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
@@ -110,7 +109,6 @@
name="%doctype.docbook5_0_DTD"
point="org.eclipse.vex.ui.doctypes">
<doctype
- outlineProvider="org.eclipse.vex.docbook.DocBookOutlineProvider"
publicId="-//OASIS//DTD DocBook XML 5.0//EN"
systemId="http://www.oasis-open.org/docbook/xml/5.0/docbook.dtd">
@@ -152,7 +150,6 @@
name="%doctype.docbook5_0_XSD1"
point="org.eclipse.vex.ui.doctypes">
<doctype
- outlineProvider="org.eclipse.vex.docbook.DocBookOutlineProvider"
publicId="http://www.oasis-open.org/docbook/xml/5.0/xsd/docbook.xsd"
systemId="5.0/xsd/docbook.xsd">
@@ -194,7 +191,6 @@
name="%doctype.docbook5_0_XSD2"
point="org.eclipse.vex.ui.doctypes">
<doctype
- outlineProvider="org.eclipse.vex.docbook.DocBookOutlineProvider"
publicId="http://docbook.org/xml/5.0/xsd/docbook.xsd"
systemId="5.0/xsd/docbook.xsd">
@@ -236,7 +232,6 @@
name="%doctype.docbook5_0_XSD3"
point="org.eclipse.vex.ui.doctypes">
<doctype
- outlineProvider="org.eclipse.vex.docbook.DocBookOutlineProvider"
publicId="http://docbook.org/ns/docbook"
systemId="5.0/xsd/docbook.xsd">
diff --git a/org.eclipse.vex.docbook/src/org/eclipse/vex/docbook/DocBookOutlineProvider.java b/org.eclipse.vex.docbook/src/org/eclipse/vex/docbook/DocBookOutlineProvider.java
deleted file mode 100644
index ea3cde04..00000000
--- a/org.eclipse.vex.docbook/src/org/eclipse/vex/docbook/DocBookOutlineProvider.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 John Krasnay 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:
- * John Krasnay - initial API and implementation
- * Igor Jacy Lino Campista - Java 5 warnings fixed (bug 311325)
- *******************************************************************************/
-package org.eclipse.vex.docbook;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.vex.core.provisional.dom.Filters;
-import org.eclipse.vex.core.provisional.dom.IDocument;
-import org.eclipse.vex.core.provisional.dom.IElement;
-import org.eclipse.vex.ui.internal.editor.VexEditor;
-import org.eclipse.vex.ui.internal.outline.IOutlineProvider;
-
-/**
- * Provides an outline of the sections of a DocBook document.
- */
-public class DocBookOutlineProvider implements IOutlineProvider {
-
- public void init(final VexEditor editor) {
- }
-
- public ITreeContentProvider getContentProvider() {
- return contentProvider;
- }
-
- public IBaseLabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- public IElement getOutlineElement(final IElement child) {
- IElement element = child;
- while (element.getParentElement() != null && !isTitledElement(element)) {
- element = element.getParentElement();
- }
-
- return element;
- }
-
- private final ITreeContentProvider contentProvider = new ITreeContentProvider() {
-
- public void dispose() {
- }
-
- public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
- }
-
- public Object[] getChildren(final Object parentElement) {
- return getOutlineChildren((IElement) parentElement);
- }
-
- public Object getParent(final Object element) {
- final IElement parent = ((IElement) element).getParentElement();
- if (parent == null) {
- return element;
- } else {
- return getOutlineElement(parent);
- }
- }
-
- public boolean hasChildren(final Object element) {
- return getOutlineChildren((IElement) element).length > 0;
- }
-
- public Object[] getElements(final Object inputElement) {
- final IDocument document = (IDocument) inputElement;
- return new Object[] { document.getRootElement() };
- }
-
- };
-
- /**
- * Returns an array of the children of the given element that represent nodes in the outline. These are elements
- * such as "section" that contain "title" elements that we can use as label content.
- *
- * @param element
- * @return
- */
- private IElement[] getOutlineChildren(final IElement element) {
- final List<IElement> children = new ArrayList<IElement>();
- for (final IElement child : element.childElements()) {
- if (titledElements.contains(child.getLocalName())) {
- children.add(child);
- }
- }
- return children.toArray(new IElement[children.size()]);
- }
-
- private final ILabelProvider labelProvider = new LabelProvider() {
- @Override
- public String getText(final Object o) {
- final IElement e = (IElement) o;
- IElement titleChild = findChild(e, "title");
- if (titleChild != null) {
- return titleChild.getText();
- } else {
- final IElement infoChild = findChild(e, e.getLocalName() + "info");
- if (infoChild != null) {
- titleChild = findChild(infoChild, "title");
- if (titleChild != null) {
- return titleChild.getText();
- }
- }
- }
- return e.getLocalName();
- }
- };
-
- /**
- * Returns a value from a map of tag names that contain title elements The tags all have a similar characteristic.
- * Their content model includes a <title/> element as the first or second child.
- *
- * For simplicity, we assume that the document is valid w.r.t. the DTD and thus the 'title' element is optional and
- * is one of the first two elements inside the given element.
- *
- * @param element
- * @return
- */
- private boolean isTitledElement(final IElement element) {
- if (titledElements.contains(element.getLocalName()) || element.getParent() == null) {
- return !element.childElements().to(1).matching(Filters.elementsNamed("title")).isEmpty();
- }
- return false;
- }
-
- /**
- * Finds the first child of the given element with the given name. Returns null if none found. We should move this
- * to XPath when we gain that facility.
- */
- private IElement findChild(final IElement parent, final String childName) {
- for (final IElement child : parent.childElements().matching(Filters.elementsNamed(childName))) {
- return child;
- }
- return null;
- }
-
- private final static int MAPSIZE = 101; // prime greater than 65/.80
-
- private final static HashSet<String> titledElements = new HashSet<String>(MAPSIZE);
-
- static {
- // Comment on each line indicates tags content model if different than title
- // We are only interested in location of title tag within Content Model
- // so any extra following content is ignored.
-
- // In general, it is impossible to keep this sort of table accurate and
- // up-to-date for more than the most basic of cases. It would be better
- // to extract this information from the DTD for the document.
-
- // For the moment, it is observed that this imperfect method works for
- // vast majority of DocBook documents.
-
- titledElements.add("abstract"); // title?
- titledElements.add("article");
- // titledElements.add("articleinfo");
- titledElements.add("appendix");
- // titledElements.add("authorblurb"); // title?
- // titledElements.add("bibliodiv");
- // titledElements.add("calloutlist");
- // titledElements.add("caution"); // title?
- titledElements.add("chapter"); // docinfo?, title
- // titledElements.add("colophon");
- // titledElements.add("constraintdef");
- // titledElements.add("dedication");
-
- // titledElements.add("equation"); // blockinfo?, title
- // titledElements.add("example"); // blockinfo?, title
- // titledElements.add("figure"); // blockinfo?, title
- titledElements.add("glossary"); // glossaryinfo?, title
- // titledElements.add("glossdiv");
- // titledElements.add("glosslist"); // blockinfo?, title
- // titledElements.add("important"); // title?
- // titledElements.add("index"); // indexinfo, title
- // titledElements.add("indexdiv");
- // titledElements.add("itemizedlist"); // blockinfo?, title
-
- // titledElements.add("legalnotice"); // blockinfo?, title
- // titledElements.add("lot"); // beginpage?, title
- // titledElements.add("msg"); // title?
- // titledElements.add("msgexplan"); // title?
- // titledElements.add("msgmain"); // title?
- // titledElements.add("msgrel"); // title?
- // titledElements.add("msgset");
- // titledElements.add("msgsub"); // title?
- // titledElements.add("note"); // title?
- // titledElements.add("orderedlist"); // blockinfo?, title
-
- titledElements.add("part"); // beginpage?, partinfo?, title
- titledElements.add("partintro");
- // titledElements.add("personblurb"); // title?
- titledElements.add("preface"); // beginpage?, prefaceinfo?, title
- // titledElements.add("procedure"); // blockinfo?, title
- // titledElements.add("productionset");
- // titledElements.add("qandadiv"); // blockinfo?, title
- // titledElements.add("qandaset"); // blockinfo?, title
- // titledElements.add("reference"); // beginpage?, referenceinfo?, title
- // titledElements.add("refsect1"); // refsect1info?, title
-
- // titledElements.add("refsect2"); // refsect2info, title
- // titledElements.add("refsect3"); // refsect3info, title
- // titledElements.add("refsection"); // refsectioninfo?, title
- // titledElements.add("refsynopsisdiv"); // refsynopsisdivinfo?, title
- titledElements.add("sect1"); // sect1info?, title
- titledElements.add("sect2"); // sect2info?, title
- titledElements.add("sect3"); // sect3info?, title
- titledElements.add("sect4"); // sect4info?, title
- titledElements.add("sect5"); // sect5info?, title
- titledElements.add("section"); // sectioninfo?, title
-
- // titledElements.add("segmentedlist");
- // titledElements.add("set");
- // titledElements.add("setindex"); // setindexinfo?, title
- // titledElements.add("sidebar"); // sidebarinfo?, title
- titledElements.add("simplesect");
- // titledElements.add("step"); // table?
- // titledElements.add("table"); // blockinfo?, title
- // titledElements.add("task"); // blockinfo?, title
- // titledElements.add("taskprerequisites");// blockinfo?, title
- // titledElements.add("taskrelated"); // blockinfo?, title
-
- // titledElements.add("tasksummary"); // blockinfo?, title
- // titledElements.add("tip"); // title?
- titledElements.add("toc"); // beginpage?, title
- // titledElements.add("variablelist"); // blockinfo?, title
- // titledElements.add("warning"); // title?
- }
-
-}
diff --git a/org.eclipse.vex.docbook/styles/docbook-plain.css b/org.eclipse.vex.docbook/styles/docbook-plain.css
index 52dd96d3..55400547 100644
--- a/org.eclipse.vex.docbook/styles/docbook-plain.css
+++ b/org.eclipse.vex.docbook/styles/docbook-plain.css
@@ -4,13 +4,16 @@
* 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:
* John Krasnay - initial API and implementation
* Carsten Hiesserich - correct formatting of verbatim elements (bug 407828)
+ * Carsten Hiesserich - added vex-outline import
*******************************************************************************/
-
- abbrev {
+
+@import url(vex-outline.css);
+
+abbrev {
display: inline;
}
diff --git a/org.eclipse.vex.docbook/styles/vex-outline.css b/org.eclipse.vex.docbook/styles/vex-outline.css
new file mode 100644
index 00000000..41cd0939
--- /dev/null
+++ b/org.eclipse.vex.docbook/styles/vex-outline.css
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Carsten Hiesserich 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:
+ * Carsten Hiesserich - initial API and implementation
+ *******************************************************************************/
+
+book,part,article,chapter,toc,preface,appendix {
+ _vex-outline-content: titleabbrev, title;
+}
+
+section,sect1,sect2,sect3,sect4,sect5,simplesect {
+ _vex-outline-content: titleabbrev, title;
+}
+
+example,info {
+ _vex-outline-content: titleabbrev, title;
+}
+
+orderedlist,itemizedlist {
+ _vex-outline-content: titleabbrev, title;
+}
+
+imagedata,textdata {
+ _vex-outline-content: attr(fileref),info,none;
+}
+
+table {
+ _vex-outline-content: title,caption,none;
+} \ No newline at end of file

Back to the top