Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticleFactory.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Context.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ExternalTarget.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/JavaElement.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleDoclet.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleFactoryImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ContextImpl.java45
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ExternalTargetImpl.java98
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/JavaElementImpl.java109
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/HtmlWriter.java8
20 files changed, 466 insertions, 115 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticleFactory.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticleFactory.java
index 7de983686a..9d5378d94e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticleFactory.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticleFactory.java
@@ -8,10 +8,6 @@ package org.eclipse.emf.cdo.releng.doc.article;
import org.eclipse.emf.ecore.EFactory;
-import com.sun.javadoc.RootDoc;
-
-import java.io.File;
-
/**
* <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each non-abstract class of
* the model. <!-- end-user-doc -->
@@ -44,8 +40,6 @@ public interface ArticleFactory extends EFactory
*/
Context createContext();
- Context createContext(RootDoc root, File baseFolder, String project);
-
/**
* Returns a new object of class '<em>Category</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
index edf0610a34..78e95e89ed 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
@@ -1157,13 +1157,21 @@ public interface ArticlePackage extends EPackage
int JAVA_ELEMENT__LABEL = LINK_TARGET__LABEL;
/**
+ * The feature id for the '<em><b>Class File</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int JAVA_ELEMENT__CLASS_FILE = LINK_TARGET_FEATURE_COUNT + 0;
+
+ /**
* The number of structural features of the '<em>Java Element</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
- int JAVA_ELEMENT_FEATURE_COUNT = LINK_TARGET_FEATURE_COUNT + 0;
+ int JAVA_ELEMENT_FEATURE_COUNT = LINK_TARGET_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.releng.doc.article.impl.CalloutImpl <em>Callout</em>}'
@@ -1227,13 +1235,21 @@ public interface ArticlePackage extends EPackage
int EXTERNAL_TARGET__LABEL = LINK_TARGET__LABEL;
/**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXTERNAL_TARGET__URL = LINK_TARGET_FEATURE_COUNT + 0;
+
+ /**
* The number of structural features of the '<em>External Target</em>' class. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
- int EXTERNAL_TARGET_FEATURE_COUNT = LINK_TARGET_FEATURE_COUNT + 0;
+ int EXTERNAL_TARGET_FEATURE_COUNT = LINK_TARGET_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.releng.doc.article.impl.TextImpl <em>Text</em>}' class. <!--
@@ -1428,6 +1444,14 @@ public interface ArticlePackage extends EPackage
int SOURCE_CODE__LABEL = EXTERNAL_TARGET__LABEL;
/**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SOURCE_CODE__URL = EXTERNAL_TARGET__URL;
+
+ /**
* The number of structural features of the '<em>Source Code</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -1678,6 +1702,17 @@ public interface ArticlePackage extends EPackage
EClass getJavaElement();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.doc.article.JavaElement#getClassFile
+ * <em>Class File</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Class File</em>'.
+ * @see org.eclipse.emf.cdo.releng.doc.article.JavaElement#getClassFile()
+ * @see #getJavaElement()
+ * @generated
+ */
+ EAttribute getJavaElement_ClassFile();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.doc.article.StructuralElement
* <em>Structural Element</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1869,6 +1904,17 @@ public interface ArticlePackage extends EPackage
EClass getExternalTarget();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.doc.article.ExternalTarget#getUrl
+ * <em>Url</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.emf.cdo.releng.doc.article.ExternalTarget#getUrl()
+ * @see #getExternalTarget()
+ * @generated
+ */
+ EAttribute getExternalTarget_Url();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.doc.article.Identifiable
* <em>Identifiable</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2288,6 +2334,14 @@ public interface ArticlePackage extends EPackage
EClass JAVA_ELEMENT = eINSTANCE.getJavaElement();
/**
+ * The meta object literal for the '<em><b>Class File</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute JAVA_ELEMENT__CLASS_FILE = eINSTANCE.getJavaElement_ClassFile();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.releng.doc.article.impl.StructuralElementImpl
* <em>Structural Element</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2434,6 +2488,14 @@ public interface ArticlePackage extends EPackage
EClass EXTERNAL_TARGET = eINSTANCE.getExternalTarget();
/**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute EXTERNAL_TARGET__URL = eINSTANCE.getExternalTarget_Url();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.releng.doc.article.Identifiable
* <em>Identifiable</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Context.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Context.java
index 11d7113fc1..05dc725739 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Context.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Context.java
@@ -103,4 +103,6 @@ public interface Context extends EObject
void register(Object id, Object value);
Object lookup(Object id);
+
+ String getExternalLink(String packageName);
} // Context
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ExternalTarget.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ExternalTarget.java
index 6e3137479e..6fc19101e7 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ExternalTarget.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ExternalTarget.java
@@ -8,6 +8,12 @@ package org.eclipse.emf.cdo.releng.doc.article;
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>External Target</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.doc.article.ExternalTarget#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getExternalTarget()
* @model
@@ -15,4 +21,18 @@ package org.eclipse.emf.cdo.releng.doc.article;
*/
public interface ExternalTarget extends LinkTarget
{
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Url</em>' attribute isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getExternalTarget_Url()
+ * @model changeable="false"
+ * @generated
+ */
+ String getUrl();
} // ExternalTarget
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/JavaElement.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/JavaElement.java
index 719e289cf3..592869e63f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/JavaElement.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/JavaElement.java
@@ -6,8 +6,16 @@
*/
package org.eclipse.emf.cdo.releng.doc.article;
+import java.io.File;
+
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>Java Element</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.doc.article.JavaElement#getClassFile <em>Class File</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getJavaElement()
* @model
@@ -15,4 +23,19 @@ package org.eclipse.emf.cdo.releng.doc.article;
*/
public interface JavaElement extends LinkTarget
{
+
+ /**
+ * Returns the value of the '<em><b>Class File</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Class File</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Class File</em>' attribute.
+ * @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getJavaElement_ClassFile()
+ * @model dataType="org.eclipse.emf.cdo.releng.doc.article.File" changeable="false"
+ * @generated
+ */
+ File getClassFile();
} // JavaElement
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleDoclet.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleDoclet.java
index 8033bcf993..3cf8563a3f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleDoclet.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleDoclet.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.releng.doc.article.impl;
-import org.eclipse.emf.cdo.releng.doc.article.ArticleFactory;
import org.eclipse.emf.cdo.releng.doc.article.Context;
import org.eclipse.emf.cdo.releng.doc.article.Documentation;
import org.eclipse.emf.cdo.releng.doc.article.util.ArticleException;
@@ -32,9 +31,11 @@ public class ArticleDoclet
public static final String OPTION_PRIVATE = "-private";
+ public static final String OPTION_BASE_FOLDER = "-basefolder";
+
public static final String OPTION_PROJECT = "-project";
- public static final String OPTION_BASE_FOLDER = "-basefolder";
+ public static final String OPTION_EXTERNALS = "-externals";
public static boolean hasOption(RootDoc root, String optionName)
{
@@ -125,6 +126,11 @@ public class ArticleDoclet
return 2;
}
+ if (OPTION_EXTERNALS.equals(option))
+ {
+ return 2;
+ }
+
// Indicate we don't know about it
return -1;
}
@@ -157,8 +163,9 @@ public class ArticleDoclet
File baseFolder = new File(getOption(root, OPTION_BASE_FOLDER));
String project = getOption(root, OPTION_PROJECT);
+ String externals = getOption(root, OPTION_EXTERNALS);
- Context context = ArticleFactory.eINSTANCE.createContext(root, baseFolder, project);
+ Context context = new ContextImpl(root, baseFolder, project, externals);
Documentation documentation = context.getDocumentation();
documentation.generate();
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleFactoryImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleFactoryImpl.java
index 9c2ea87fe6..6fd47b46d1 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleFactoryImpl.java
@@ -31,8 +31,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import com.sun.javadoc.RootDoc;
-
import java.io.File;
/**
@@ -176,11 +174,6 @@ public class ArticleFactoryImpl extends EFactoryImpl implements ArticleFactory
return context;
}
- public Context createContext(RootDoc root, File baseFolder, String project)
- {
- return new ContextImpl(root, baseFolder, project);
- }
-
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleImpl.java
index 6696efa1c2..157b63c4fd 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticleImpl.java
@@ -9,6 +9,7 @@ package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.Article;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
+import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.cdo.releng.doc.article.util.HtmlWriter;
import org.eclipse.emf.ecore.EClass;
@@ -68,7 +69,7 @@ public class ArticleImpl extends ChapterImpl implements Article
}
finally
{
- HtmlWriter.close(out);
+ ArticleUtil.close(out);
}
}
} // ArticleImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
index a09a4427b8..319b36f372 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
@@ -483,6 +483,16 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
*
* @generated
*/
+ public EAttribute getJavaElement_ClassFile()
+ {
+ return (EAttribute)javaElementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EClass getStructuralElement()
{
return structuralElementEClass;
@@ -653,6 +663,16 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
*
* @generated
*/
+ public EAttribute getExternalTarget_Url()
+ {
+ return (EAttribute)externalTargetEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EClass getIdentifiable()
{
return identifiableEClass;
@@ -915,6 +935,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
factoryEClass = createEClass(FACTORY);
javaElementEClass = createEClass(JAVA_ELEMENT);
+ createEAttribute(javaElementEClass, JAVA_ELEMENT__CLASS_FILE);
structuralElementEClass = createEClass(STRUCTURAL_ELEMENT);
createEReference(structuralElementEClass, STRUCTURAL_ELEMENT__CHILDREN);
@@ -937,6 +958,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
createEReference(embeddableElementEClass, EMBEDDABLE_ELEMENT__DOCUMENTATION);
externalTargetEClass = createEClass(EXTERNAL_TARGET);
+ createEAttribute(externalTargetEClass, EXTERNAL_TARGET__URL);
identifiableEClass = createEClass(IDENTIFIABLE);
createEAttribute(identifiableEClass, IDENTIFIABLE__ID);
@@ -1063,6 +1085,8 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
initEClass(javaElementEClass, JavaElement.class, "JavaElement", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getJavaElement_ClassFile(), this.getFile(), "classFile", null, 0, 1, JavaElement.class,
+ !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(structuralElementEClass, StructuralElement.class, "StructuralElement", IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
@@ -1117,6 +1141,8 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
initEClass(externalTargetEClass, ExternalTarget.class, "ExternalTarget", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getExternalTarget_Url(), ecorePackage.getEString(), "url", null, 0, 1, ExternalTarget.class,
+ !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(identifiableEClass, Identifiable.class, "Identifiable", IS_ABSTRACT, IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
index abc309c392..5c1fbdf45e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
@@ -94,9 +94,7 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
public Body getBody()
{
if (eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__BODY)
- {
return null;
- }
return (Body)eContainer();
}
@@ -118,32 +116,22 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
*/
public void setBody(Body newBody)
{
- if (newBody != eInternalContainer() || eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__BODY
- && newBody != null)
+ if (newBody != eInternalContainer()
+ || (eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__BODY && newBody != null))
{
if (EcoreUtil.isAncestor(this, newBody))
- {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- }
NotificationChain msgs = null;
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
if (newBody != null)
- {
msgs = ((InternalEObject)newBody).eInverseAdd(this, ArticlePackage.BODY__ELEMENTS, Body.class, msgs);
- }
msgs = basicSetBody(newBody, msgs);
if (msgs != null)
- {
msgs.dispatch();
- }
}
else if (eNotificationRequired())
- {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.BODY_ELEMENT__BODY, newBody, newBody));
- }
}
/**
@@ -171,9 +159,7 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
public Callout getCallout()
{
if (eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__CALLOUT)
- {
return null;
- }
return (Callout)eContainer();
}
@@ -195,33 +181,23 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
*/
public void setCallout(Callout newCallout)
{
- if (newCallout != eInternalContainer() || eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__CALLOUT
- && newCallout != null)
+ if (newCallout != eInternalContainer()
+ || (eContainerFeatureID() != ArticlePackage.BODY_ELEMENT__CALLOUT && newCallout != null))
{
if (EcoreUtil.isAncestor(this, newCallout))
- {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- }
NotificationChain msgs = null;
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
if (newCallout != null)
- {
msgs = ((InternalEObject)newCallout).eInverseAdd(this, ArticlePackage.CALLOUT__ELEMENTS, Callout.class, msgs);
- }
msgs = basicSetCallout(newCallout, msgs);
if (msgs != null)
- {
msgs.dispatch();
- }
}
else if (eNotificationRequired())
- {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.BODY_ELEMENT__CALLOUT, newCallout,
newCallout));
- }
}
/**
@@ -236,15 +212,11 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
{
case ArticlePackage.BODY_ELEMENT__BODY:
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
return basicSetBody((Body)otherEnd, msgs);
case ArticlePackage.BODY_ELEMENT__CALLOUT:
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
return basicSetCallout((Callout)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ContextImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ContextImpl.java
index 6a0f706701..614f849036 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ContextImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ContextImpl.java
@@ -23,7 +23,12 @@ import org.eclipse.emf.ecore.util.InternalEList;
import com.sun.javadoc.RootDoc;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -108,6 +113,8 @@ public class ContextImpl extends EObjectImpl implements Context
protected final Map<Object, Object> registry = new HashMap<Object, Object>();
+ protected final Map<String, String> externalLinks = new HashMap<String, String>();
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -118,12 +125,38 @@ public class ContextImpl extends EObjectImpl implements Context
super();
}
- ContextImpl(RootDoc root, File baseFolder, String project)
+ ContextImpl(RootDoc root, File baseFolder, String project, String externals)
{
this.root = root;
this.baseFolder = ArticleUtil.canonify(baseFolder);
this.project = project;
+ for (String external : externals.split(";"))
+ {
+ InputStream in = null;
+
+ try
+ {
+ URL url = new URL(external + "/package-list");
+ URLConnection connection = url.openConnection();
+ in = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ String line;
+ while ((line = reader.readLine()) != null)
+ {
+ externalLinks.put(line, external);
+ }
+ }
+ catch (Exception ex)
+ {
+ System.err.println("External link does not point to Javadocs: " + external);
+ }
+ finally
+ {
+ ArticleUtil.close(in);
+ }
+ }
+
new DocumentationImpl(this, project);
for (Documentation documentation : getDocumentations())
@@ -367,4 +400,14 @@ public class ContextImpl extends EObjectImpl implements Context
return registry.get(id);
}
+ public String getExternalLink(String packageName)
+ {
+ String link = externalLinks.get(packageName);
+ if (link != null)
+ {
+ return link + "/" + packageName.replace('.', '/');
+ }
+
+ return null;
+ }
} // ContextImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
index ec45a5fa5b..8b80007602 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
@@ -252,9 +252,7 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
public Context getContext()
{
if (eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT)
- {
return null;
- }
return (Context)eContainer();
}
@@ -276,34 +274,24 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
*/
public void setContext(Context newContext)
{
- if (newContext != eInternalContainer() || eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT
- && newContext != null)
+ if (newContext != eInternalContainer()
+ || (eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT && newContext != null))
{
if (EcoreUtil.isAncestor(this, newContext))
- {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- }
NotificationChain msgs = null;
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
if (newContext != null)
- {
msgs = ((InternalEObject)newContext).eInverseAdd(this, ArticlePackage.CONTEXT__DOCUMENTATIONS, Context.class,
msgs);
- }
msgs = basicSetContext(newContext, msgs);
if (msgs != null)
- {
msgs.dispatch();
- }
}
else if (eNotificationRequired())
- {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.DOCUMENTATION__CONTEXT, newContext,
newContext));
- }
}
/**
@@ -359,9 +347,7 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
{
case ArticlePackage.DOCUMENTATION__CONTEXT:
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
return basicSetContext((Context)otherEnd, msgs);
case ArticlePackage.DOCUMENTATION__EMBEDDABLE_ELEMENTS:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getEmbeddableElements()).basicAdd(otherEnd, msgs);
@@ -505,9 +491,7 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
public String toString()
{
if (eIsProxy())
- {
return super.toString();
- }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (project: ");
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ExternalTargetImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ExternalTargetImpl.java
index ea9e6d340e..86a21476a2 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ExternalTargetImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ExternalTargetImpl.java
@@ -7,11 +7,14 @@
package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
+import org.eclipse.emf.cdo.releng.doc.article.Context;
import org.eclipse.emf.cdo.releng.doc.article.ExternalTarget;
import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
import org.eclipse.emf.ecore.EClass;
+import com.sun.javadoc.ClassDoc;
+
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>External Target</b></em>'. <!-- end-user-doc
* -->
@@ -23,6 +26,26 @@ import org.eclipse.emf.ecore.EClass;
public class ExternalTargetImpl extends LinkTargetImpl implements ExternalTarget
{
/**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ private ClassDoc classDoc;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -32,6 +55,13 @@ public class ExternalTargetImpl extends LinkTargetImpl implements ExternalTarget
super();
}
+ ExternalTargetImpl(Context context, ClassDoc classDoc, String url)
+ {
+ this.classDoc = classDoc;
+ this.url = url;
+ context.register(getId(), this);
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -43,18 +73,78 @@ public class ExternalTargetImpl extends LinkTargetImpl implements ExternalTarget
return ArticlePackage.Literals.EXTERNAL_TARGET;
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl()
+ {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case ArticlePackage.EXTERNAL_TARGET__URL:
+ return getUrl();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case ArticlePackage.EXTERNAL_TARGET__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy())
+ {
+ return super.toString();
+ }
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (url: ");
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
@Override
public String linkFrom(StructuralElement source)
{
- // TODO: implement ExternalTargetImpl.linkFrom(source)
- throw new UnsupportedOperationException();
+ return url;
}
@Override
public Object getId()
{
- // TODO: implement ExternalTargetImpl.getId()
- throw new UnsupportedOperationException();
+ return classDoc;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/JavaElementImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/JavaElementImpl.java
index 30d0cdb270..44362535be 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/JavaElementImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/JavaElementImpl.java
@@ -7,14 +7,24 @@
package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
+import org.eclipse.emf.cdo.releng.doc.article.Documentation;
import org.eclipse.emf.cdo.releng.doc.article.JavaElement;
import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
+import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.ecore.EClass;
+import com.sun.javadoc.ClassDoc;
+
+import java.io.File;
+
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Java Element</b></em>'. <!-- end-user-doc -->
* <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.doc.article.impl.JavaElementImpl#getClassFile <em>Class File</em>}</li>
+ * </ul>
* </p>
*
* @generated
@@ -22,6 +32,30 @@ import org.eclipse.emf.ecore.EClass;
public class JavaElementImpl extends LinkTargetImpl implements JavaElement
{
/**
+ * The default value of the '{@link #getClassFile() <em>Class File</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getClassFile()
+ * @generated
+ * @ordered
+ */
+ protected static final File CLASS_FILE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getClassFile() <em>Class File</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getClassFile()
+ * @generated
+ * @ordered
+ */
+ protected File classFile = CLASS_FILE_EDEFAULT;
+
+ private Documentation documentation;
+
+ private ClassDoc classDoc;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -31,6 +65,15 @@ public class JavaElementImpl extends LinkTargetImpl implements JavaElement
super();
}
+ JavaElementImpl(Documentation documentation, ClassDoc classDoc, File classFile)
+ {
+ this.documentation = documentation;
+ this.classDoc = classDoc;
+ this.classFile = classFile;
+
+ this.documentation.getContext().register(getId(), classDoc);
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -42,18 +85,76 @@ public class JavaElementImpl extends LinkTargetImpl implements JavaElement
return ArticlePackage.Literals.JAVA_ELEMENT;
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public File getClassFile()
+ {
+ return classFile;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case ArticlePackage.JAVA_ELEMENT__CLASS_FILE:
+ return getClassFile();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case ArticlePackage.JAVA_ELEMENT__CLASS_FILE:
+ return CLASS_FILE_EDEFAULT == null ? classFile != null : !CLASS_FILE_EDEFAULT.equals(classFile);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (classFile: ");
+ result.append(classFile);
+ result.append(')');
+ return result.toString();
+ }
+
@Override
public String linkFrom(StructuralElement source)
{
- // TODO: implement JavaElementImpl.linkFrom(source)
- throw new UnsupportedOperationException();
+ return ArticleUtil.createLink(source.getOutputFile(), classFile);
}
@Override
public Object getId()
{
- // TODO: implement JavaElementImpl.getId()
- throw new UnsupportedOperationException();
+ return classDoc;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
index fe5c9e3d8b..561d4ca773 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
@@ -10,7 +10,6 @@ import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
import org.eclipse.emf.cdo.releng.doc.article.Body;
import org.eclipse.emf.cdo.releng.doc.article.Link;
import org.eclipse.emf.cdo.releng.doc.article.LinkTarget;
-import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
@@ -51,7 +50,7 @@ public class LinkImpl extends BodyElementImpl implements Link
super();
}
- LinkImpl(Body body, SeeTag tag, StructuralElement target)
+ LinkImpl(Body body, SeeTag tag, LinkTarget target)
{
super(body, tag);
this.target = target;
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
index 0475e1d35f..b4f4b33cd2 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
@@ -228,7 +228,7 @@ public class SnippetImpl extends EmbeddableElementImpl implements Snippet
private void writeHtml(Embedding embedder, PrintWriter out)
{
File source = embedder.getBody().getOutputFile();
- File target = new File(getDocumentation().getOutputFile(), "resources");
+ File target = new File(getDocumentation().getOutputFile().getParentFile(), "images");
String imagePath = ArticleUtil.createLink(source, target) + "/";
Map<String, Object> options = new HashMap<String, Object>();
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
index c35e4dbf3e..f20da7cada 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
@@ -188,9 +188,7 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
public StructuralElement getParent()
{
if (eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT)
- {
return null;
- }
return (StructuralElement)eContainer();
}
@@ -212,34 +210,24 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
*/
public void setParent(StructuralElement newParent)
{
- if (newParent != eInternalContainer() || eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT
- && newParent != null)
+ if (newParent != eInternalContainer()
+ || (eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT && newParent != null))
{
if (EcoreUtil.isAncestor(this, newParent))
- {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- }
NotificationChain msgs = null;
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
if (newParent != null)
- {
msgs = ((InternalEObject)newParent).eInverseAdd(this, ArticlePackage.STRUCTURAL_ELEMENT__CHILDREN,
StructuralElement.class, msgs);
- }
msgs = basicSetParent(newParent, msgs);
if (msgs != null)
- {
msgs.dispatch();
- }
}
else if (eNotificationRequired())
- {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.STRUCTURAL_ELEMENT__PARENT, newParent,
newParent));
- }
}
/**
@@ -360,9 +348,7 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
case ArticlePackage.STRUCTURAL_ELEMENT__PARENT:
if (eInternalContainer() != null)
- {
msgs = eBasicRemoveFromContainer(msgs);
- }
return basicSetParent((StructuralElement)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
@@ -514,9 +500,7 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
public String toString()
{
if (eIsProxy())
- {
return super.toString();
- }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (title: ");
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
index c26cd6c215..0b3170760a 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
@@ -13,8 +13,9 @@ package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.Body;
import org.eclipse.emf.cdo.releng.doc.article.BodyElement;
import org.eclipse.emf.cdo.releng.doc.article.Context;
+import org.eclipse.emf.cdo.releng.doc.article.Documentation;
import org.eclipse.emf.cdo.releng.doc.article.EmbeddableElement;
-import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
+import org.eclipse.emf.cdo.releng.doc.article.LinkTarget;
import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.common.util.EList;
@@ -24,11 +25,15 @@ import com.sun.javadoc.MemberDoc;
import com.sun.javadoc.SeeTag;
import com.sun.javadoc.Tag;
+import java.io.File;
+
/**
* @author Eike Stepper
*/
public class UnresolvedBodyElement extends BodyElementImpl
{
+ private static final boolean DEBUG = false;
+
UnresolvedBodyElement(Body body, Tag tag)
{
super(body, tag);
@@ -36,7 +41,12 @@ public class UnresolvedBodyElement extends BodyElementImpl
public final String getText()
{
- return "<b><code><font color=\"#ff000000\">{" + getTag() + "}</font></code></b>";
+ if (DEBUG)
+ {
+ return "<b><code><font color=\"#ff000000\">{" + getTag() + "}</font></code></b>";
+ }
+
+ return getTag().text();
}
@Override
@@ -51,7 +61,11 @@ public class UnresolvedBodyElement extends BodyElementImpl
if (tag instanceof SeeTag)
{
SeeTag seeTag = (SeeTag)tag;
- return resolveSeeTag(context, seeTag);
+ BodyElement resolved = resolveSeeTag(context, seeTag);
+ if (resolved != null)
+ {
+ return resolved;
+ }
}
System.err.println(ArticleUtil.makeConsoleLink("Warning: Unresolved link " + tag + " in ", tag.position()));
@@ -68,28 +82,56 @@ public class UnresolvedBodyElement extends BodyElementImpl
{
return createBodyElement(tag, target);
}
-
- return this;
}
ClassDoc referencedClass = tag.referencedClass();
if (referencedClass != null)
{
Object target = context.lookup(referencedClass);
+ if (target == null)
+ {
+ target = resolveJavaElement(context, referencedClass, referencedMember);
+ }
+
if (target != null)
{
return createBodyElement(tag, target);
}
}
- return this;
+ return null;
+ }
+
+ private Object resolveJavaElement(Context context, ClassDoc classDoc, MemberDoc memberDoc)
+ {
+ String packageName = classDoc.containingPackage().name();
+ for (Documentation documentation : context.getDocumentations())
+ {
+ File projectFolder = documentation.getOutputFile().getParentFile();
+ File javadocFolder = new File(projectFolder, "javadoc");
+ File packageFolder = new File(javadocFolder, packageName.replace('.', '/'));
+ File classFile = new File(packageFolder, classDoc.typeName() + ".html");
+ if (classFile.isFile())
+ {
+ return new JavaElementImpl(documentation, classDoc, classFile);
+ }
+ }
+
+ String externalLink = context.getExternalLink(packageName);
+ if (externalLink != null)
+ {
+ String url = externalLink + "/" + classDoc.typeName() + ".html";
+ return new ExternalTargetImpl(context, classDoc, url);
+ }
+
+ return null;
}
private BodyElement createBodyElement(SeeTag tag, Object target)
{
- if (target instanceof StructuralElement)
+ if (target instanceof LinkTarget)
{
- return new LinkImpl(null, tag, (StructuralElement)target);
+ return new LinkImpl(null, tag, (LinkTarget)target);
}
if (target instanceof EmbeddableElement)
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
index 9dc33eb34c..297dd76690 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
@@ -19,6 +19,7 @@ import com.sun.javadoc.RootDoc;
import com.sun.javadoc.SourcePosition;
import com.sun.javadoc.Tag;
+import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -127,6 +128,21 @@ public final class ArticleUtil
return null;
}
+ public static void close(Closeable closeable)
+ {
+ if (closeable != null)
+ {
+ try
+ {
+ closeable.close();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+
public static boolean containsFile(File folder, File file)
{
if (!folder.isDirectory())
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/HtmlWriter.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/HtmlWriter.java
index 11acb2c721..7ded2d2906 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/HtmlWriter.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/HtmlWriter.java
@@ -83,12 +83,4 @@ public class HtmlWriter extends PrintWriter
write(label);
write("</a>");
}
-
- public static void close(HtmlWriter writer)
- {
- if (writer != null)
- {
- writer.close();
- }
- }
}

Back to the top