Merge branch 'master' into master-juno
diff --git a/features/org.eclipse.gendoc.feature/feature.xml b/features/org.eclipse.gendoc.feature/feature.xml
index 9b5cf90..07c04e1 100644
--- a/features/org.eclipse.gendoc.feature/feature.xml
+++ b/features/org.eclipse.gendoc.feature/feature.xml
@@ -371,4 +371,10 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.gendoc.table"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/META-INF/MANIFEST.MF
index a0f760d..66f6cb0 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/META-INF/MANIFEST.MF
@@ -18,7 +18,8 @@
org.eclipse.emf.edit,
org.eclipse.gendoc.tags.handlers,
org.eclipse.gendoc.tags,
- org.eclipse.gendoc.documents
+ org.eclipse.gendoc.documents,
+ org.eclipse.gendoc.table
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/pom.xml b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/pom.xml
index 1eb5092..6dc474c 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/pom.xml
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/pom.xml
@@ -37,6 +37,7 @@
</acceleoProject>
<packagesToRegister>
<packageToRegister>org.eclipse.emf.ecore.EcorePackage</packageToRegister>
+ <packageToRegister>org.eclipse.gendoc.table.TablePackage</packageToRegister>
</packagesToRegister>
</configuration>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/CommonService.java b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/CommonService.java
index ce999b4..a0c34c5 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/CommonService.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/CommonService.java
@@ -13,7 +13,8 @@
* - Add format service
* Antonio Campesino (Ericsson) - Bug 477381 - [GenDoc] cleanAndFormat produces
* xml-encoded characters.
- *
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net fix bug #515404 :
+ add new method getTableId() to get unique id for a table
*****************************************************************************/
package org.eclipse.gendoc.bundle.acceleo.commons.files;
@@ -44,6 +45,7 @@
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.services.GendocServices;
import org.eclipse.gendoc.services.IGendocDiagnostician;
import org.eclipse.gendoc.services.IRegistryService;
@@ -52,6 +54,8 @@
import org.eclipse.gendoc.tags.handlers.IEMFModelLoaderService;
import org.osgi.framework.Bundle;
+import org.eclipse.gendoc.table.Table;
+
public class CommonService {
@@ -228,7 +232,21 @@
}
return id;
}
-
+
+ /**
+ * Returns a unique table id
+ *
+ * @param table
+ * @return
+ */
+ public static String getTableId(EObject table) {
+ if (table instanceof Table){
+ IDocumentService documentService = GendocServices.getDefault().getService(IDocumentService.class);
+ return documentService.getTableService().getTableId((Table) table);
+ }
+ return null;
+ }
+
/**
* Get the resource containing 'object' and load the resource with same URI
* except for fileExtension, replaced by extensionReplacement
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/commons.mtl b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/commons.mtl
index 7806092..17afa84 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/commons.mtl
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.commons/src/org/eclipse/gendoc/bundle/acceleo/commons/files/commons.mtl
@@ -8,8 +8,9 @@
Contributors:
Anne Haugommard (Atos Origin) anne.haugommard@atosorigin.com - Initial API and implementation
+ Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net fix bug #515404 : add new method getTableId() to get unique id for a table
/]
-[module commons('http://www.eclipse.org/emf/2002/Ecore')/]
+[module commons('http://www.eclipse.org/emf/2002/Ecore','http://www.eclipse.org/gendoc/1.0/table')/]
[comment - Replace special characters inside the given String <, >, &, ', " and replace them by corresponding XML codes/]
[query public clean(arg0 : String) : String
@@ -40,6 +41,10 @@
[query public getId(arg0 : OclAny) : String
= invoke('org.eclipse.gendoc.bundle.acceleo.commons.files.CommonService', 'getId(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
+[comment - returns a unique ID for the element table in parameter/]
+[query public getTableId(arg0 : OclAny) : String
+ = invoke('org.eclipse.gendoc.bundle.acceleo.commons.files.CommonService', 'getTableId(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
+
[comment - load (objet : OclAny, extensionReplacement : String) : String
for a Package p contained in the file located at file://c:/test/file.uml
the call : p.load('notation') will load the file located at file://c:/test/file.notation /]
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.gmf/src/org/eclipse/gendoc/bundle/acceleo/gmf/service/GMFServices.java b/plugins/org.eclipse.gendoc.bundle.acceleo.gmf/src/org/eclipse/gendoc/bundle/acceleo/gmf/service/GMFServices.java
index 5bbdfe9..e8e7d3e 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.gmf/src/org/eclipse/gendoc/bundle/acceleo/gmf/service/GMFServices.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.gmf/src/org/eclipse/gendoc/bundle/acceleo/gmf/service/GMFServices.java
@@ -9,11 +9,13 @@
*
* Contributors:
* Alexia Allanic (Atos Origin) alexia.allanic@atosorigin.com - Initial API and implementation
+ * Antonio Campesino Robles (Ericsson) - Bug 531275
*
*****************************************************************************/
package org.eclipse.gendoc.bundle.acceleo.gmf.service;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -195,71 +197,40 @@
* @param uri the uri
* @return list of diagrams
*/
- public List<Diagram> getDiagrams(EObject e, URI uri)
- {
+ @SuppressWarnings("unchecked")
+ public List<Diagram> getDiagrams(EObject e, URI uri) {
if (e == null || e.eResource() == null || uri == null)
{
return null;
}
- IRegistryService registry = GendocServices.getDefault().getService(IRegistryService.class);
- if (registry != null)
+
+ Resource resource = null;
+ if (e.eResource().getURI().equals(uri))
{
- Map<URI, List<Diagram>> map = (Map<URI, List<Diagram>>) registry.get(KEY_DIAGRAM_MAP);
- if (map == null)
- {
- // instanciation -> put
- map = new HashMap<URI, List<Diagram>>();
- registry.put(KEY_DIAGRAM_MAP, map);
- }
- List<Diagram> diagrams = map.get(uri);
- if (diagrams == null)
- {
- // new LinkedList<Diagram> / recherche / add -> put
- diagrams = new LinkedList<Diagram>();
- Resource diResource = null;
- if (e.eResource().getURI().equals(uri))
- {
- diResource = e.eResource();
- }
- else
- {
- try
- {
- diResource = e.eResource().getResourceSet().getResource(uri, true);
- }
- catch (WrappedException ex)
- {
- IGendocDiagnostician diag = GendocServices.getDefault().getService(IGendocDiagnostician.class);
- diag.addDiagnostic(new BasicDiagnostic(Diagnostic.ERROR, Activator.PLUGIN_ID, 0, String.format("Resource %s not found", uri.toString()), new Object[] {e}));
- ex.printStackTrace();
- }
-
- }
- EditingDomain domain = TransactionUtil.getEditingDomain(diResource.getResourceSet());
- if (domain == null)
- {
- TransactionalEditingDomainImpl.FactoryImpl.INSTANCE.createEditingDomain(diResource.getResourceSet());
- }
- for (Iterator<EObject> i = EcoreUtil.getAllProperContents(diResource, true); i.hasNext();)
- {
- EObject eobject = i.next();
- if (eobject instanceof Diagram)
- {
- Diagram diagram = (Diagram) eobject;
- diagrams.add(diagram);
- }
- }
- map.put(uri, diagrams);
- }
- if (!diagrams.isEmpty())
- {
- return getDiagramsForElement(e, diagrams);
- }
- return null;
+ resource = e.eResource();
}
- return null;
+ else
+ {
+ try
+ {
+ resource = e.eResource().getResourceSet().getResource(uri, true);
+ }
+ catch (WrappedException ex)
+ {
+ IGendocDiagnostician diag = GendocServices.getDefault().getService(IGendocDiagnostician.class);
+ diag.addDiagnostic(new BasicDiagnostic(Diagnostic.ERROR, Activator.PLUGIN_ID, 0, String.format("Resource %s not found", uri.toString()), new Object[] {e}));
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ List<Diagram> diagrams = getDiagrams(resource);
+ if (!diagrams.isEmpty())
+ {
+ return getDiagramsForElement(e, diagrams);
+ }
+ return Collections.EMPTY_LIST;
}
-
+
protected List<Diagram> getDiagramsForElement(EObject e, List<Diagram> diagrams)
{
List<Diagram> diagramsForParameters = new LinkedList<Diagram>();
@@ -273,6 +244,60 @@
return diagramsForParameters;
}
+ @SuppressWarnings("unchecked")
+ protected List<Diagram> getDiagrams(Resource res)
+ {
+ IRegistryService registry = GendocServices.getDefault().getService(IRegistryService.class);
+ if (registry != null)
+ {
+ Map<URI, List<Diagram>> map = (Map<URI, List<Diagram>>) registry.get(KEY_DIAGRAM_MAP);
+ if (map == null)
+ {
+ // instanciation -> put
+ map = new HashMap<URI, List<Diagram>>();
+ registry.put(KEY_DIAGRAM_MAP, map);
+ }
+ List<Diagram> diagrams = map.get(res.getURI());
+ if (diagrams == null)
+ {
+ // new LinkedList<Diagram> / recherche / add -> put
+ diagrams = new LinkedList<Diagram>();
+
+ EditingDomain domain = TransactionUtil.getEditingDomain(res.getResourceSet());
+ if (domain == null)
+ {
+ TransactionalEditingDomainImpl.FactoryImpl.INSTANCE.createEditingDomain(res.getResourceSet());
+ }
+
+ for (Iterator<EObject> i = EcoreUtil.getAllProperContents(res, true); i.hasNext();)
+ {
+ EObject eobject = i.next();
+ if (eobject instanceof Diagram)
+ {
+ Diagram diagram = (Diagram) eobject;
+ diagrams.add(diagram);
+ }
+ }
+ map.put(res.getURI(), diagrams);
+ }
+ return diagrams;
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected List<Diagram> getDiagrams(URI uri) {
+ IRegistryService registry = GendocServices.getDefault().getService(IRegistryService.class);
+ if (registry == null)
+ return Collections.EMPTY_LIST;
+
+ Map<URI, List<Diagram>> map = (Map<URI, List<Diagram>>) registry.get(KEY_DIAGRAM_MAP);
+ if (map == null)
+ return Collections.EMPTY_LIST;
+
+ return map.get(uri);
+ }
+
/**
* Gets the elements in diagram.
*
@@ -305,7 +330,8 @@
* @param view the view
* @param allViews the list of elements
*/
- static private void getAllNestedViews(View view, Set<View> allViews)
+ @SuppressWarnings("unchecked")
+ static private void getAllNestedViews(View view, Set<View> allViews)
{
for (View childView : (List<View>) view.getChildren())
{
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/META-INF/MANIFEST.MF
index 583a8d1..f066d5c 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/META-INF/MANIFEST.MF
@@ -23,7 +23,10 @@
org.eclipse.papyrus.uml.tools,
org.eclipse.papyrus.infra.core.log,
org.eclipse.papyrus.infra.services.resourceloading,
- org.eclipse.gendoc.bundle.acceleo.commons
+ org.eclipse.gendoc.bundle.acceleo.commons,
+ org.eclipse.gendoc.documents,
+ org.eclipse.gendoc.table,
+ org.eclipse.papyrus.infra.emf
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/build.acceleo b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/build.acceleo
index 5d0ad38..48a111c 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/build.acceleo
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/build.acceleo
@@ -18,7 +18,7 @@
<acceleoCompiler
sourceFolder="${target.folder}"
outputFolder="${target.folder}"
- dependencies="${target.folder}/../../org.eclipse.gendoc.bundle.acceleo.gmf;${target.folder}/../../org.eclipse.gendoc.script.acceleo;${target.folder}/../../org.eclipse.gendoc.m2t;${target.folder}/../../org.eclipse.gendoc.services;${target.folder}/../../org.eclipse.gendoc.document.parser;${target.folder}/../../org.eclipse.gendoc.tags.handlers;${target.folder}/../../org.eclipse.gendoc.documents;${target.folder}/../../org.eclipse.gendoc.tags.parsers;${target.folder}/../../org.eclipse.gendoc.tags;${target.folder}/../../org.eclipse.gendoc.process;"
+ dependencies="${target.folder}/../../org.eclipse.gendoc.bundle.acceleo.gmf;${target.folder}/../../org.eclipse.gendoc.script.acceleo;${target.folder}/../../org.eclipse.gendoc.m2t;${target.folder}/../../org.eclipse.gendoc.services;${target.folder}/../../org.eclipse.gendoc.document.parser;${target.folder}/../../org.eclipse.gendoc.tags.handlers;${target.folder}/../../org.eclipse.gendoc.documents;${target.folder}/../../org.eclipse.gendoc.tags.parsers;${target.folder}/../../org.eclipse.gendoc.tags;${target.folder}/../../org.eclipse.gendoc.process;${target.folder}/../../org.eclipse.gendoc.model;"
binaryResource="false"
packagesToRegister="">
</acceleoCompiler>
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/pom.xml b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/pom.xml
index 0c0a831..8be3244 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/pom.xml
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/pom.xml
@@ -36,6 +36,8 @@
<packagesToRegister>
<packageToRegister>org.eclipse.emf.ecore.EcorePackage</packageToRegister>
<packageToRegister>org.eclipse.gmf.runtime.notation.NotationPackage</packageToRegister>
+ <packageToRegister>org.eclipse.gendoc.table.TablePackage</packageToRegister>
+ <packageToRegister>org.eclipse.uml2.uml.UMLPackage</packageToRegister>
</packagesToRegister>
</configuration>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/mtl/papyrus.mtl b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/mtl/papyrus.mtl
index 62f5438..18cba90 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/mtl/papyrus.mtl
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/mtl/papyrus.mtl
@@ -5,14 +5,21 @@
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:
+ Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net fix bug #515404 : Papyrus table generation
+ fix bug #506575 : add a getAppliedComments function
+ Antonio Campesino Robles (Ericsson) - Bug 531275
/]
-[module papyrus('http://www.eclipse.org/gmf/runtime/1.0.2/notation')/]
+[module papyrus('http://www.eclipse.org/gmf/runtime/1.0.2/notation','http://www.eclipse.org/uml2/4.0.0/UML','http://www.eclipse.org/gendoc/1.0/table')/]
[comment - get the diagrams of an object /]
[query public getPapyrusDiagrams(arg0 : ecore::EObject) : Sequence(Diagram)
= invoke('org.eclipse.gendoc.bundle.acceleo.papyrus.service.PapyrusServices', 'getPapyrusDiagrams(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
+[comment - get the diagrams of an object /]
+[query public getPapyrusOwnedDiagrams(arg0 : ecore::EObject) : Sequence(Diagram)
+ = invoke('org.eclipse.gendoc.bundle.acceleo.papyrus.service.PapyrusServices', 'getPapyrusOwnedDiagrams(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
+
[comment - get the documentation of an object /]
[query public getDocumentation(arg0 : ecore::EObject) : String
= invoke('org.eclipse.gendoc.bundle.acceleo.papyrus.service.PapyrusServices', 'getDocumentation(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
@@ -24,4 +31,11 @@
[query public replaceLinksByNameOrLabel(arg0 : String, arg1 : ecore::EObject) : String
= invoke('org.eclipse.gendoc.bundle.acceleo.papyrus.service.PapyrusServices', 'replaceLinksByNameOrLabel(java.lang.String, org.eclipse.emf.ecore.EObject)', Sequence{arg0, arg1}) /]
+[query public getPapyrusTables (arg0 : ecore::EObject) : Sequence(table::Table)
+= invoke('org.eclipse.gendoc.bundle.acceleo.papyrus.service.PapyrusServices', 'getPapyrusTables(org.eclipse.emf.ecore.EObject)', Sequence{arg0}) /]
+
+[comment - get the applied comments/]
+[query public getAppliedComment(element: Element) : Bag(String)
+= element.ownedComment -> select(c:uml::Comment|(c.annotatedElement -> includes(element)))._body/]
+
[comment - virtual order methods must be implemented if the module is integrated to papyrus/]
\ No newline at end of file
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusContextService.java b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusContextService.java
index 3d63be3..634cadd 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusContextService.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusContextService.java
@@ -9,8 +9,7 @@
*
* Contributors:
* Vincent Hemery (Atos Origin) - Initial API and implementation
- * Antonio Campesino (Ericsson) - Bug 526483: Diagrams doesn't show in the
- * generate document if the papyrus model file with blanks in the URI.
+ * Antonio Campesino (Ericsson) - Bug 526483, 530839.
*
*****************************************************************************/
package org.eclipse.gendoc.bundle.acceleo.papyrus.service;
@@ -42,7 +41,7 @@
@Override
public void setModel(String modelPath) throws ModelNotFoundException
{
-
+ modelPath = normalizePath(modelPath);
if (isPapyrusModel(modelPath))
{
EMFModelLoaderService loader = GendocServices.getDefault().getService(IEMFModelLoaderService.class);
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusModelLoaderService.java b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusModelLoaderService.java
index 5cffa0f..3159a36 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusModelLoaderService.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusModelLoaderService.java
@@ -9,13 +9,14 @@
*
* Contributors:
* Vincent Hemery (Atos Origin) - Initial API and implementation
- * Antonio Campesino (Ericsson) - Bug 526488: Not all proxies are resolved when
- * loading resources for papyrus models for complex model dependencies.
+ * Antonio Campesino (Ericsson) - Bugs 526488, 531275
*
*****************************************************************************/
package org.eclipse.gendoc.bundle.acceleo.papyrus.service;
import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -72,9 +73,52 @@
e.printStackTrace();
}
}
+
if( resourceSet == null){
resourceSet = super.constructResourceSet();
}
+
+ if(resourceSet != null) {
+ Set<URI> pendingNotationResources = new HashSet<URI>();
+ Set<URI> resolvedNotationResources = new HashSet<URI>();
+
+ // Load all the notation files and resolve all the dependencies
+ do {
+ for (Resource res : resourceSet.getResources()) {
+ String uriStr = res.getURI().toString();
+ if (uriStr.endsWith(".uml")) {
+ URI uri = res.getURI();
+ URI notationUri = uri.trimFileExtension().appendFileExtension("notation");
+ if (!resolvedNotationResources.contains(notationUri))
+ pendingNotationResources.add(notationUri);
+ } else if(uriStr.endsWith(".notation")) {
+ URI notationUri = res.getURI();
+ pendingNotationResources.remove(notationUri);
+ resolvedNotationResources.add(notationUri);
+ }
+ }
+
+ if (pendingNotationResources.isEmpty())
+ break;
+
+ while (!pendingNotationResources.isEmpty()) {
+ URI notationUri = pendingNotationResources.iterator().next();
+ pendingNotationResources.remove(notationUri);
+
+ try {
+ Resource res = resourceSet.getResource(notationUri, true);
+ if (res == null && !res.isLoaded())
+ continue;
+
+ resolvedNotationResources.add(notationUri);
+ EcoreUtil.resolveAll(res);
+ } catch (Exception e) {
+ }
+ }
+ } while(true);
+ }
+
+
return resourceSet;
}
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusServices.java b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusServices.java
index e2a44de..13fd690 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusServices.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.papyrus/src/org/eclipse/gendoc/bundle/acceleo/papyrus/service/PapyrusServices.java
@@ -10,15 +10,19 @@
* Contributors:
* Alexia Allanic (Atos Origin) alexia.allanic@atosorigin.com - Initial API and implementation
* Anne Haugommard (Atos) anne.haugommard@atos.net - Remove references to Papyrus Documentation services
- *
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - fix bug #515404 : add getPapyrusTables method
+ * Antonio Campesino Robles (Ericsson) - Support for Tree tables, Bug 531275
*****************************************************************************/
package org.eclipse.gendoc.bundle.acceleo.papyrus.service;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -32,26 +36,36 @@
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gendoc.bundle.acceleo.commons.files.CommonService;
import org.eclipse.gendoc.bundle.acceleo.gmf.service.GMFServices;
import org.eclipse.gendoc.bundle.acceleo.papyrus.Activator;
import org.eclipse.gendoc.services.GendocServices;
import org.eclipse.gendoc.services.IGendocDiagnostician;
import org.eclipse.gendoc.services.ILogger;
+import org.eclipse.gendoc.services.IRegistryService;
import org.eclipse.gendoc.services.exception.ModelNotFoundException;
+import org.eclipse.gendoc.services.exception.ServiceException;
+import org.eclipse.gendoc.table.Table;
import org.eclipse.gendoc.tags.handlers.IEMFModelLoaderService;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Style;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
public class PapyrusServices extends GMFServices {
+ private static final String KEY_OWNED_DIAGRAMS = Activator.PLUGIN_ID+":key_owned_diagram_map";
private static final String ASSOCIATED_RESOURCES_SOURCE = "http://www.topcased.org/resources";
- private static final String PAPYRUS_DOCUMENTATION_STEREOTYPE_QUALIFIED_NAME = "Papyrus::Documentation::Documentation";
+ private static final String PAPYRUS_DOCUMENTATION_STEREOTYPE_QUALIFIED_NAME = "Documentation::Documentation";
private static final String PREFIX_WORKSPACE_RESOURCE = "WR"; //$NON-NLS-1$
private static final String PREFIX_EXTERNAL_RESOURCE = "ER"; //$NON-NLS-1$
private static final String PREFIX_REMOTE_RESOURCE = "RR"; //$NON-NLS-1$
@@ -107,6 +121,83 @@
return result;
}
+
+ @SuppressWarnings({ "unchecked"})
+ public List<Diagram> getPapyrusOwnedDiagrams(EObject obj) {
+ List<EStructuralFeature> ownerFeatures = getDiagramOwnerFeature();
+ if (ownerFeatures.isEmpty() || obj == null || obj.eResource() == null || obj.eResource().getResourceSet() == null)
+ return Collections.EMPTY_LIST;
+
+ IRegistryService registry = GendocServices.getDefault().getService(IRegistryService.class);
+ if (registry == null)
+ return Collections.EMPTY_LIST;
+
+ Map<String, List<Diagram>> map = (Map<String, List<Diagram>>) registry.get(KEY_OWNED_DIAGRAMS);
+ if (map == null) {
+ map = new TreeMap<String, List<Diagram>>();
+ // Force resolve all notation files.
+ /*
+ for (Resource res : obj.eResource().getResourceSet().getResources()) {
+ if (res.getURI().toString().endsWith(".uml") && !res.getContents().isEmpty()) {
+ getDiagramsUsingNotation(res.getContents().get(0));
+ }
+ }*/
+
+ for (Resource res : obj.eResource().getResourceSet().getResources()) {
+ if (res.getURI().toString().endsWith(".notation") && !res.getContents().isEmpty()) {
+ List<Diagram> diagrams = getDiagrams(res);
+ for (Diagram d : diagrams) {
+ for (EStructuralFeature f : ownerFeatures) {
+ Style s = d.getStyle(f.getEContainingClass());
+ if (s == null)
+ continue;
+
+ Object value = s.eGet(f,true);
+ if (!(value instanceof EObject))
+ continue;
+
+ EObject owner = (EObject)value;
+ if (owner.eIsProxy())
+ continue; // Broken ref
+ String eobjKey = owner.eResource().getURI()+"#"+owner.eResource().getURIFragment(owner);
+
+ List<Diagram> dias = map.get(eobjKey);
+ if (dias == null) {
+ dias = new ArrayList<Diagram>();
+ map.put(eobjKey, dias);
+ }
+ dias.add(d);
+ }
+ }
+ }
+ }
+ registry.put(KEY_OWNED_DIAGRAMS,map);
+ }
+
+ String eobjKey = obj.eResource().getURI()+"#"+obj.eResource().getURIFragment(obj);
+ List<Diagram> diagrams = map.get(eobjKey);
+ if (diagrams == null)
+ return Collections.EMPTY_LIST;
+
+ return Collections.unmodifiableList(diagrams);
+ }
+
+ private List<EStructuralFeature> getDiagramOwnerFeature() {
+ List<EStructuralFeature> features = new ArrayList<EStructuralFeature>();
+ EPackage stylePackage = EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/papyrus/infra/gmfdiag/style");
+ if (stylePackage != null) {
+ EClass style = (EClass)stylePackage.getEClassifier("PapyrusDiagramStyle");
+ features.add(style.getEStructuralFeature("owner"));
+ }
+
+ stylePackage = EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/papyrus/infra/viewpoints/policy/style");
+ if (stylePackage != null) {
+ EClass style = (EClass)stylePackage.getEClassifier("PapyrusViewStyle");
+ features.add(style.getEStructuralFeature("owner"));
+ }
+ return features;
+ }
+
/**
* Get the documentation.
*
@@ -236,5 +327,41 @@
}
return uris;
}
+
+
+
+ /**
+ * Get a collection of papyrus tables
+ * @param modelElement
+ * @return
+ * @throws ServiceException
+ * @throws org.eclipse.papyrus.infra.core.services.ServiceException
+ */
+ public Collection<Table> getPapyrusTables(EObject modelElement) throws ServiceException, org.eclipse.papyrus.infra.core.services.ServiceException {
+ throw new UnsupportedOperationException("Tables are not implemented in Papyrus Juno");
+ }
+
+ /**
+ * @param modelElement
+ * @param notationFile
+ * @return
+ */
+ private Resource getDiResouce(EObject modelElement, URI notationFile) {
+ Resource diResource = null;
+ if (modelElement.eResource().getURI().equals(notationFile)) {
+ diResource = modelElement.eResource();
+ } else {
+ try {
+ diResource = modelElement.eResource().getResourceSet().getResource(notationFile, true);
+ } catch (WrappedException ex) {
+ IGendocDiagnostician diag = GendocServices.getDefault().getService(IGendocDiagnostician.class);
+ diag.addDiagnostic(new BasicDiagnostic(Diagnostic.ERROR, Activator.PLUGIN_ID, 0,
+ String.format("Resource %s not found", notationFile.toString()), new Object[] { modelElement }));
+ ex.printStackTrace();
+ }
+
+ }
+ return diResource;
+ }
}
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/META-INF/MANIFEST.MF
index 7b933ad..facd8e6 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/META-INF/MANIFEST.MF
@@ -17,8 +17,11 @@
org.eclipse.gendoc.services,
org.eclipse.gendoc.process,
org.eclipse.gendoc.tags.handlers,
- org.eclipse.sirius.diagram;bundle-version="2.0.4",
- org.eclipse.gendoc.bundle.acceleo.commons;bundle-version="0.6.0"
+ org.eclipse.sirius.diagram,
+ org.eclipse.gendoc.bundle.acceleo.commons,
+ org.eclipse.sirius.table,
+ org.eclipse.gendoc.documents,
+ org.eclipse.gendoc.table
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/pom.xml b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/pom.xml
index 817090e..ee51c57 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/pom.xml
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/pom.xml
@@ -39,6 +39,7 @@
<packageToRegister>org.eclipse.emf.ecore.EcorePackage</packageToRegister>
<packageToRegister>org.eclipse.gmf.runtime.notation.NotationPackage</packageToRegister>
<packageToRegister>org.eclipse.sirius.diagram.DiagramPackage</packageToRegister>
+ <packageToRegister>org.eclipse.gendoc.table.TablePackage</packageToRegister>
</packagesToRegister>
</configuration>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/mtl/sirius.mtl b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/mtl/sirius.mtl
index f3429b5..e95908d 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/mtl/sirius.mtl
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/mtl/sirius.mtl
@@ -5,9 +5,10 @@
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:
+ Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net fix bug #515404 : Sirius table generation
/]
-[module sirius('http://www.eclipse.org/gmf/runtime/1.0.2/notation', 'http://www.eclipse.org/sirius/diagram/1.1.0')/]
+[module sirius('http://www.eclipse.org/gmf/runtime/1.0.2/notation', 'http://www.eclipse.org/sirius/diagram/1.1.0','http://www.eclipse.org/gendoc/1.0/table')/]
[comment - get the diagrams of an object /]
[query public getSiriusDiagrams(arg0 : ecore::EObject) : Sequence(Diagram)
@@ -17,3 +18,7 @@
[query public getSiriusDiagramName(di : Diagram) : String
= di.eContainer().eContainer().oclAsType(diagram::DSemanticDiagram).name /]
+
+
+[query public getSiriusTables(arg0 : ecore::EObject) : Sequence(table::Table)
+ = invoke('org.eclipse.gendoc.bundle.acceleo.sirius.service.SiriusServices', 'getSiriusTables(org.eclipse.emf.ecore.EObject)', Sequence{arg0})/]
diff --git a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/service/SiriusServices.java b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/service/SiriusServices.java
index 201e25f..00eeac5 100644
--- a/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/service/SiriusServices.java
+++ b/plugins/org.eclipse.gendoc.bundle.acceleo.sirius/src/org/eclipse/gendoc/bundle/acceleo/sirius/service/SiriusServices.java
@@ -13,8 +13,15 @@
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.sirius.business.api.session.CustomDataConstants;
import org.eclipse.sirius.diagram.DSemanticDiagram;
+import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.tools.internal.export.csv.TableCsvHelper;
import org.eclipse.sirius.viewpoint.description.AnnotationEntry;
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.Table;
+import org.eclipse.gendoc.table.TableFactory;
+import org.eclipse.gendoc.table.TableHeader;
public class SiriusServices {
@@ -49,4 +56,62 @@
}
return result;
}
+
+ /**
+ * Get sirius tables under element object
+ * @param element
+ * @return
+ */
+ public Collection<org.eclipse.gendoc.table.Table> getSiriusTables(EObject element) {
+ // TO IMPROVE ? reuse existing sirius services ?
+ CommonService.load(element, "aird");
+ ResourceSet set = null;
+ if (element.eResource() != null && element.eResource().getResourceSet() != null){
+ set = element.eResource().getResourceSet();
+ }
+ if (set == null){
+ return null;
+ }
+ ECrossReferenceAdapter cross = ECrossReferenceAdapter.getCrossReferenceAdapter(set);
+ if (cross == null){
+ cross = new ECrossReferenceAdapter();
+ set.eAdapters().add(cross);
+ }
+
+ Collection<Setting> inverses = cross.getInverseReferences(element, true);
+ Collection<org.eclipse.gendoc.table.Table> results = new LinkedList<org.eclipse.gendoc.table.Table>();
+ for (Setting s : inverses){
+ if (s.getEObject() instanceof DTable) {
+
+ DTable sem = (DTable) s.getEObject();
+ Table result = TableFactory.eINSTANCE.createTable();
+ result.setName(sem.getName());
+ Iterable<Iterable<String>> tableDescriptors = TableCsvHelper.getTableDescriptor(sem);
+ int index=0;
+ for (Iterable<java.lang.String> line : tableDescriptors) {
+ if (index==0){
+ TableHeader header = TableFactory.eINSTANCE.createTableHeader();
+ for (String cellValue : line) {
+ Cell cell = TableFactory.eINSTANCE.createCell();
+ cell.setLabel(cellValue);
+ header.getCells().add(cell);
+ }
+ result.setTableheader(header);
+ } else {
+
+ Row row = TableFactory.eINSTANCE.createRow();
+ for (String cellValue : line) {
+ Cell cell = TableFactory.eINSTANCE.createCell();
+ cell.setLabel(cellValue);
+ row.getCells().add(cell);
+ }
+ result.getRows().add(row);
+ }
+ index++;
+ }
+ results.add(result);
+ }
+ }
+ return results;
+ }
}
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png
new file mode 100644
index 0000000..06bfd67
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png
new file mode 100644
index 0000000..628f734
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png
new file mode 100644
index 0000000..76800ea
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html
new file mode 100644
index 0000000..c7fb35a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html
@@ -0,0 +1,305 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+ <title>Table generation</title>
+ <link rel="stylesheet" type="text/css" href="userguide.css">
+ </head>
+ <body>
+ <h2>Papyrus And Sirius Tables</h2>
+ <p>As tables exist in Papyrus and Sirius we want to provide a way to
+ integrate them as Word tables or LibreOffice tables.</p>
+ <p>Gendoc tag already exists, so the solution proposed is to have a pivot
+ generic Table object, offered by a dedicated Gendoc metamodel, in order to
+ generate all kinds of table the same way. Dedicated acceleo bundles,
+ already existing for Papyrus and Sirius, have a new service to transform
+ their table to the Gendoc generic table. </p>
+ <p>An overview of the Gendoc table very simple metamodel is shown in the
+ picture below.</p>
+ <p><img alt="" src="img/Gendoc_table_metamodel.png"></p>
+ <h3>Papyrus table generation (with manual configuration of the table columns
+ in the template)</h3>
+ <p>From a Papyrus model containing this table:</p>
+ <p><img alt="" src="img/Papyrus_table_sample.png"></p>
+ <p>Gendoc template fragment :</p>
+ <div class="codeBox cbBg code">
+ <p class="code"><config> <drop/><br>
+ <param key='modelPath' value='${project_loc}/...'/><br>
+ <output path='...'/><br>
+ </config> <drop/></p>
+ <context model='${modelPath}' element='RootElement/Requirements'
+ importedBundle='gmf;papyrus' searchMetamodel='true'/><br>
+ <gendoc id='requirements'> <drop/><br>
+ [for (table: table::Table | self.getPapyrusTables())]
+ <drop/><br>
+ <table> <drop/>
+ <div style="text-align: center;">[table.name/]:</div>
+ <br>
+ <table style="border-collapse:collapse;width: 929px; height: 44px;" border="1">
+ <tbody>
+ <tr>
+ <td><b>[table.tableheader.cells -> at(1).label/]</b></td>
+ <td><b>[table.tableheader.cells -> at(2).label/]</b></td>
+ <td><b>[table.tableheader.cells -> at(3).label/]</b></td>
+ </tr>
+ </tbody>
+ </table>
+ [for (row: table::Row | table.rows)] <drop/>
+ <table style="border-collapse:collapse;" border="1" width="100%">
+ <tbody>
+ <tr>
+ <td>[row.cells->at(1).label/]</td>
+ <td>[row.cells->at(1).label/]</td>
+ <td>[row.cells->at(1).label/]</td>
+ </tr>
+ </tbody>
+ </table>
+ [/for] <drop/><br>
+ </table> <drop/><br>
+ </gendoc> <drop/><br>
+ </div>
+ <p>In this example the service "getPapyrusTables()" will return the list of
+ tables contained in the context element.</p>
+ <p>It is possible to navigate in a table using relations “tableheader” and
+ “row”. The first relation returns the headers of a table and the latter a
+ list of row. From each of these objects we use the relation “cells” to
+ access to the list of cells composing a row or the table header. </p>
+ <p>Result in the word document produced by Gendoc :</p>
+ <table style="border-collapse: collapse;width: 929px; height: 28px;" border="1">
+ <tbody>
+ <tr>
+ <td style="width: 307.517px;"><b>id</b></td>
+ <td style="width: 309.85px;"><b>name</b></td>
+ <td style="width: 289.633px;"><b>text</b></td>
+ </tr>
+ <tr>
+ <td style="width: 307.733px;">REQ_001</td>
+ <td style="width: 308.633px;">Automated alarm clock</td>
+ <td style="width: 290.633px;">The alarm clock radio shall wake up the
+ user automatically at the right time, through radio or buzzer</td>
+ </tr>
+ <tr>
+ <td>REQ_0012</td>
+ <td>Radio management</td>
+ <td>The user shall be able to modify easily the radio station and the
+ volume.</td>
+ </tr>
+ <tr>
+ <td>REQ_003</td>
+ <td>Clock management</td>
+ <td>The user shall be able to update easily the time displayed by the
+ clock or the alarm. </td>
+ </tr>
+ <tr>
+ <td>...</td>
+ <td><br>
+ </td>
+ <td><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <h3>Sirius table generation (with manual configuration of the table columns
+ in the template)</h3>
+ <p>From a Sirius model containing this table:</p>
+ <p><img alt="" src="img/Sirius_table_sample.png"> </p>
+ <p>Gendoc template fragment:</p>
+ <p> </p>
+ <div class="codeBox cbBg code">
+ <p class="code"><config> <drop/><br>
+ <param key='modelPath' value='${project_loc}/...'/><br>
+ <output path='...'/><br>
+ </config> <drop/></p>
+ <context model='${modelPath}' element='RootElement/Requirements'
+ importedBundle='gmf;sirius' searchMetamodel='true'/><br>
+ <gendoc id='requirements'> <drop/><br>
+ [for (table: table::Table | self.getSiriusTables())]
+ <drop/><br>
+ <table> <drop/><br>
+ <div style="text-align: center;">[table.name/]:</div>
+ <br>
+ <table style="border-collapse:collapse;width: 929px; height: 44px;" border="1">
+ <tbody>
+ <tr>
+ <td><b>[table.tableheader.cells -> at(1).label/]</b></td>
+ <td><b>[table.tableheader.cells -> at(2).label/]</b></td>
+ <td><b>[table.tableheader.cells -> at(3).label/]</b></td>
+ </tr>
+ </tbody>
+ </table>
+ [for (row: table::Row | table.rows)] <drop/>
+ <table style="border-collapse:collapse;" border="1" width="100%">
+ <tbody>
+ <tr>
+ <td>[row.cells->at(1).label/]</td>
+ <td>[row.cells->at(1).label/]</td>
+ <td>[row.cells->at(1).label/]</td>
+ </tr>
+ </tbody>
+ </table>
+ [/for] <drop/><br>
+ </table> <drop/><br>
+ </gendoc> <drop/><br>
+ </div>
+ <p>This example is very similar to the precedent. The only notable
+ difference is how we access to the list of tables. In this case as we are
+ in a Sirius model, we use the “getSiriusTables()” service.</p>
+ <p>Result in the word document produced by Gendoc :</p>
+ <table style="border-collapse: collapse; width: 918px; height: 28px;" border="1">
+ <tbody>
+ <tr>
+ <td style="width: 307.517px;"><br>
+ </td>
+ <td style="width: 309.85px"><b>Father</b></td>
+ <td style="width: 289.633px;"><b>Mother</b></td>
+ </tr>
+ <tr>
+ <td style="width: 307.517px;">Man Paul</td>
+ <td style="width: 308.633px;"><br>
+ </td>
+ <td style="width: 290.633px;"><br>
+ </td>
+ </tr>
+ <tr>
+ <td>Woman Isa</td>
+ <td><br>
+ </td>
+ <td><br>
+ </td>
+ </tr>
+ <tr>
+ <td>Man Elias</td>
+ <td>Paul</td>
+ <td>Isa</td>
+ </tr>
+ <tr>
+ <td>Woman Lea</td>
+ <td>Paul<br>
+ </td>
+ <td>Isa<br>
+ </td>
+ </tr>
+ <tr>
+ <td>Man Dave</td>
+ <td>Elias</td>
+ <td><br>
+ </td>
+ </tr>
+ <tr>
+ <td>Man Alain</td>
+ <td>Dave</td>
+ <td>Katell</td>
+ </tr>
+ <tr>
+ <td>...</td>
+ <td><br>
+ </td>
+ <td><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <h3>Example of an automated table generation from a Papyrus table</h3>
+ <p>From a Papyrus model containing several tables on a package the following
+ gendoc fragment allows a full table generation.</p>
+ <p><u><strong>Note</strong></u>: Automated mode also works with Sirius</p>
+ <p>Gendoc code:</p>
+ <div class="codeBox cbBg code">
+ <p class="code"><config> <drop/><br>
+ <param key='modelPath' value='${project_loc}/...'/><br>
+ <output path='...'/><br>
+ </config> <drop/></p>
+ <context model='${modelPath}' element='RootElement/Requirements'
+ importedBundle='gmf;papyrus' searchMetamodel='true'/><br>
+ <gendoc id='requirements'> <drop/><br>
+ [for (table: table::Table | self.getPapyrusTables())]
+ <drop/>
+ <div style="text-align: center;">[table.name/]:[t.type/] <br>
+ <div style="text-align: left;"> <table
+ object='[t.getTableId()/]'> <drop/></div>
+ </div>
+ <table style="border-collapse:collapse;" border="1" width="100%">
+ <tbody>
+ <tr>
+ <td> </td>
+ </tr>
+ </tbody>
+ </table>
+ </table> <drop/><br>
+ </gendoc> <drop/><br>
+ </div>
+ <p></p>
+ <p>The table tag has a new attribute “object” for the automatic generation.
+ This attribute has to be set to the identifier of the table. The service
+ “getTableId()” is used to retrieve this identifier.</p>
+ <p><u><strong>Note</strong></u>: in this mode all cells will have the same
+ style.</p>
+ <p>Gendoc result :</p>
+ <p style="text-align: center;"><strong>RequirementTable0 : PapyrusSysMLRequirementTable</strong></p>
+ <table style="border-collapse: collapse;width: 929px; height: 28px;" border="1">
+ <tbody>
+ <tr>
+ <td style="width: 307.517px; text-align: center;"><b>id : String [1]<br>
+ </b></td>
+ <td style="width: 309.85px; text-align: center;"><b>name : String
+ [0..1]<br>
+ </b></td>
+ <td style="width: 289.633px; text-align: center;"><b>text : String [1]<br>
+ </b></td>
+ </tr>
+ <tr align="center">
+ <td style="width: 307.733px;">REQ_001</td>
+ <td style="width: 308.633px;">Automated alarm clock</td>
+ <td style="width: 290.633px;">The alarm clock radio shall wake up the
+ user automatically at the right time, through radio or buzzer</td>
+ </tr>
+ <tr align="center">
+ <td>REQ_0012</td>
+ <td>Radio management</td>
+ <td>The user shall be able to modify easily the radio station and the
+ volume.</td>
+ </tr>
+ <tr align="center">
+ <td>REQ_003</td>
+ <td>Clock management</td>
+ <td>The user shall be able to update easily the time displayed by the
+ clock or the alarm. </td>
+ </tr>
+ <tr>
+ <td>...</td>
+ <td><br>
+ </td>
+ <td><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <p></p>
+ <p style="text-align: center;"><strong>AllocationTable0 :
+ PapyrusSysMLAllocationTable</strong></p>
+ <p style="text-align: center;"><strong></strong></p>
+ <table style="text-align: left; margin-left: auto; margin-right: auto;" border="1"
+ width="100%">
+ <tbody>
+ <tr align="center">
+ <td><strong>name : String [0..1]</strong></td>
+ </tr>
+ <tr align="center">
+ <td>Allocate1</td>
+ </tr>
+ <tr align="center">
+ <td>Allocate2</td>
+ </tr>
+ <tr align="center">
+ <td>Allocate3</td>
+ </tr>
+ <tr align="center">
+ <td>Allocate4</td>
+ </tr>
+ <tr align="center">
+ <td>Allocate5</td>
+ </tr>
+ </tbody>
+ </table>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc.docx/userguide.xml b/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
index 8b24d80..3620f36 100644
--- a/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
+++ b/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
@@ -18,6 +18,8 @@
</topic>
<topic href="html/userguide/script_table_generation.html" label="Table generation">
</topic>
+ <topic href="html/userguide/script_papyrus_sirius_tables.html" label="Papyrus and Sirius Tables">
+ </topic>
<topic href="html/userguide/script_bookmarks_generation.html" label="Bookmarks and hyperlinks generation">
</topic>
<topic href="html/userguide/script_rich_text_generation.html" label="Rich Text generation">
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/appendix.html b/plugins/org.eclipse.gendoc.doc/html/userguide/appendix.html
index be76a99..3abd4f8 100644
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/appendix.html
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/appendix.html
@@ -40,7 +40,8 @@
<span style="color:lightGray;">Drawing area</span>
</image>
- [0..*] <table>
+ [0..*] <table
+ [0..1] object='<span style="color:lightGray;">object_id</span>'>
<span style="color:lightGray;">Rows or tables</span>
</table>
@@ -52,6 +53,8 @@
[0..*] <drop/>
+ [0..*] <dropSlide/>
+
[0..*] <dropEmpty>..</dropEmpty>
[0..*] <nobr/>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
index d34489a..e1e96e2 100644
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
@@ -11,9 +11,13 @@
<ul>
<li><a href="bundles_common.html"><strong>commons</strong></a>: provides some facilities (for special characters,
splitting lines, ID generation…)</li>
+ <li><a href="bundles_html.html"><strong>html</strong></a>: provides some facilities for handling HTML text and for converting from
+ plain text to html, and from html to plain text</li>
<li><a href="bundles_gmf.html"><strong>gmf</strong></a>: provides some services for GMF diagrams generation</li>
<li><a href="bundles_papyrus.html"><strong>papyrus</strong></a>: provide services dedicated to MDT Papyrus models
(diagram export, … )</li>
+ <li><a href="bundles_sirius.html"><strong>sirius</strong></a>: provide services dedicated to sirius models
+ (diagram export, … )</li>
</ul>
</body>
</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html
deleted file mode 100644
index 0cec578..0000000
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
- <head>
- <title>Capella</title>
- <link rel="stylesheet" type="text/css" href="userguide.css">
- </head>
-
- <body>
- <h2>9.4 Capella</h2>
- <p>To use Gendoc with <a href="https://www.polarsys.org/capella/">Capella</a> 1.0.X, you can use a 0.5.1 version available <a href="https://hudson.eclipse.org/gendoc/job/Gendoc-0.5-juno-maintenance/">here</a>.</p>
- <p><strong> </strong></p>
- </body>
-</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html
new file mode 100644
index 0000000..b4da72d
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+ <title>Papyrus</title>
+ <link rel="stylesheet" type="text/css" href="userguide.css">
+ </head>
+ <body>
+ <h2>HTML</h2>
+ <ul>
+ <li><strong>isHtml(String) : Boolean</strong></li>
+ </ul>
+ <p> Return if the given string contains HTML tags.</p>
+ <ul>
+ <li><strong>stripHtmlTags(String) : String </strong>
+ </li>
+ </ul>
+ <p>Return a string without html tags.</p>
+ <ul>
+ <li><strong>htmlToText(String) : String</strong></li>
+ </ul>
+ <p>Return a plain text string for the given html string. This provide simple
+ indentation and list marks.</p>
+ <ul>
+ <li><strong>textToHtml(String) : String</strong></li>
+ </ul>
+ <p> Return a html string for the given plain string. It consider list
+ marks and space and tabs to provide indentation in the HTML string, trying
+ to keep the simple format of the provided plain text.</p>
+ <p>
+ </p>
+ <p></p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
index c4807f6..4503a7c 100644
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
@@ -1,15 +1,40 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
- <head>
- <title>Papyrus</title>
- <link rel="stylesheet" type="text/css" href="userguide.css">
- </head>
-
- <body>
- <h2>Papyrus</h2>
- <ul>
- <li><strong>getPapyrusDiagrams(EObject) : Sequence(Diagram)</strong></li>
- </ul>
- <p>Get all the diagrams directly contained by an element.</p>
- </body>
+ <head>
+ <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+ <title>Papyrus</title>
+ <link rel="stylesheet" type="text/css" href="userguide.css">
+ </head>
+ <body>
+ <h2>Papyrus</h2>
+ <ul>
+ <li><strong>getPapyrusDiagrams(EObject) : Sequence(Diagram)</strong></li>
+ </ul>
+ <p>Get all the diagrams with the object as root object.</p>
+ <ul>
+ <li><b>getPapyrusOwnedDiagrams(EObject) : Sequence(Diagram)</b></li>
+ </ul>
+ <p>Get all the diagrams owned by the object.</p>
+ <ul>
+ <li><b>getDocumentation(EObject) : String</b></li>
+ </ul>
+ <p>Get the documentation of an object.</p>
+ <ul>
+ <li><strong>getDocumentationResources(EObject) : Sequence(String)</strong></li>
+ </ul>
+ <p>Get the documentation resources of an object.</p>
+ <ul>
+ <li><strong>replaceLinksByNameOrLabel(String, EObject) : String</strong></li>
+ </ul>
+ <p>Replace the links in the string with the name or the label of the object,
+ using the Eobject as context to resolve the link.</p>
+ <ul>
+ <li><strong>getPapyrusTables (EObject) : Sequence(Table)</strong></li>
+ </ul>
+ <p>Get the tables of an object.</p>
+ <ul>
+ <li><strong>getAppliedComment(Element) : Bag(String)</strong> </li>
+ </ul>
+ <p>Get the applied comments.</p>
+ </body>
</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html
new file mode 100644
index 0000000..ebd1e3a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+ <title>Capella</title>
+ <link rel="stylesheet" type="text/css" href="userguide.css">
+ </head>
+ <body>
+ <h2>Sirius</h2>
+ <ul>
+ <li><strong>getSiriusDiagrams(EObject) : Sequence(Diagram)</strong></li>
+ </ul>
+ <p>Get the diagrams of an object.</p>
+ <ul>
+ <li><strong>getSiriusDiagramName(Diagram) : String</strong></li>
+ </ul>
+ <p>Get the name of the diagram.</p>
+ <ul>
+ <li><strong> getSiriusTables(EObject) : Sequence(Table)</strong></li>
+ </ul>
+ <p>Get the tables of an object</p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc/userguide.xml b/plugins/org.eclipse.gendoc.doc/userguide.xml
index 482dd20..89b7174 100644
--- a/plugins/org.eclipse.gendoc.doc/userguide.xml
+++ b/plugins/org.eclipse.gendoc.doc/userguide.xml
@@ -14,11 +14,13 @@
<topic href="html/userguide/bundles.html" label="Gendoc Bundles">
<topic href="html/userguide/bundles_common.html" label="Common">
</topic>
+ <topic href="html/userguide/bundles_html.html" label="HTML">
+ </topic>
<topic href="html/userguide/bundles_gmf.html" label="Gmf">
</topic>
<topic href="html/userguide/bundles_papyrus.html" label="Papyrus">
</topic>
- <topic href="html/userguide/bundles_capella.html" label="Capella">
+ <topic href="html/userguide/bundles_sirius.html" label="Sirius">
</topic>
</topic>
<topic href="html/userguide/appendix.html" label="Appendix: Overview of all Gendoc tags and attributes">
diff --git a/plugins/org.eclipse.gendoc.documents/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.documents/META-INF/MANIFEST.MF
index 4239aa5..3d67e89 100644
--- a/plugins/org.eclipse.gendoc.documents/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.documents/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@
org.eclipse.gendoc.tags.parsers,
org.eclipse.gendoc.services,
org.eclipse.gendoc.tags,
- org.apache.xmlgraphics
+ org.apache.xmlgraphics,
+ org.eclipse.gendoc.table
Export-Package: org.eclipse.gendoc.documents
Bundle-ClassPath: .
diff --git a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/AbstractTableService.java b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/AbstractTableService.java
new file mode 100644
index 0000000..6c24976
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/AbstractTableService.java
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * Copyright (c) 2017 Atos.
+ *
+ *
+ * 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:
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.gendoc.documents;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.gendoc.documents.impl.IDGenerator;
+import org.eclipse.gendoc.services.AbstractService;
+
+import org.eclipse.gendoc.table.Table;
+
+public abstract class AbstractTableService extends AbstractService implements ITableService{
+
+ /**
+ *
+ * This table is dedicated to save table instances
+ * Table Map
+ */
+ private final Map<String, Table> tableMap = new HashMap<String,Table>();
+
+ public String getTableId(Table table) {
+ String key = IDGenerator.nextID();
+ tableMap.put(key, table);
+ return key;
+ }
+
+ public Table getTable(String tableId){
+ return tableMap.get(tableId);
+ }
+}
diff --git a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/IDocumentService.java b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/IDocumentService.java
index 5ff814e..2a50bed 100644
--- a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/IDocumentService.java
+++ b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/IDocumentService.java
@@ -9,7 +9,8 @@
*
* Contributors:
* Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
- *
+ * Antonio Campesino Robles (Ericsson) - Bug 478883
+ *
*****************************************************************************/
package org.eclipse.gendoc.documents;
@@ -92,6 +93,8 @@
boolean isRow(String label);
+ boolean isCell(String label);
+
String getListLabel();
String getListId(Node n);
@@ -100,6 +103,12 @@
String getTableLabel();
+
+
+ String getRowLabel();
+
+ String getCellLabel();
+
IAdditionalResourceService getAdditionalResourceService();
/**
@@ -133,4 +142,6 @@
* @return
*/
public String format(String input);
+
+ ITableService getTableService();
}
diff --git a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/ITableService.java b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/ITableService.java
new file mode 100644
index 0000000..a016edd
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/ITableService.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * Copyright (c) 2017 Atos.
+ *
+ *
+ * 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:
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.gendoc.documents;
+
+import org.eclipse.gendoc.services.IService;
+import org.eclipse.gendoc.services.exception.InvalidContentException;
+import org.eclipse.gendoc.tags.ITag;
+import org.w3c.dom.Node;
+
+import org.eclipse.gendoc.table.Table;
+
+public interface ITableService extends IService {
+
+
+ /**
+ * Returns the generated table
+ * @param tag
+ * @param documentService
+ * @param returnValue
+ * @param tableModel
+ * @param tableNode
+ * @return
+ * @throws InvalidContentException
+ */
+ String manageTable(ITag tag, IDocumentService documentService, StringBuffer returnValue, Object tableModel,
+ Node tableNode) throws InvalidContentException;
+
+ /**
+ * Returns a unique Id for the table parameter
+ * @param e
+ * @return
+ */
+ String getTableId(Table e);
+
+
+ /**
+ * Returns the table whose id is given as parameter
+ * @param tableId
+ * @return
+ */
+ Table getTable(String tableId);
+
+}
diff --git a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
index 8a6621d..b594c5b 100644
--- a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
+++ b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
@@ -10,7 +10,7 @@
* Contributors:
* Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
* Anne Haugommard (Atos) anne.haugommard@atos.net - improvement in clean process
- * Antonio Campesino (Ericsson) - Fixing clean process removing duplicate fragments (Bug 526979)
+ * Antonio Campesino (Ericsson) - Bugs 526979, 484127
*
*****************************************************************************/
package org.eclipse.gendoc.documents;
@@ -49,6 +49,7 @@
import org.eclipse.gendoc.services.GendocServices;
import org.eclipse.gendoc.services.ILogger;
import org.eclipse.gendoc.services.exception.InvalidContentException;
+import org.eclipse.gendoc.tags.parsers.TagParser;
import org.eclipse.gendoc.tags.parsers.TagParserConfig;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -75,7 +76,7 @@
private final TransformerFactory transFactory = TransformerFactory.newInstance();
- private final Pattern pattern = Pattern.compile("<?.*?>");
+ private final Pattern pattern = Pattern.compile("<\\?.*\\?>");
private Document document;
@@ -489,61 +490,12 @@
* @param tagLabels list of valid tag labels
* @return true if string toCheck contains at least a full and valid tagLabel
*/
- public boolean containsFullTags(String toCheck, List<String> tagLabels)
- {
- if (toCheck == null)
- {
- return false;
- }
-
- int index = toCheck.lastIndexOf(TagParserConfig.SUP);
- if (index > -1 && containsOneOf(tagLabels, toCheck.substring(index)))
- {
- return false;
- }
- List<String> labelsToFind = new ArrayList<String>();
- boolean result = false;
- for (String tagLabel : tagLabels)
- {
- if (toCheck.matches(".*" + TagParserConfig.INF + "(/|)" + tagLabel + ".*"))
- {
- labelsToFind.add(tagLabel);
- }
- else if (tagLabel.startsWith(toCheck.replace(TagParserConfig.INF, "")))
- {
- labelsToFind.add(tagLabel);
- }
- }
-
- if (!labelsToFind.isEmpty())
- {
- result = true;
- }
-
- // Replace invalid quotes by valid ones
- String invalidQuoteRegex= "(";
- for (char quote : TagParserConfig.INVALID_QUOTES){
- invalidQuoteRegex+="\\"+quote+"|";
- }
- invalidQuoteRegex=invalidQuoteRegex.substring(0, invalidQuoteRegex.length()-1);
- invalidQuoteRegex+=")";
- toCheck = toCheck.replaceAll(invalidQuoteRegex, String.valueOf(TagParserConfig.VALID_QUOTE));
-
- String quote ="\\"+TagParserConfig.VALID_QUOTE;
- String limited = toCheck.replaceAll("="+quote+"[^="+quote+"]*"+quote+"", "");
-
-
- String unfinishedAttributeValue="[^=]*="+quote+"([^"+quote+"]*|([^"+quote+"]*"+quote+"[^"+quote+"]*"+quote+"[^"+quote+"]*)*)";
-
- for (String tagLabel : labelsToFind)
- {
- boolean unfinishedAttribute = limited.matches(unfinishedAttributeValue);
- boolean finishedTag = limited.matches(".*" + TagParserConfig.INF + "(/|)" + tagLabel + ".*(/|)" + TagParserConfig.SUP + "[^"+TagParserConfig.SUP+"]*");
- result = result && (!unfinishedAttribute)&& (finishedTag);
- }
- return result;
+ public boolean containsFullTags(String toCheck, List<String> tagLabels) {
+ TagParser parser = new TagParser(toCheck, tagLabels);
+ return parser.parse();
}
-
+
+
/**
* Checks if String to check contains the start of one of the labels
*
diff --git a/plugins/org.eclipse.gendoc.preferences/src/org/eclipse/gendoc/preferences/internal/PreferenceGendocSelectionConverter.java b/plugins/org.eclipse.gendoc.preferences/src/org/eclipse/gendoc/preferences/internal/PreferenceGendocSelectionConverter.java
index a659f8e..683df5f 100644
--- a/plugins/org.eclipse.gendoc.preferences/src/org/eclipse/gendoc/preferences/internal/PreferenceGendocSelectionConverter.java
+++ b/plugins/org.eclipse.gendoc.preferences/src/org/eclipse/gendoc/preferences/internal/PreferenceGendocSelectionConverter.java
@@ -82,6 +82,8 @@
EObject eobj = getEObject(selectedObject);
if (eobj instanceof EObject) {
Resource eresource = eobj.eResource();
+ if (eresource == null)
+ return null;
URI eUri = eresource.getURI();
if (eUri.isPlatformResource()) {
String platformString = eUri.toPlatformString(true);
@@ -94,7 +96,7 @@
file = (IFile)((IAdaptable)selectedObject).getAdapter(IFile.class);
// Papyrus set file support.
- if (file != null && file.getFileExtension().endsWith("di")) {
+ if (file != null && file.getFileExtension() != null && file.getFileExtension().endsWith("di")) {
String name = file.getName();
IResource r = file.getParent().findMember(name.substring(0,name.length()-2)+"uml");
if (r instanceof IFile)
diff --git a/plugins/org.eclipse.gendoc.services.docx/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.services.docx/META-INF/MANIFEST.MF
index f4291ae..72c86f2 100644
--- a/plugins/org.eclipse.gendoc.services.docx/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.services.docx/META-INF/MANIFEST.MF
@@ -11,9 +11,12 @@
org.eclipse.gendoc.services,
org.eclipse.gendoc.tags,
org.eclipse.gendoc.tags.handlers,
- org.eclipse.gendoc.documents.metadata
+ org.eclipse.gendoc.documents.metadata,
+ org.eclipse.gendoc.ui,
+ org.eclipse.gendoc.table
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.gendoc.services.docx
Eclipse-RegisterBuddy: org.eclipse.gendoc.services
-Import-Package: org.eclipse.emf.common.util
+Import-Package: org.eclipse.emf.common.util,
+ org.eclipse.draw2d.graph
diff --git a/plugins/org.eclipse.gendoc.services.docx/plugin.xml b/plugins/org.eclipse.gendoc.services.docx/plugin.xml
index c9ebdaa..18bca6f 100644
--- a/plugins/org.eclipse.gendoc.services.docx/plugin.xml
+++ b/plugins/org.eclipse.gendoc.services.docx/plugin.xml
@@ -8,5 +8,27 @@
extension="docx">
</documentType>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
+ commandId="org.eclipse.gendoc.script">
+ <activeWhen>
+ <iterate>
+ <or>
+ <and>
+ <instanceof
+ value="org.eclipse.core.resources.IFile">
+ </instanceof>
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="docx">
+ </test>
+ </and>
+ </or>
+ </iterate>
+ </activeWhen>
+ </handler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXDocumentService.java b/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXDocumentService.java
index 0893b13..37aeee5 100644
--- a/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXDocumentService.java
+++ b/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXDocumentService.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Anne Haugommard (Atos Origin) anne.haugommard@atosorigin.com - Initial API and implementation
+ * Antonio Campesino Robles (Ericsson) - Bug 478883
*
*****************************************************************************/
package org.eclipse.gendoc.services.docx;
@@ -38,6 +39,7 @@
import org.eclipse.gendoc.document.parser.documents.docx.DocxNamespaceContext;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
import org.eclipse.gendoc.documents.IMimeHtmlService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.documents.XMLDocumentService;
import org.eclipse.gendoc.documents.metadata.IDocumentMetadataService;
import org.eclipse.gendoc.services.exception.DocumentServiceException;
@@ -64,11 +66,14 @@
/** The Constant TRANSFORMER_FACTORY create a XML transformation . */
private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance();
+ private ITableService tableService;
+
public DOCXDocumentService()
{
super();
additionalResourceService = new DOCXAdditionalResourceService();
mimehtmlservice = new DOCXMimeHtmlService();
+ tableService = new DOCXTableService();
}
public DOCXDocumentService(Document document)
@@ -76,6 +81,7 @@
super(document);
additionalResourceService = new DOCXAdditionalResourceService();
mimehtmlservice = new DOCXMimeHtmlService();
+ tableService = new DOCXTableService();
}
public String getListLabel()
@@ -107,6 +113,25 @@
{
return "w:tr".equals(label);
}
+
+
+
+ public String getRowLabel() {
+
+ return "w:tr";
+ }
+
+ public String getCellLabel()
+ {
+ return "w:tc";
+ }
+
+
+
+ public boolean isCell(String label)
+ {
+ return "w:tc".equals(label);
+ }
public String getTextStyle()
{
@@ -489,5 +514,14 @@
}
private Map<String, String> mapping;
- }
+ }
+
+
+
+ @Override
+ public ITableService getTableService() {
+ return tableService;
+ }
+
+
}
diff --git a/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXTableService.java b/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXTableService.java
new file mode 100644
index 0000000..4e973c9
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.services.docx/src/org/eclipse/gendoc/services/docx/DOCXTableService.java
@@ -0,0 +1,179 @@
+/*****************************************************************************
+ * Copyright (c) 2017 Atos.
+ *
+ *
+ * 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:
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.gendoc.services.docx;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gendoc.documents.AbstractTableService;
+import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.services.exception.InvalidContentException;
+import org.eclipse.gendoc.tags.ITag;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.Table;
+
+public class DOCXTableService extends AbstractTableService {
+
+ /*
+ *
+ * @see
+ * org.eclipse.gendoc.documents.ITableService#manageTable(org.eclipse.gendoc
+ * .tags.ITag, org.eclipse.gendoc.documents.IDocumentService,
+ * java.lang.StringBuffer, java.lang.Object, org.w3c.dom.Node)
+ */
+ public String manageTable(ITag tag, IDocumentService documentService, StringBuffer returnValue, Object tableModel,
+ Node tableNode) throws InvalidContentException {
+ Node mainTable = tableNode.getFirstChild();
+ if (documentService.isTable(mainTable.getNodeName())) {
+ if (tableModel instanceof Table) {
+
+ // extract width of the table to generate
+ String wdth = getChildNode("w:gridCol", getChildNode("w:tblGrid", mainTable)).getAttributes()
+ .getNamedItem("w:w").getNodeValue();
+ Node rowNode = getChildNode(documentService.getRowLabel(), mainTable);
+ String rowLabel = documentService.getRowLabel();
+ /**
+ * FIXME find a better way to get the row label index
+ */
+ Pattern rowPattern = Pattern.compile("<" + rowLabel + "[^<>]*>.*</" + rowLabel + ">");
+ Matcher rowm = rowPattern.matcher(returnValue);
+ int index_row_start = 0;
+ int index_row_end = 0;
+ if (rowm.find()) {
+ index_row_start = rowm.start();
+ index_row_end = returnValue.lastIndexOf("</" + rowLabel + ">");
+ String row = returnValue.substring(index_row_start, index_row_end + rowLabel.length() + 3);
+ String colLabel = documentService.getCellLabel();
+ int index_col_start = row.lastIndexOf("<" + colLabel + ">");
+ int index_col_end = row.lastIndexOf("</" + colLabel + ">");
+ Node colNode = getChildNode(documentService.getCellLabel(), rowNode);
+ int nbCol = ((Table) tableModel).getColCount();
+ int colWidth = Math.round(Integer.parseInt(wdth) / nbCol);
+ getChildNode("w:tcW", getChildNode("w:tcPr", colNode)).getAttributes().getNamedItem("w:w")
+ .setNodeValue(String.valueOf(colWidth));
+ StringBuffer colNodetxt = new StringBuffer(documentService.asText(colNode));
+ String txtLabel = "w:p";
+ String txtstyleLabel = "w:rPr";
+ Pattern txtPattern = Pattern.compile("<" + txtLabel + "[^<>]*>.*</" + txtLabel + ">");
+ Pattern txtstylePattern = Pattern
+ .compile("<" + txtstyleLabel + "[^<>]*>.*</" + txtstyleLabel + ">");
+ Matcher txtm = txtPattern.matcher(colNodetxt);
+ Matcher txtstylem = txtstylePattern.matcher(colNodetxt);
+ if (txtm.find()) {
+ String style = "";
+ if (txtstylem.find()) {
+ style = colNodetxt.substring(txtstylem.start(),
+ txtstylem.end() + txtstyleLabel.length() + 3);
+ }
+
+ return generateTable(returnValue, tableModel, rowLabel, index_row_start, index_row_end, row,
+ colLabel, index_col_start, index_col_end, colNodetxt, txtm, style, txtLabel);
+ }
+ }
+ }
+
+ }
+ return null;
+ }
+
+ /**
+ * Get a node from the parent node given as parameter
+ *
+ * @param label
+ * of the node to fetch
+ * @param parentnode
+ * @return
+ */
+ private Node getChildNode(String label, Node parentnode) {
+
+ NodeList rowChildNodes = parentnode.getChildNodes();
+ for (int i = 0; i < rowChildNodes.getLength(); i++) {
+ Node current = rowChildNodes.item(i);
+ if (current.getNodeName() == label) {
+ return current;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Generates the table
+ *
+ * @param returnValue
+ * @param tableModel
+ * @param rowLabel
+ * @param index_row_start
+ * @param index_row_end
+ * @param row
+ * @param colLabel
+ * @param index_col_start
+ * @param index_col_end
+ * @param colNodetxt
+ * @param txtm
+ * @param rows
+ * @param style
+ * @param txtLabel
+ * @return
+ */
+ private String generateTable(StringBuffer returnValue, Object tableModel, String rowLabel, int index_row_start,
+ int index_row_end, String row, String colLabel, int index_col_start, int index_col_end,
+ StringBuffer colNodetxt, Matcher txtm, String style, String txtLabel) {
+ String rows = "";
+ String cells = "";
+ // generate table header
+ StringBuffer newRow = new StringBuffer(row);
+ cells = generateCells(((Table) tableModel).getTableheader().getCells(), colNodetxt, txtm, style, txtLabel);
+ newRow.replace(index_col_start, index_col_end + colLabel.length() + 3, cells);
+ rows += newRow.toString();
+ // generate table body
+ for (Row r : ((Table) tableModel).getRows()) {
+ newRow = new StringBuffer(row);
+ cells = generateCells(r.getCells(), colNodetxt, txtm, style, txtLabel);
+ newRow.replace(index_col_start, index_col_end + colLabel.length() + 3, cells);
+ rows += newRow.toString();
+ }
+ return returnValue.replace(index_row_start, index_row_end + rowLabel.length() + 3, rows).toString();
+ }
+
+ /**
+ * Generates a row
+ *
+ * @param modelCells
+ * @param colNodetxt
+ * @param txtm
+ * @param style
+ * @param txtLabel
+ * @param cols
+ * @return
+ */
+ private String generateCells(EList<Cell> modelCells, StringBuffer colNodetxt, Matcher txtm, String style,
+ String txtLabel) {
+ String cols = "";
+ for (Cell cell : modelCells) {
+ StringBuffer newCol;
+ int txtindex = txtm.end() - txtLabel.length() - 3;
+ newCol = new StringBuffer(colNodetxt.toString());
+ newCol.insert(txtindex, "<w:r>" + style + "<w:t>" + cell.getLabel() + "</w:t></w:r>");
+ cols += newCol.toString();
+
+ }
+ return cols;
+ }
+
+}
diff --git a/plugins/org.eclipse.gendoc.services.odt/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.services.odt/META-INF/MANIFEST.MF
index ffc785a..e4747ca 100644
--- a/plugins/org.eclipse.gendoc.services.odt/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.services.odt/META-INF/MANIFEST.MF
@@ -11,7 +11,9 @@
org.eclipse.gendoc.documents,
org.eclipse.gendoc.services,
org.eclipse.gendoc.tags,
- org.eclipse.gendoc.tags.handlers
+ org.eclipse.gendoc.ui,
+ org.eclipse.gendoc.tags.handlers,
+ org.eclipse.gendoc.table
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.gendoc.services.odt
diff --git a/plugins/org.eclipse.gendoc.services.odt/plugin.xml b/plugins/org.eclipse.gendoc.services.odt/plugin.xml
index 5c01938..2413ecf 100644
--- a/plugins/org.eclipse.gendoc.services.odt/plugin.xml
+++ b/plugins/org.eclipse.gendoc.services.odt/plugin.xml
@@ -8,5 +8,27 @@
extension="odt">
</documentType>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
+ commandId="org.eclipse.gendoc.script">
+ <activeWhen>
+ <iterate>
+ <or>
+ <and>
+ <instanceof
+ value="org.eclipse.core.resources.IFile">
+ </instanceof>
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="odt">
+ </test>
+ </and>
+ </or>
+ </iterate>
+ </activeWhen>
+ </handler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTDocumentService.java b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTDocumentService.java
index 06c8ed2..accf1ac 100644
--- a/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTDocumentService.java
+++ b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTDocumentService.java
@@ -9,7 +9,8 @@
*
* Contributors:
* Anne Haugommard (Atos Origin) anne.haugommard@atosorigin.com - Initial API and implementation
- *
+ * Antonio Campesino Robles (Ericsson) - Bug 478883
+ *
*****************************************************************************/
package org.eclipse.gendoc.services.odt;
@@ -37,6 +38,7 @@
import org.eclipse.gendoc.document.parser.documents.odt.ODTDocument;
import org.eclipse.gendoc.document.parser.documents.odt.ODTNamespaceContext;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.documents.XMLDocumentService;
import org.eclipse.gendoc.services.exception.DocumentServiceException;
import org.eclipse.gendoc.services.exception.InvalidContentException;
@@ -63,17 +65,19 @@
private final String TAG_TABLE = "table:table";
private String serviceId;
-
+ private ITableService tableService;
public ODTDocumentService()
{
super();
additionalResourceService = new ODTAdditionalResourceService();
+ tableService = new ODTTableService();
}
public ODTDocumentService(Document document)
{
super(document);
additionalResourceService = new ODTAdditionalResourceService();
+ tableService = new ODTTableService();
}
public boolean isList(String label)
@@ -101,6 +105,11 @@
return "table:table-row".equals(label);
}
+ public boolean isCell(String label)
+ {
+ return "table:table-cell".equals(label);
+ }
+
public String getTextStyle()
{
return "(text:p|text:h|text:span)";
@@ -463,5 +472,27 @@
.replace(TABULATION,TAB)
.replace("\t",TAB);
}
-
+
+ @Override
+ public String getRowLabel() {
+ return "table:table-row";
+ }
+
+ @Override
+ public String getCellLabel() {
+
+ return "table:table-cell";
+ }
+
+
+
+
+ @Override
+ public ITableService getTableService() {
+
+ return tableService;
+ }
+
+
+
}
diff --git a/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTImageService.java b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTImageService.java
index a01d7d4..9341dc5 100644
--- a/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTImageService.java
+++ b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTImageService.java
@@ -10,6 +10,7 @@
* Contributors:
* Anne Haugommard (Atos Origin) anne.haugommard@atosorigin.com - Initial API and implementation
* Papa Malick WADE (Atos Origin) papa-malick.wade@atosorigin.com - add catching error with id
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - fix bug #514712 : fill draw:name attribute with a unique ID
*****************************************************************************/
package org.eclipse.gendoc.services.odt;
@@ -17,6 +18,7 @@
import java.util.regex.Pattern;
import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gendoc.documents.AbstractImageService;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
import org.eclipse.gendoc.documents.IDocumentService;
@@ -129,8 +131,9 @@
m = p.matcher(newTagContent);
if (m.find())
{
-
- String toInsert = "<draw:frame xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" text:anchor-type=\"frame\" svg:width=\""+(d.getWidth())+"cm\" style:rel-width=\"100%\" svg:height=\""+(d.getHeight())+"cm\" style:rel-height=\"scale\" >" +
+ String uuid = EcoreUtil.generateUUID();
+
+ String toInsert = "<draw:frame draw:name=\""+imageId+uuid+"\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" text:anchor-type=\"frame\" svg:width=\""+(d.getWidth())+"cm\" style:rel-width=\"100%\" svg:height=\""+(d.getHeight())+"cm\" style:rel-height=\"scale\" >" +
"<draw:image xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"" + resourceService.getImageRelativePath(imageId)
+ "\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\"/></draw:frame>";
diff --git a/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTTableService.java b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTTableService.java
new file mode 100644
index 0000000..045d4a3
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.services.odt/src/org/eclipse/gendoc/services/odt/ODTTableService.java
@@ -0,0 +1,153 @@
+/*****************************************************************************
+ * Copyright (c) 2017 Atos.
+ *
+ *
+ * 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:
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.gendoc.services.odt;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gendoc.documents.AbstractTableService;
+import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.services.exception.InvalidContentException;
+import org.eclipse.gendoc.tags.ITag;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.Table;
+
+public class ODTTableService extends AbstractTableService {
+
+ @Override
+ public String manageTable(ITag tag, IDocumentService documentService, StringBuffer returnValue, Object tableModel,
+ Node tableNode) throws InvalidContentException {
+
+ Node mainTable = tableNode.getFirstChild();
+ if (documentService.isTable(mainTable.getNodeName())) {
+ if (tableModel instanceof Table) {
+
+ int nbCol = ((Table) tableModel).getColCount();
+ String colLabel = "table:table-column";
+ int index_col_start = returnValue.indexOf("<" + colLabel);
+ returnValue.insert(index_col_start + colLabel.length() + 1,
+ " table:number-columns-repeated=\"" + nbCol + "\"");
+ Node rowNode = getChildNode(documentService.getRowLabel(), mainTable);
+ String rowLabel = documentService.getRowLabel();
+
+ Pattern rowPattern = Pattern.compile("<" + rowLabel + "[^<>]*>.*</" + rowLabel + ">");
+ Matcher rowm = rowPattern.matcher(returnValue);
+ int index_row_start = 0;
+ int index_row_end = 0;
+ if (rowm.find()) {
+ index_row_start = rowm.start();
+ index_row_end = returnValue.lastIndexOf("</" + rowLabel + ">");
+
+ String row = returnValue.substring(index_row_start, index_row_end + rowLabel.length() + 3);
+
+ String cellLabel = documentService.getCellLabel();
+ int index_cell_start = row.indexOf("<" + cellLabel);
+ int index_cell_end = row.lastIndexOf("</" + cellLabel + ">");
+
+ Node cellNode = getChildNode(documentService.getCellLabel(), rowNode);
+ if (cellNode != null) {
+ StringBuffer colNodetxt = new StringBuffer(documentService.asText(cellNode));
+ String txtLabel = "text:p";
+ Pattern txtPattern = Pattern.compile("<" + txtLabel + "[^<>]*>.*</" + txtLabel + ">");
+ Matcher txtm = txtPattern.matcher(colNodetxt);
+ if (txtm.find()) {
+ String style = "";
+ return generateTable(returnValue, tableModel, rowLabel, index_row_start, index_row_end, row,
+ cellLabel, index_cell_start, index_cell_end, colNodetxt, txtm, style, txtLabel);
+ }
+ }
+ }
+ }
+
+ }
+ return null;
+ }
+
+ private Node getChildNode(String label, Node node) {
+
+ NodeList rowChildNodes = node.getChildNodes();
+ for (int i = 0; i < rowChildNodes.getLength(); i++) {
+ Node current = rowChildNodes.item(i);
+ if (current.getNodeName() == label) {
+ return current;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param returnValue
+ * @param tableModel
+ * @param rowLabel
+ * @param index_row_start
+ * @param index_row_end
+ * @param row
+ * @param colLabel
+ * @param index_col_start
+ * @param index_col_end
+ * @param colNodetxt
+ * @param txtm
+ * @param rows
+ * @param style
+ * @param txtLabel
+ * @return
+ */
+ private String generateTable(StringBuffer returnValue, Object tableModel, String rowLabel, int index_row_start,
+ int index_row_end, String row, String colLabel, int index_col_start, int index_col_end,
+ StringBuffer colNodetxt, Matcher txtm, String style, String txtLabel) {
+ String rows = "";
+ String cells = "";
+ // generating table header
+ StringBuffer newRow = new StringBuffer(row);
+ cells = generateCells(((Table) tableModel).getTableheader().getCells(), colNodetxt, txtm, style, txtLabel);
+ newRow.replace(index_col_start, index_col_end + colLabel.length() + 3, cells);
+ rows += newRow.toString();
+ // generating table body
+ for (Row r : ((Table) tableModel).getRows()) {
+ newRow = new StringBuffer(row);
+ cells = generateCells(r.getCells(), colNodetxt, txtm, style, txtLabel);
+ newRow.replace(index_col_start, index_col_end + colLabel.length() + 3, cells);
+ rows += newRow.toString();
+ }
+ return returnValue.replace(index_row_start, index_row_end + rowLabel.length() + 3, rows).toString();
+ }
+
+ /**
+ * @param modelCells
+ * @param colNodetxt
+ * @param txtm
+ * @param style
+ * @param txtLabel
+ * @param cols
+ * @return
+ */
+ private String generateCells(EList<Cell> modelCells, StringBuffer colNodetxt, Matcher txtm, String style,
+ String txtLabel) {
+ String cols = "";
+ for (Cell cell : modelCells) {
+ StringBuffer newCol;
+ int txtindex = txtm.end() - txtLabel.length() - 3;
+ newCol = new StringBuffer(colNodetxt.toString());
+ newCol.insert(txtindex, cell.getLabel());
+ cols += newCol.toString();
+ }
+ return cols;
+ }
+
+}
diff --git a/plugins/org.eclipse.gendoc.services.pptx/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.services.pptx/META-INF/MANIFEST.MF
index 7d263ab..9ccc226 100644
--- a/plugins/org.eclipse.gendoc.services.pptx/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.services.pptx/META-INF/MANIFEST.MF
@@ -16,4 +16,5 @@
org.eclipse.gendoc.tags.handlers,
org.eclipse.gendoc.process,
org.eclipse.gendoc.tags,
- org.eclipse.gendoc.document.parser.pptx
+ org.eclipse.gendoc.document.parser.pptx,
+ org.eclipse.gendoc.ui
diff --git a/plugins/org.eclipse.gendoc.services.pptx/plugin.xml b/plugins/org.eclipse.gendoc.services.pptx/plugin.xml
index 0409292..c301180 100644
--- a/plugins/org.eclipse.gendoc.services.pptx/plugin.xml
+++ b/plugins/org.eclipse.gendoc.services.pptx/plugin.xml
@@ -89,5 +89,27 @@
</tagref>
</category>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
+ commandId="org.eclipse.gendoc.script">
+ <activeWhen>
+ <iterate>
+ <or>
+ <and>
+ <instanceof
+ value="org.eclipse.core.resources.IFile">
+ </instanceof>
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="pptx">
+ </test>
+ </and>
+ </or>
+ </iterate>
+ </activeWhen>
+ </handler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.services.pptx/src/org/eclipse/gendoc/services/pptx/PPTXDocumentService.java b/plugins/org.eclipse.gendoc.services.pptx/src/org/eclipse/gendoc/services/pptx/PPTXDocumentService.java
index e7b1541..199d6dc 100644
--- a/plugins/org.eclipse.gendoc.services.pptx/src/org/eclipse/gendoc/services/pptx/PPTXDocumentService.java
+++ b/plugins/org.eclipse.gendoc.services.pptx/src/org/eclipse/gendoc/services/pptx/PPTXDocumentService.java
@@ -8,7 +8,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Antonio Campesino (Ericsson) antonio.campesino.robles@ericsson.com - Initial API and implementation
+ * Antonio Campesino (Ericsson) antonio.campesino.robles@ericsson.com - Initial API and implementation,
+ * Bug 478883
*
*****************************************************************************/
package org.eclipse.gendoc.services.pptx;
@@ -37,6 +38,7 @@
import org.eclipse.gendoc.document.parser.pptx.PPTXNamespaceContext;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.documents.XMLDocumentService;
import org.eclipse.gendoc.services.exception.DocumentServiceException;
import org.eclipse.gendoc.services.exception.InvalidContentException;
@@ -184,6 +186,10 @@
return false;
}
+ @Override
+ public boolean isCell(String label) {
+ return false;
+ }
// TODO: The nobr tag can not use pattern matching as the pptx format use <t> tags with
// xml:space="preserve" or by default preserve blanks.
@@ -326,4 +332,22 @@
return null;
}
+ @Override
+ public String getRowLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getCellLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITableService getTableService() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.gendoc.services.xlsx/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.services.xlsx/META-INF/MANIFEST.MF
index 6ccb3db..cb57554 100644
--- a/plugins/org.eclipse.gendoc.services.xlsx/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.services.xlsx/META-INF/MANIFEST.MF
@@ -13,6 +13,7 @@
org.eclipse.gendoc.process,
org.eclipse.gendoc.tags,
org.eclipse.emf.common,
- org.eclipse.gendoc.document.parser.xlsx
+ org.eclipse.gendoc.document.parser.xlsx,
+ org.eclipse.gendoc.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.gendoc.services.xlsx/plugin.xml b/plugins/org.eclipse.gendoc.services.xlsx/plugin.xml
index a993790..15e08b5 100644
--- a/plugins/org.eclipse.gendoc.services.xlsx/plugin.xml
+++ b/plugins/org.eclipse.gendoc.services.xlsx/plugin.xml
@@ -24,5 +24,27 @@
</successor>
</process>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
+ commandId="org.eclipse.gendoc.script">
+ <activeWhen>
+ <iterate>
+ <or>
+ <and>
+ <instanceof
+ value="org.eclipse.core.resources.IFile">
+ </instanceof>
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="xlsx">
+ </test>
+ </and>
+ </or>
+ </iterate>
+ </activeWhen>
+ </handler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.services.xlsx/src/org/eclipse/gendoc/services/xlsx/XLSXDocumentService.java b/plugins/org.eclipse.gendoc.services.xlsx/src/org/eclipse/gendoc/services/xlsx/XLSXDocumentService.java
index a197ba4..52da8ea 100644
--- a/plugins/org.eclipse.gendoc.services.xlsx/src/org/eclipse/gendoc/services/xlsx/XLSXDocumentService.java
+++ b/plugins/org.eclipse.gendoc.services.xlsx/src/org/eclipse/gendoc/services/xlsx/XLSXDocumentService.java
@@ -8,7 +8,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Antonio Campesino (Ericsson) antonio.campesino.robles@ericsson.com - Initial API and implementation
+ * Antonio Campesino (Ericsson) antonio.campesino.robles@ericsson.com - Initial API and implementation,
+ * Bug 478883
*
*****************************************************************************/
package org.eclipse.gendoc.services.xlsx;
@@ -39,6 +40,7 @@
import org.eclipse.gendoc.document.parser.xlsx.XLSXParser;
import org.eclipse.gendoc.documents.IAdditionalResourceService;
import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.documents.XMLDocumentService;
import org.eclipse.gendoc.services.exception.DocumentServiceException;
import org.eclipse.gendoc.services.exception.InvalidContentException;
@@ -192,6 +194,10 @@
return false;
}
+ @Override
+ public boolean isCell(String label) {
+ return false;
+ }
// TODO: The nobr tag can not use pattern matching as the xlsx format use <t> tags with
// xml:space="preserve" or by default preserve blanks.
@@ -333,4 +339,23 @@
return null;
}
+ @Override
+ public String getRowLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getCellLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITableService getTableService() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
}
diff --git a/plugins/org.eclipse.gendoc.table/.classpath b/plugins/org.eclipse.gendoc.table/.classpath
new file mode 100644
index 0000000..deb6736
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.gendoc.table/.gitignore b/plugins/org.eclipse.gendoc.table/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/plugins/org.eclipse.gendoc.table/.project b/plugins/org.eclipse.gendoc.table/.project
new file mode 100644
index 0000000..4e9b7a4
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gendoc.table</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.gendoc.table/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.gendoc.table/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..c537b63
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.gendoc.table/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.table/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..a04eb62
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.gendoc.table;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package:
+ org.eclipse.gendoc.table,
+ org.eclipse.gendoc.table.impl,
+ org.eclipse.gendoc.table.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.gendoc.table/build.properties b/plugins/org.eclipse.gendoc.table/build.properties
new file mode 100644
index 0000000..4465407
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/plugins/org.eclipse.gendoc.table/model/gendoc.aird b/plugins/org.eclipse.gendoc.table/model/gendoc.aird
new file mode 100644
index 0000000..a1f4610
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/model/gendoc.aird
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description" xmi:id="_AxnNADobEeerop7vJRGxDA" selectedViews="_A4iUYDobEeerop7vJRGxDA" version="11.1.0.201608251200">
+ <semanticResources>gendoc.ecore</semanticResources>
+ <semanticResources>gendoc.genmodel</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" xmi:id="_A4iUYDobEeerop7vJRGxDA">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
+ </ownedViews>
+</viewpoint:DAnalysis>
diff --git a/plugins/org.eclipse.gendoc.table/model/gendoc.ecore b/plugins/org.eclipse.gendoc.table/model/gendoc.ecore
new file mode 100644
index 0000000..ece6f5f
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/model/gendoc.ecore
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="gendoc" nsURI="http://www.eclipse.org/gendoc/1.0" nsPrefix="gendoc">
+ <eSubpackages name="table" nsURI="http://www.eclipse.org/gendoc/1.0/table" nsPrefix="table">
+ <eClassifiers xsi:type="ecore:EClass" name="Table">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral=""/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral=""/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="rows" upperBound="-1"
+ eType="#//table/Row"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="tableheader" eType="#//table/TableHeader"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Row">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="object" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="cells" upperBound="-1"
+ eType="#//table/Cell"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Cell">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="object" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral=""/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="TableHeader" eSuperTypes="#//table/Row"/>
+ </eSubpackages>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.gendoc.table/model/gendoc.genmodel b/plugins/org.eclipse.gendoc.table/model/gendoc.genmodel
new file mode 100644
index 0000000..635b272
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/model/gendoc.genmodel
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gendoc.model/src" modelPluginID="org.eclipse.gendoc.model"
+ modelName="Gendoc" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>gendoc.ecore</foreignModel>
+ <genPackages prefix="Gendoc" basePackage="org.eclipse" disposableProviderFactory="true"
+ ecorePackage="gendoc.ecore#/">
+ <nestedGenPackages prefix="Table" disposableProviderFactory="true" ecorePackage="gendoc.ecore#//table">
+ <genClasses ecoreClass="gendoc.ecore#//table/Table">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gendoc.ecore#//table/Table/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gendoc.ecore#//table/Table/type"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true"
+ ecoreFeature="ecore:EReference gendoc.ecore#//table/Table/rows"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true"
+ ecoreFeature="ecore:EReference gendoc.ecore#//table/Table/tableheader"/>
+ </genClasses>
+ <genClasses ecoreClass="gendoc.ecore#//table/Row">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gendoc.ecore#//table/Row/object"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true"
+ ecoreFeature="ecore:EReference gendoc.ecore#//table/Row/cells"/>
+ </genClasses>
+ <genClasses ecoreClass="gendoc.ecore#//table/Cell">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gendoc.ecore#//table/Cell/object"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gendoc.ecore#//table/Cell/label"/>
+ </genClasses>
+ <genClasses ecoreClass="gendoc.ecore#//table/TableHeader"/>
+ </nestedGenPackages>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/org.eclipse.gendoc.table/plugin.properties b/plugins/org.eclipse.gendoc.table/plugin.properties
new file mode 100644
index 0000000..a1b35f7
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = Gendoc Model
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.gendoc.table/plugin.xml b/plugins/org.eclipse.gendoc.table/plugin.xml
new file mode 100644
index 0000000..e54d39d
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/plugin.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated gendoc -->
+ <package
+ uri="http://www.eclipse.org/gendoc/1.0/table"
+ class="org.eclipse.gendoc.table.TablePackage"
+ genModel="model/gendoc.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.gendoc.table/pom.xml b/plugins/org.eclipse.gendoc.table/pom.xml
new file mode 100644
index 0000000..121fcf4
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/pom.xml
@@ -0,0 +1,12 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.gendoc</groupId>
+ <artifactId>parent</artifactId>
+ <relativePath>../../pom.xml</relativePath>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.gendoc.table</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Cell.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Cell.java
new file mode 100644
index 0000000..8642118
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Cell.java
@@ -0,0 +1,78 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Cell</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.Cell#getObject <em>Object</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.Cell#getLabel <em>Label</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.gendoc.table.TablePackage#getCell()
+ * @model
+ * @generated
+ */
+public interface Cell extends EObject {
+ /**
+ * Returns the value of the '<em><b>Object</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Object</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Object</em>' attribute.
+ * @see #setObject(Object)
+ * @see org.eclipse.gendoc.table.TablePackage#getCell_Object()
+ * @model
+ * @generated
+ */
+ Object getObject();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Cell#getObject <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Object</em>' attribute.
+ * @see #getObject()
+ * @generated
+ */
+ void setObject(Object value);
+
+ /**
+ * Returns the value of the '<em><b>Label</b></em>' attribute.
+ * The default value is <code>""</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Label</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Label</em>' attribute.
+ * @see #setLabel(String)
+ * @see org.eclipse.gendoc.table.TablePackage#getCell_Label()
+ * @model default=""
+ * @generated
+ */
+ String getLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Cell#getLabel <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Label</em>' attribute.
+ * @see #getLabel()
+ * @generated
+ */
+ void setLabel(String value);
+
+} // Cell
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Row.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Row.java
new file mode 100644
index 0000000..d638404
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Row.java
@@ -0,0 +1,69 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Row</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.Row#getObject <em>Object</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.Row#getCells <em>Cells</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.gendoc.table.TablePackage#getRow()
+ * @model
+ * @generated
+ */
+public interface Row extends EObject {
+ /**
+ * Returns the value of the '<em><b>Object</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Object</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Object</em>' attribute.
+ * @see #setObject(Object)
+ * @see org.eclipse.gendoc.table.TablePackage#getRow_Object()
+ * @model
+ * @generated
+ */
+ Object getObject();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Row#getObject <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Object</em>' attribute.
+ * @see #getObject()
+ * @generated
+ */
+ void setObject(Object value);
+
+ /**
+ * Returns the value of the '<em><b>Cells</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.gendoc.table.Cell}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Cells</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Cells</em>' reference list.
+ * @see org.eclipse.gendoc.table.TablePackage#getRow_Cells()
+ * @model
+ * @generated
+ */
+ EList<Cell> getCells();
+
+} // Row
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Table.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Table.java
new file mode 100644
index 0000000..141c20c
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/Table.java
@@ -0,0 +1,134 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Table</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.Table#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.Table#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.Table#getRows <em>Rows</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.Table#getTableheader <em>Tableheader</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.gendoc.table.TablePackage#getTable()
+ * @model
+ * @generated
+ */
+public interface Table extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * The default value is <code>""</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.gendoc.table.TablePackage#getTable_Name()
+ * @model default=""
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Table#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute.
+ * The default value is <code>""</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #setType(String)
+ * @see org.eclipse.gendoc.table.TablePackage#getTable_Type()
+ * @model default=""
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Table#getType <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' attribute.
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+ /**
+ * Returns the value of the '<em><b>Rows</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.gendoc.table.Row}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Rows</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Rows</em>' reference list.
+ * @see org.eclipse.gendoc.table.TablePackage#getTable_Rows()
+ * @model
+ * @generated
+ */
+ EList<Row> getRows();
+
+ /**
+ * Returns the value of the '<em><b>Tableheader</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Tableheader</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Tableheader</em>' reference.
+ * @see #setTableheader(TableHeader)
+ * @see org.eclipse.gendoc.table.TablePackage#getTable_Tableheader()
+ * @model
+ * @generated
+ */
+ TableHeader getTableheader();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gendoc.table.Table#getTableheader <em>Tableheader</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Tableheader</em>' reference.
+ * @see #getTableheader()
+ * @generated
+ */
+ void setTableheader(TableHeader value);
+
+
+ /**
+ * @generated NOT
+ */
+
+ int getColCount();
+
+
+
+} // Table
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableFactory.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableFactory.java
new file mode 100644
index 0000000..f02a062
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableFactory.java
@@ -0,0 +1,69 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- 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 -->
+ * @see org.eclipse.gendoc.table.TablePackage
+ * @generated
+ */
+public interface TableFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ TableFactory eINSTANCE = org.eclipse.gendoc.table.impl.TableFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Table</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Table</em>'.
+ * @generated
+ */
+ Table createTable();
+
+ /**
+ * Returns a new object of class '<em>Row</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Row</em>'.
+ * @generated
+ */
+ Row createRow();
+
+ /**
+ * Returns a new object of class '<em>Cell</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Cell</em>'.
+ * @generated
+ */
+ Cell createCell();
+
+ /**
+ * Returns a new object of class '<em>Header</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Header</em>'.
+ * @generated
+ */
+ TableHeader createTableHeader();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ TablePackage getTablePackage();
+
+} //TableFactory
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableHeader.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableHeader.java
new file mode 100644
index 0000000..1be93f8
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TableHeader.java
@@ -0,0 +1,17 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Header</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.gendoc.table.TablePackage#getTableHeader()
+ * @model
+ * @generated
+ */
+public interface TableHeader extends Row {
+} // TableHeader
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TablePackage.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TablePackage.java
new file mode 100644
index 0000000..849895a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/TablePackage.java
@@ -0,0 +1,519 @@
+/**
+ */
+package org.eclipse.gendoc.table;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.TableFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface TablePackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "table";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/gendoc/1.0/table";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "table";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ TablePackage eINSTANCE = org.eclipse.gendoc.table.impl.TablePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gendoc.table.impl.TableImpl <em>Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.TableImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getTable()
+ * @generated
+ */
+ int TABLE = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__TYPE = 1;
+
+ /**
+ * The feature id for the '<em><b>Rows</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__ROWS = 2;
+
+ /**
+ * The feature id for the '<em><b>Tableheader</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE__TABLEHEADER = 3;
+
+ /**
+ * The number of structural features of the '<em>Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_FEATURE_COUNT = 4;
+
+ /**
+ * The number of operations of the '<em>Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gendoc.table.impl.RowImpl <em>Row</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.RowImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getRow()
+ * @generated
+ */
+ int ROW = 1;
+
+ /**
+ * The feature id for the '<em><b>Object</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROW__OBJECT = 0;
+
+ /**
+ * The feature id for the '<em><b>Cells</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROW__CELLS = 1;
+
+ /**
+ * The number of structural features of the '<em>Row</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROW_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Row</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROW_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gendoc.table.impl.CellImpl <em>Cell</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.CellImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getCell()
+ * @generated
+ */
+ int CELL = 2;
+
+ /**
+ * The feature id for the '<em><b>Object</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CELL__OBJECT = 0;
+
+ /**
+ * The feature id for the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CELL__LABEL = 1;
+
+ /**
+ * The number of structural features of the '<em>Cell</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CELL_FEATURE_COUNT = 2;
+
+ /**
+ * The number of operations of the '<em>Cell</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CELL_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gendoc.table.impl.TableHeaderImpl <em>Header</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.TableHeaderImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getTableHeader()
+ * @generated
+ */
+ int TABLE_HEADER = 3;
+
+ /**
+ * The feature id for the '<em><b>Object</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_HEADER__OBJECT = ROW__OBJECT;
+
+ /**
+ * The feature id for the '<em><b>Cells</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_HEADER__CELLS = ROW__CELLS;
+
+ /**
+ * The number of structural features of the '<em>Header</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_HEADER_FEATURE_COUNT = ROW_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>Header</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TABLE_HEADER_OPERATION_COUNT = ROW_OPERATION_COUNT + 0;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gendoc.table.Table <em>Table</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Table</em>'.
+ * @see org.eclipse.gendoc.table.Table
+ * @generated
+ */
+ EClass getTable();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gendoc.table.Table#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.gendoc.table.Table#getName()
+ * @see #getTable()
+ * @generated
+ */
+ EAttribute getTable_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gendoc.table.Table#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type</em>'.
+ * @see org.eclipse.gendoc.table.Table#getType()
+ * @see #getTable()
+ * @generated
+ */
+ EAttribute getTable_Type();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.gendoc.table.Table#getRows <em>Rows</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Rows</em>'.
+ * @see org.eclipse.gendoc.table.Table#getRows()
+ * @see #getTable()
+ * @generated
+ */
+ EReference getTable_Rows();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.gendoc.table.Table#getTableheader <em>Tableheader</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Tableheader</em>'.
+ * @see org.eclipse.gendoc.table.Table#getTableheader()
+ * @see #getTable()
+ * @generated
+ */
+ EReference getTable_Tableheader();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gendoc.table.Row <em>Row</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Row</em>'.
+ * @see org.eclipse.gendoc.table.Row
+ * @generated
+ */
+ EClass getRow();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gendoc.table.Row#getObject <em>Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Object</em>'.
+ * @see org.eclipse.gendoc.table.Row#getObject()
+ * @see #getRow()
+ * @generated
+ */
+ EAttribute getRow_Object();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.gendoc.table.Row#getCells <em>Cells</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Cells</em>'.
+ * @see org.eclipse.gendoc.table.Row#getCells()
+ * @see #getRow()
+ * @generated
+ */
+ EReference getRow_Cells();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gendoc.table.Cell <em>Cell</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Cell</em>'.
+ * @see org.eclipse.gendoc.table.Cell
+ * @generated
+ */
+ EClass getCell();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gendoc.table.Cell#getObject <em>Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Object</em>'.
+ * @see org.eclipse.gendoc.table.Cell#getObject()
+ * @see #getCell()
+ * @generated
+ */
+ EAttribute getCell_Object();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gendoc.table.Cell#getLabel <em>Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Label</em>'.
+ * @see org.eclipse.gendoc.table.Cell#getLabel()
+ * @see #getCell()
+ * @generated
+ */
+ EAttribute getCell_Label();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gendoc.table.TableHeader <em>Header</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Header</em>'.
+ * @see org.eclipse.gendoc.table.TableHeader
+ * @generated
+ */
+ EClass getTableHeader();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ TableFactory getTableFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.gendoc.table.impl.TableImpl <em>Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.TableImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getTable()
+ * @generated
+ */
+ EClass TABLE = eINSTANCE.getTable();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TABLE__NAME = eINSTANCE.getTable_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TABLE__TYPE = eINSTANCE.getTable_Type();
+
+ /**
+ * The meta object literal for the '<em><b>Rows</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference TABLE__ROWS = eINSTANCE.getTable_Rows();
+
+ /**
+ * The meta object literal for the '<em><b>Tableheader</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference TABLE__TABLEHEADER = eINSTANCE.getTable_Tableheader();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gendoc.table.impl.RowImpl <em>Row</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.RowImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getRow()
+ * @generated
+ */
+ EClass ROW = eINSTANCE.getRow();
+
+ /**
+ * The meta object literal for the '<em><b>Object</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ROW__OBJECT = eINSTANCE.getRow_Object();
+
+ /**
+ * The meta object literal for the '<em><b>Cells</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ROW__CELLS = eINSTANCE.getRow_Cells();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gendoc.table.impl.CellImpl <em>Cell</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.CellImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getCell()
+ * @generated
+ */
+ EClass CELL = eINSTANCE.getCell();
+
+ /**
+ * The meta object literal for the '<em><b>Object</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CELL__OBJECT = eINSTANCE.getCell_Object();
+
+ /**
+ * The meta object literal for the '<em><b>Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CELL__LABEL = eINSTANCE.getCell_Label();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gendoc.table.impl.TableHeaderImpl <em>Header</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.impl.TableHeaderImpl
+ * @see org.eclipse.gendoc.table.impl.TablePackageImpl#getTableHeader()
+ * @generated
+ */
+ EClass TABLE_HEADER = eINSTANCE.getTableHeader();
+
+ }
+
+} //TablePackage
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/CellImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/CellImpl.java
new file mode 100644
index 0000000..f93bd5c
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/CellImpl.java
@@ -0,0 +1,217 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.TablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Cell</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.impl.CellImpl#getObject <em>Object</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.impl.CellImpl#getLabel <em>Label</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class CellImpl extends MinimalEObjectImpl.Container implements Cell {
+ /**
+ * The default value of the '{@link #getObject() <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getObject()
+ * @generated
+ * @ordered
+ */
+ protected static final Object OBJECT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getObject() <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getObject()
+ * @generated
+ * @ordered
+ */
+ protected Object object = OBJECT_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String LABEL_EDEFAULT = "";
+
+ /**
+ * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected String label = LABEL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CellImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return TablePackage.Literals.CELL;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getObject() {
+ return object;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setObject(Object newObject) {
+ Object oldObject = object;
+ object = newObject;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.CELL__OBJECT, oldObject, object));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLabel(String newLabel) {
+ String oldLabel = label;
+ label = newLabel;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.CELL__LABEL, oldLabel, label));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case TablePackage.CELL__OBJECT:
+ return getObject();
+ case TablePackage.CELL__LABEL:
+ return getLabel();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case TablePackage.CELL__OBJECT:
+ setObject(newValue);
+ return;
+ case TablePackage.CELL__LABEL:
+ setLabel((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case TablePackage.CELL__OBJECT:
+ setObject(OBJECT_EDEFAULT);
+ return;
+ case TablePackage.CELL__LABEL:
+ setLabel(LABEL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case TablePackage.CELL__OBJECT:
+ return OBJECT_EDEFAULT == null ? object != null : !OBJECT_EDEFAULT.equals(object);
+ case TablePackage.CELL__LABEL:
+ return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
+ }
+ 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(" (object: ");
+ result.append(object);
+ result.append(", label: ");
+ result.append(label);
+ result.append(')');
+ return result.toString();
+ }
+
+} //CellImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/RowImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/RowImpl.java
new file mode 100644
index 0000000..409c8cc
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/RowImpl.java
@@ -0,0 +1,205 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.TablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Row</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.impl.RowImpl#getObject <em>Object</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.impl.RowImpl#getCells <em>Cells</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class RowImpl extends MinimalEObjectImpl.Container implements Row {
+ /**
+ * The default value of the '{@link #getObject() <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getObject()
+ * @generated
+ * @ordered
+ */
+ protected static final Object OBJECT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getObject() <em>Object</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getObject()
+ * @generated
+ * @ordered
+ */
+ protected Object object = OBJECT_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getCells() <em>Cells</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCells()
+ * @generated
+ * @ordered
+ */
+ protected EList<Cell> cells;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected RowImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return TablePackage.Literals.ROW;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getObject() {
+ return object;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setObject(Object newObject) {
+ Object oldObject = object;
+ object = newObject;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.ROW__OBJECT, oldObject, object));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Cell> getCells() {
+ if (cells == null) {
+ cells = new EObjectResolvingEList<Cell>(Cell.class, this, TablePackage.ROW__CELLS);
+ }
+ return cells;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case TablePackage.ROW__OBJECT:
+ return getObject();
+ case TablePackage.ROW__CELLS:
+ return getCells();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case TablePackage.ROW__OBJECT:
+ setObject(newValue);
+ return;
+ case TablePackage.ROW__CELLS:
+ getCells().clear();
+ getCells().addAll((Collection<? extends Cell>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case TablePackage.ROW__OBJECT:
+ setObject(OBJECT_EDEFAULT);
+ return;
+ case TablePackage.ROW__CELLS:
+ getCells().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case TablePackage.ROW__OBJECT:
+ return OBJECT_EDEFAULT == null ? object != null : !OBJECT_EDEFAULT.equals(object);
+ case TablePackage.ROW__CELLS:
+ return cells != null && !cells.isEmpty();
+ }
+ 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(" (object: ");
+ result.append(object);
+ result.append(')');
+ return result.toString();
+ }
+
+} //RowImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableFactoryImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableFactoryImpl.java
new file mode 100644
index 0000000..71df54d
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableFactoryImpl.java
@@ -0,0 +1,128 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.gendoc.table.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TableFactoryImpl extends EFactoryImpl implements TableFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static TableFactory init() {
+ try {
+ TableFactory theTableFactory = (TableFactory)EPackage.Registry.INSTANCE.getEFactory(TablePackage.eNS_URI);
+ if (theTableFactory != null) {
+ return theTableFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new TableFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case TablePackage.TABLE: return createTable();
+ case TablePackage.ROW: return createRow();
+ case TablePackage.CELL: return createCell();
+ case TablePackage.TABLE_HEADER: return createTableHeader();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Table createTable() {
+ TableImpl table = new TableImpl();
+ return table;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Row createRow() {
+ RowImpl row = new RowImpl();
+ return row;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Cell createCell() {
+ CellImpl cell = new CellImpl();
+ return cell;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableHeader createTableHeader() {
+ TableHeaderImpl tableHeader = new TableHeaderImpl();
+ return tableHeader;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TablePackage getTablePackage() {
+ return (TablePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static TablePackage getPackage() {
+ return TablePackage.eINSTANCE;
+ }
+
+} //TableFactoryImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableHeaderImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableHeaderImpl.java
new file mode 100644
index 0000000..8929407
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableHeaderImpl.java
@@ -0,0 +1,37 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.gendoc.table.TableHeader;
+import org.eclipse.gendoc.table.TablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Header</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class TableHeaderImpl extends RowImpl implements TableHeader {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableHeaderImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return TablePackage.Literals.TABLE_HEADER;
+ }
+
+} //TableHeaderImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableImpl.java
new file mode 100644
index 0000000..7bf24dd
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TableImpl.java
@@ -0,0 +1,334 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.Table;
+import org.eclipse.gendoc.table.TableHeader;
+import org.eclipse.gendoc.table.TablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Table</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.gendoc.table.impl.TableImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.impl.TableImpl#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.impl.TableImpl#getRows <em>Rows</em>}</li>
+ * <li>{@link org.eclipse.gendoc.table.impl.TableImpl#getTableheader <em>Tableheader</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class TableImpl extends MinimalEObjectImpl.Container implements Table {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = "";
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = "";
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getRows() <em>Rows</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRows()
+ * @generated
+ * @ordered
+ */
+ protected EList<Row> rows;
+
+ /**
+ * The cached value of the '{@link #getTableheader() <em>Tableheader</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTableheader()
+ * @generated
+ * @ordered
+ */
+ protected TableHeader tableheader;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return TablePackage.Literals.TABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.TABLE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(String newType) {
+ String oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.TABLE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Row> getRows() {
+ if (rows == null) {
+ rows = new EObjectResolvingEList<Row>(Row.class, this, TablePackage.TABLE__ROWS);
+ }
+ return rows;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableHeader getTableheader() {
+ if (tableheader != null && tableheader.eIsProxy()) {
+ InternalEObject oldTableheader = (InternalEObject)tableheader;
+ tableheader = (TableHeader)eResolveProxy(oldTableheader);
+ if (tableheader != oldTableheader) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, TablePackage.TABLE__TABLEHEADER, oldTableheader, tableheader));
+ }
+ }
+ return tableheader;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableHeader basicGetTableheader() {
+ return tableheader;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTableheader(TableHeader newTableheader) {
+ TableHeader oldTableheader = tableheader;
+ tableheader = newTableheader;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TablePackage.TABLE__TABLEHEADER, oldTableheader, tableheader));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case TablePackage.TABLE__NAME:
+ return getName();
+ case TablePackage.TABLE__TYPE:
+ return getType();
+ case TablePackage.TABLE__ROWS:
+ return getRows();
+ case TablePackage.TABLE__TABLEHEADER:
+ if (resolve) return getTableheader();
+ return basicGetTableheader();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case TablePackage.TABLE__NAME:
+ setName((String)newValue);
+ return;
+ case TablePackage.TABLE__TYPE:
+ setType((String)newValue);
+ return;
+ case TablePackage.TABLE__ROWS:
+ getRows().clear();
+ getRows().addAll((Collection<? extends Row>)newValue);
+ return;
+ case TablePackage.TABLE__TABLEHEADER:
+ setTableheader((TableHeader)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case TablePackage.TABLE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case TablePackage.TABLE__TYPE:
+ setType(TYPE_EDEFAULT);
+ return;
+ case TablePackage.TABLE__ROWS:
+ getRows().clear();
+ return;
+ case TablePackage.TABLE__TABLEHEADER:
+ setTableheader((TableHeader)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case TablePackage.TABLE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case TablePackage.TABLE__TYPE:
+ return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
+ case TablePackage.TABLE__ROWS:
+ return rows != null && !rows.isEmpty();
+ case TablePackage.TABLE__TABLEHEADER:
+ return tableheader != null;
+ }
+ 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(" (name: ");
+ result.append(name);
+ result.append(", type: ");
+ result.append(type);
+ result.append(')');
+ return result.toString();
+ }
+
+
+ /**
+ * @generated NOT
+ */
+
+ @Override
+ public int getColCount() {
+ if (this.tableheader!=null){
+ return this.tableheader.getCells().size();
+ }
+ return 0;
+ }
+
+} //TableImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TablePackageImpl.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TablePackageImpl.java
new file mode 100644
index 0000000..61d117a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/impl/TablePackageImpl.java
@@ -0,0 +1,319 @@
+/**
+ */
+package org.eclipse.gendoc.table.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.gendoc.table.Cell;
+import org.eclipse.gendoc.table.Row;
+import org.eclipse.gendoc.table.Table;
+import org.eclipse.gendoc.table.TableFactory;
+import org.eclipse.gendoc.table.TableHeader;
+import org.eclipse.gendoc.table.TablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TablePackageImpl extends EPackageImpl implements TablePackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass tableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass rowEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass cellEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass tableHeaderEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.gendoc.table.TablePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private TablePackageImpl() {
+ super(eNS_URI, TableFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link TablePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static TablePackage init() {
+ if (isInited) return (TablePackage)EPackage.Registry.INSTANCE.getEPackage(TablePackage.eNS_URI);
+
+ // Obtain or create and register package
+ TablePackageImpl theTablePackage = (TablePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TablePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TablePackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theTablePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theTablePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theTablePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(TablePackage.eNS_URI, theTablePackage);
+ return theTablePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getTable() {
+ return tableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getTable_Name() {
+ return (EAttribute)tableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getTable_Type() {
+ return (EAttribute)tableEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getTable_Rows() {
+ return (EReference)tableEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getTable_Tableheader() {
+ return (EReference)tableEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getRow() {
+ return rowEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRow_Object() {
+ return (EAttribute)rowEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getRow_Cells() {
+ return (EReference)rowEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getCell() {
+ return cellEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCell_Object() {
+ return (EAttribute)cellEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCell_Label() {
+ return (EAttribute)cellEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getTableHeader() {
+ return tableHeaderEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableFactory getTableFactory() {
+ return (TableFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ tableEClass = createEClass(TABLE);
+ createEAttribute(tableEClass, TABLE__NAME);
+ createEAttribute(tableEClass, TABLE__TYPE);
+ createEReference(tableEClass, TABLE__ROWS);
+ createEReference(tableEClass, TABLE__TABLEHEADER);
+
+ rowEClass = createEClass(ROW);
+ createEAttribute(rowEClass, ROW__OBJECT);
+ createEReference(rowEClass, ROW__CELLS);
+
+ cellEClass = createEClass(CELL);
+ createEAttribute(cellEClass, CELL__OBJECT);
+ createEAttribute(cellEClass, CELL__LABEL);
+
+ tableHeaderEClass = createEClass(TABLE_HEADER);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ tableHeaderEClass.getESuperTypes().add(this.getRow());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(tableEClass, Table.class, "Table", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getTable_Name(), ecorePackage.getEString(), "name", "", 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getTable_Type(), ecorePackage.getEString(), "type", "", 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getTable_Rows(), this.getRow(), null, "rows", null, 0, -1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getTable_Tableheader(), this.getTableHeader(), null, "tableheader", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(rowEClass, Row.class, "Row", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getRow_Object(), ecorePackage.getEJavaObject(), "object", null, 0, 1, Row.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRow_Cells(), this.getCell(), null, "cells", null, 0, -1, Row.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(cellEClass, Cell.class, "Cell", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getCell_Object(), ecorePackage.getEJavaObject(), "object", null, 0, 1, Cell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCell_Label(), ecorePackage.getEString(), "label", "", 0, 1, Cell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(tableHeaderEClass, TableHeader.class, "TableHeader", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //TablePackageImpl
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableAdapterFactory.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableAdapterFactory.java
new file mode 100644
index 0000000..4a57e2d
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableAdapterFactory.java
@@ -0,0 +1,174 @@
+/**
+ */
+package org.eclipse.gendoc.table.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.gendoc.table.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.TablePackage
+ * @generated
+ */
+public class TableAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static TablePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = TablePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableSwitch<Adapter> modelSwitch =
+ new TableSwitch<Adapter>() {
+ @Override
+ public Adapter caseTable(Table object) {
+ return createTableAdapter();
+ }
+ @Override
+ public Adapter caseRow(Row object) {
+ return createRowAdapter();
+ }
+ @Override
+ public Adapter caseCell(Cell object) {
+ return createCellAdapter();
+ }
+ @Override
+ public Adapter caseTableHeader(TableHeader object) {
+ return createTableHeaderAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gendoc.table.Table <em>Table</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gendoc.table.Table
+ * @generated
+ */
+ public Adapter createTableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gendoc.table.Row <em>Row</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gendoc.table.Row
+ * @generated
+ */
+ public Adapter createRowAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gendoc.table.Cell <em>Cell</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gendoc.table.Cell
+ * @generated
+ */
+ public Adapter createCellAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gendoc.table.TableHeader <em>Header</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gendoc.table.TableHeader
+ * @generated
+ */
+ public Adapter createTableHeaderAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //TableAdapterFactory
diff --git a/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableSwitch.java b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableSwitch.java
new file mode 100644
index 0000000..d4aaee1
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.table/src/org/eclipse/gendoc/table/util/TableSwitch.java
@@ -0,0 +1,174 @@
+/**
+ */
+package org.eclipse.gendoc.table.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.gendoc.table.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gendoc.table.TablePackage
+ * @generated
+ */
+public class TableSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static TablePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableSwitch() {
+ if (modelPackage == null) {
+ modelPackage = TablePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case TablePackage.TABLE: {
+ Table table = (Table)theEObject;
+ T result = caseTable(table);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case TablePackage.ROW: {
+ Row row = (Row)theEObject;
+ T result = caseRow(row);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case TablePackage.CELL: {
+ Cell cell = (Cell)theEObject;
+ T result = caseCell(cell);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case TablePackage.TABLE_HEADER: {
+ TableHeader tableHeader = (TableHeader)theEObject;
+ T result = caseTableHeader(tableHeader);
+ if (result == null) result = caseRow(tableHeader);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Table</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Table</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTable(Table object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Row</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Row</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRow(Row object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Cell</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Cell</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCell(Cell object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Header</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Header</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTableHeader(TableHeader object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //TableSwitch
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.tags.handlers/META-INF/MANIFEST.MF
index 04dc468..f6e2fdf 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.tags.handlers/META-INF/MANIFEST.MF
@@ -14,7 +14,10 @@
org.eclipse.gendoc.tags,
org.eclipse.gendoc.tags.parsers,
org.eclipse.core.resources,
- org.eclipse.ui
+ org.eclipse.ui,
+ org.eclipse.ui.workbench,
+ org.eclipse.emf.ecore,
+ org.eclipse.gendoc.table
Export-Package: org.eclipse.gendoc.tags.handlers,
org.eclipse.gendoc.tags.handlers.impl,
org.eclipse.gendoc.tags.handlers.impl.config,
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/bin/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties b/plugins/org.eclipse.gendoc.tags.handlers/bin/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
index a5e2868..76e4daf 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/bin/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
+++ b/plugins/org.eclipse.gendoc.tags.handlers/bin/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
@@ -37,6 +37,7 @@
LIST=list
TABLE=table
+TABLE_OBJECT=object
DROP=drop
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.java b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.java
index 9c94e44..3086f66 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.java
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.java
@@ -9,7 +9,7 @@
*
* Contributors:
* Kris Robertson (Atos Origin) kris.robertson@atosorigin.com - Initial API and implementation
- *
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - fix bug #515404: create new attribute (object) for table tag
*****************************************************************************/
package org.eclipse.gendoc.tags.handlers.impl;
@@ -88,7 +88,7 @@
// table
public static String TABLE;
-
+ public static String TABLE_OBJECT;
// drop
public static String DROP;
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
index a5e2868..76e4daf 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/RegisteredTags.properties
@@ -37,6 +37,7 @@
LIST=list
TABLE=table
+TABLE_OBJECT=object
DROP=drop
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/ContextService.java b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/ContextService.java
index 31427cf..c6e293f 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/ContextService.java
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/ContextService.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
+ * Antonio Campesino (Ericsson) - Bug 530839.
*
*****************************************************************************/
@@ -124,7 +125,8 @@
*/
public void setModel(String modelPath) throws ModelNotFoundException
{
- try
+ modelPath = normalizePath(modelPath);
+ try
{
try
{
@@ -137,6 +139,7 @@
{
model = URI.createFileURI(modelPath);
}
+
// new model = element must be clean
element = null;
elementPath = ELEMENT_DEFAULT_PATH;
@@ -147,6 +150,12 @@
}
}
+ protected String normalizePath(String path) {
+ path = path.replaceAll("/[^/]+/\\.\\.", "");
+ path = path.replaceAll("/\\./", "");
+ return path;
+ }
+
protected boolean isValid(URI uri) {
if (uri != null) {
if (uri.scheme() == null || "".equals(uri.scheme())) {
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/EMFModelLoaderService.java b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/EMFModelLoaderService.java
index 3a8112d..991aaa0 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/EMFModelLoaderService.java
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/context/EMFModelLoaderService.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
+ * Antonio Campesino Robles (Ericsson) - Bug 531347
*
*****************************************************************************/
package org.eclipse.gendoc.tags.handlers.impl.context;
@@ -108,7 +109,9 @@
switch (resource.getContents().size())
{
case 0:
- throw new ModelNotFoundException("Model can not be loaded from URL: \"" + path.toString() + "\"");
+ if (!resource.isLoaded())
+ throw new ModelNotFoundException("Model can not be loaded from URL: \"" + path.toString() + "\"");
+ break;
case 1:
isRootVirtual = false;
model = resource.getContents().get(0);
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/post/DropTagProcess.java b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/post/DropTagProcess.java
index 29f69a8..518d0aa 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/post/DropTagProcess.java
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/post/DropTagProcess.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Kris Robertson (Atos Origin) kris.robertson@atosorigin.com - Initial API and implementation
+ * Antonio Campesino Robles (Ericsson) - Bug 478883
*
*****************************************************************************/
package org.eclipse.gendoc.tags.handlers.impl.post;
@@ -18,6 +19,7 @@
import org.eclipse.gendoc.document.parser.documents.Document;
import org.eclipse.gendoc.document.parser.documents.Document.PROPERTY;
+import org.eclipse.gendoc.document.parser.documents.helper.XMLHelper;
import org.eclipse.gendoc.documents.IDocumentService;
import org.eclipse.gendoc.process.AbstractStepProcess;
import org.eclipse.gendoc.services.GendocServices;
@@ -54,9 +56,52 @@
if (documentService.isPara(currentNode.getNodeName())) {
String text = (String)document.get(PROPERTY.text);
if (text != null && DROP_TAG_PATTERN.matcher(text).find()) {
+ Node parent = currentNode.getParentNode();
+ if (parent != null && documentService.isCell(parent.getNodeName()) && !hasSiblingParas(currentNode)) {
+ // Avoid remove the only paragraph inside the cell. We just clean it up.
+ cleanTextNodes(document, currentNode);
+ document.getXMLParser().setCurrentNode(currentNode);
+ return;
+ }
nodesToRemove.add(currentNode);
}
}
}
+
+ private boolean hasSiblingParas(Node n) {
+ Node sib = n.getPreviousSibling();
+ while (sib != null) {
+ if (documentService.isPara(sib.getNodeName()))
+ return true;
+ sib = sib.getPreviousSibling();
+ }
+
+ sib = n.getNextSibling();
+ while (sib != null) {
+ if (documentService.isPara(sib.getNodeName()))
+ return true;
+ sib = sib.getNextSibling();
+ }
+ return false;
+ }
+ private void cleanTextNodes(Document doc, Node para) {
+ String text = (String)doc.get(PROPERTY.text);
+ if (!doc.next())
+ return;
+ Node n = doc.getXMLParser().getCurrentNode();
+
+ while (XMLHelper.isAncestor(n, para)) {
+ String value = n.getNodeValue();
+ if (value != null && text.startsWith(value)) {
+ text = text.substring(value.length());
+ n.setNodeValue("");
+ }
+ if (!doc.next())
+ return;
+ n = doc.getXMLParser().getCurrentNode();
+ }
+
+ }
+
}
diff --git a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/scripts/TableTagHandler.java b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/scripts/TableTagHandler.java
index 22a0fb3..fbecbff 100644
--- a/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/scripts/TableTagHandler.java
+++ b/plugins/org.eclipse.gendoc.tags.handlers/src/org/eclipse/gendoc/tags/handlers/impl/scripts/TableTagHandler.java
@@ -9,7 +9,7 @@
*
* Contributors:
* Kris Robertson (Atos Origin) kris.robertson@atosorigin.com - Initial API and implementation
- *
+ * Mohamed Ali Bach Tobji (Atos) mohamed-ali.bachtobji@atos.net - fix bug #515404: generate tables automatically
*****************************************************************************/
package org.eclipse.gendoc.tags.handlers.impl.scripts;
@@ -18,15 +18,19 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.gendoc.documents.IDocumentService;
+import org.eclipse.gendoc.documents.ITableService;
import org.eclipse.gendoc.services.GendocServices;
import org.eclipse.gendoc.services.ILogger;
import org.eclipse.gendoc.services.exception.GenDocException;
import org.eclipse.gendoc.services.exception.InvalidContentException;
import org.eclipse.gendoc.tags.ITag;
import org.eclipse.gendoc.tags.handlers.AbstractPrePostTagHandler;
+import org.eclipse.gendoc.tags.handlers.impl.RegisteredTags;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.eclipse.gendoc.table.Table;
+
/**
* Handler for <table> tags.
*
@@ -62,6 +66,25 @@
}
else
{
+ if (tag.getAttributes().containsKey("object")) {
+
+ Object tableModel = getTableModel(tag, documentService);
+ int indexStart = m.start();
+ int indexEnd = returnValue.lastIndexOf("</" + tableLabel + ">");
+ // Add the length of the tag label </TAG_LABEL> (3 => '<' + '/'
+ // + '>')
+ indexEnd += tableLabel.length() + 3;
+ // Extract the string that contains only the table nodes
+ String tableText = returnValue.substring(indexStart, indexEnd);
+ // Transform the text as XML nodes
+ String nodes = "<document>" + tableText + "</document>";
+ nodes = documentService.addNamingSpaces(nodes, "document");
+ Node tableNode = documentService.asNode(nodes).getFirstChild();
+ ITableService tableService = documentService.getTableService();
+ return tableService.manageTable(tag, documentService, returnValue, tableModel, tableNode);
+
+
+ } else {
int indexStart = m.start();
int indexEnd = returnValue.lastIndexOf("</" + tableLabel + ">");
// Add the length of the tag label </TAG_LABEL> (3 => '<' + '/' + '>')
@@ -72,9 +95,31 @@
String singleTable = this.concatTables(documentService, tableText);
// Replace the tables by the created table
returnValue.replace(indexStart, indexEnd, singleTable);
+ }
}
return returnValue.toString();
}
+
+
+ /**
+ * Get table model
+ * @param tag
+ * @param documentService
+ * @return
+ */
+ private Object getTableModel(ITag tag, IDocumentService documentService) {
+
+ Table tableModel = null;
+ if (tag != null && tag.getAttributes() != null) {
+ String tableId = tag.getAttributes().get(RegisteredTags.TABLE_OBJECT);
+ ITableService tableService = documentService.getTableService();
+ if (tableService != null) {
+ tableModel = tableService.getTable(tableId);
+ }
+ }
+ return tableModel;
+ }
+
/**
* Create a single table from all the tables in the given string => Find the first table and then insert all the row
@@ -127,5 +172,7 @@
}
return documentService.asText(mainTable);
}
+
+
}
diff --git a/plugins/org.eclipse.gendoc.tags.html/src/org/eclipse/gendoc/tags/html/impl/DOCXHtmlService.java b/plugins/org.eclipse.gendoc.tags.html/src/org/eclipse/gendoc/tags/html/impl/DOCXHtmlService.java
index 1be0657..aae67fc 100644
--- a/plugins/org.eclipse.gendoc.tags.html/src/org/eclipse/gendoc/tags/html/impl/DOCXHtmlService.java
+++ b/plugins/org.eclipse.gendoc.tags.html/src/org/eclipse/gendoc/tags/html/impl/DOCXHtmlService.java
@@ -117,14 +117,10 @@
if (filePath != null) {
String id = additonalResourceService.includeFile(filePath);
output += "<drop/>";
- if (isInTable) {
- output += "</w:t></w:r>";
- }
+ output += "</w:t></w:r>";
output += "</w:p><w:altChunk xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\""
- + id + "\" />";
- if (isInTable) {
- output += "<w:p><w:r><w:t>";
- }
+ + id + "\" /><w:p>";
+ output += "<w:r><w:t>";
return output;
}
}
diff --git a/plugins/org.eclipse.gendoc.tags.parsers/src/org/eclipse/gendoc/tags/parsers/TagParser.java b/plugins/org.eclipse.gendoc.tags.parsers/src/org/eclipse/gendoc/tags/parsers/TagParser.java
new file mode 100644
index 0000000..bf49090
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.tags.parsers/src/org/eclipse/gendoc/tags/parsers/TagParser.java
@@ -0,0 +1,252 @@
+/*****************************************************************************
+ * (c) Copyright 2016 Telefonaktiebolaget LM Ericsson
+ *
+ *
+ * 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:
+ * Antonio Campesino (Ericsson) antonio.campesino.robles@ericsson.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.gendoc.tags.parsers;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+public class TagParser {
+ public enum TagKind {
+ OpenTag,
+ CloseTag,
+ SimpleTag,
+ Incomplete
+ };
+
+ public TagParser(String text, List<String> tags) {
+ this.text = text;
+ this.tags = tags.toArray(new String[tags.size()]);
+ Arrays.sort(this.tags, new Comparator<String>() {
+ @Override
+ public int compare(String o1, String o2) {
+ return o2.length() - o1.length();
+ }
+ });
+ this.pos = 0;
+ this.kind = TagKind.OpenTag;
+ this.groups = new ArrayList<Integer>();
+ this.groupKinds = new ArrayList<TagKind>();
+ }
+
+ public boolean parse() {
+ while(true) {
+ pos = peek("<");
+ if (pos == -1)
+ return groups.size() > 0 ? true : false;
+ groups.add(pos);
+ if (match()) {
+ groupKinds.add(kind);
+ } else {
+ groupKinds.add(TagKind.Incomplete);
+ }
+ groups.add(pos);
+ }
+ }
+
+ private boolean match() {
+
+ lt();
+ if (slash()) {
+ kind = TagKind.CloseTag;
+ }
+
+ if (!tagName())
+ return false;
+
+ if (kind == TagKind.CloseTag) {
+ return gt();
+ }
+
+ if (slash_gt()) {
+ kind = TagKind.SimpleTag;
+ return true;
+ }
+
+ if (gt()) {
+ return true;
+ }
+
+ while (true) {
+ // attributes...
+ if (!whites())
+ return false;
+
+ if (!id())
+ return false;
+ whites();
+ if (!eq())
+ return false;
+ whites();
+ if (!quote())
+ return false;
+
+ while(!quote() && !eof())
+ pos++;
+
+ if (slash_gt()) {
+ kind = TagKind.SimpleTag;
+ return true;
+ }
+
+ if (gt()) {
+ return true;
+ }
+
+ if (eof())
+ return false;
+ }
+
+ }
+
+ private boolean lt() {
+ return consume(TagParserConfig.INF);
+ }
+
+ private boolean gt() {
+ return consume(TagParserConfig.SUP);
+ }
+
+ private boolean eq() {
+ return consume(TagParserConfig.EQUAL);
+ }
+
+ private boolean slash() {
+ return consume(TagParserConfig.SLASH_CHAR);
+ }
+
+ private boolean quote() {
+ boolean res = consume("'");
+ if (res)
+ return true;
+
+ if (eof())
+ return false;
+ char current = text.charAt(pos);
+ if (TagParserConfig.INVALID_QUOTES.contains(current) || TagParserConfig.VALID_QUOTE == current) {
+ pos++;
+ return true;
+ }
+ return false;
+ }
+
+ private boolean id() {
+ int prev = pos;
+ while (!eof()) {
+ char ch = text.charAt(pos);
+ if (Character.isWhitespace(ch) || ch=='=')
+ break;
+ pos++;
+ } ;
+
+ if (pos == prev)
+ return false;
+ return true;
+ }
+
+ private boolean slash_gt() {
+ int p = pos;
+ if (!slash() || !gt()) {
+ pos = p;
+ return false;
+ }
+
+ return true;
+ }
+
+ private boolean whites() {
+ boolean found = white();
+ while (white());
+ return found;
+ }
+
+ private boolean white() {
+ if (consume(' ', '\t', '\n', 'r'))
+ return true;
+
+ if (eof())
+ return false;
+
+ char ch = text.charAt(pos);
+ if (TagParserConfig.INVALID_SPACES.contains(ch)) {
+ pos++;
+ return true;
+ }
+ return false;
+ }
+
+ private boolean tagName() {
+ return consume(tags);
+ }
+
+ private int peek(char ch) {
+ if (eof())
+ return -1;
+
+ int p = text.indexOf(ch,pos);
+ if (p == -1)
+ return -1;
+ return p;
+ }
+
+ private int peek(String token) {
+ if (eof())
+ return -1;
+
+ int p = text.indexOf(token,pos);
+ if (p == -1)
+ return -1;
+ return p;
+ }
+
+ private boolean consume(char... chars) {
+ if (eof())
+ return false;
+
+ char current = text.charAt(pos);
+ for (char c : chars) {
+ if (c == current) {
+ pos++;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean consume(String... tokens) {
+ if (eof())
+ return false;
+
+ for (String token : tokens) {
+ if (text.startsWith(token, pos)) {
+ pos += token.length();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean eof() {
+ return pos >= text.length();
+ }
+
+ private String text;
+ private String[] tags;
+ private int pos;
+ private TagKind kind;
+
+ private List<Integer> groups;
+ private List<TagKind> groupKinds;
+}
diff --git a/plugins/org.eclipse.gendoc.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.gendoc.ui/META-INF/MANIFEST.MF
index 212a52d..28f0751 100644
--- a/plugins/org.eclipse.gendoc.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gendoc.ui/META-INF/MANIFEST.MF
@@ -8,6 +8,11 @@
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.gendoc,
- org.eclipse.gendoc.services
+ org.eclipse.core.expressions,
+ org.eclipse.core.variables,
+ org.eclipse.gendoc.tags.handlers
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.gendoc.ui,
+ org.eclipse.gendoc.ui.actions,
+ org.eclipse.gendoc.ui.run
diff --git a/plugins/org.eclipse.gendoc.ui/plugin.xml b/plugins/org.eclipse.gendoc.ui/plugin.xml
index 454fef5..29fc860 100644
--- a/plugins/org.eclipse.gendoc.ui/plugin.xml
+++ b/plugins/org.eclipse.gendoc.ui/plugin.xml
@@ -2,33 +2,42 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- adaptable="false"
+ point="org.eclipse.ui.commands">
+ <category
+ description="Gendoc"
+ id="org.eclipse.gendoc.category"
+ name="Gendoc">
+ </category>
+ <command
+ categoryId="org.eclipse.gendoc.category"
+ description="Generate documentation using Gendoc"
id="org.eclipse.gendoc.script"
- nameFilter="*.docx"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
- enablesFor="1"
+ name="Generate documentation using Gendoc">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <command
+ commandId="org.eclipse.gendoc.script"
icon="icons/gendoc16.ico"
- id="org.eclipse.gendoc.script.action2"
- label="Generate documentation using Gendoc">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="false"
- id="org.eclipse.gendoc.script"
- nameFilter="*.odt"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- class="org.eclipse.gendoc.ui.actions.GenerateDocumentation"
- enablesFor="1"
- icon="icons/gendoc16.ico"
- id="org.eclipse.gendoc.script.action2"
- label="Generate documentation using Gendoc">
- </action>
- </objectContribution>
+ label="Generate documentation using Gendoc"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <or>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.ui.navigator.ProjectExplorer">
+ </equals>
+ </with>
+ </or>
+ </visibleWhen>
+ </command>
+ </menuContribution>
</extension>
diff --git a/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/actions/GenerateDocumentation.java b/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/actions/GenerateDocumentation.java
index ae241f6..b4a46fe 100644
--- a/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/actions/GenerateDocumentation.java
+++ b/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/actions/GenerateDocumentation.java
@@ -11,27 +11,27 @@
* Contributors:
* Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
* Pierre Gaufillet (Airbus) pierre.gaufillet@airbus.com - remove modal box after successful generations
+ * Antonio Campesino Robles (Ericsson) - Bug 501157
*
*****************************************************************************/
package org.eclipse.gendoc.ui.actions;
import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.gendoc.ui.Activator;
import org.eclipse.gendoc.ui.run.GenDocRunnable;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.handlers.HandlerUtil;
/**
* Our sample action implements workbench action delegate. The action proxy will be created by the workbench and shown
@@ -40,27 +40,26 @@
*
* @see IWorkbenchWindowActionDelegate
*/
-public class GenerateDocumentation implements IObjectActionDelegate
+public class GenerateDocumentation extends AbstractHandler
{
- private IStructuredSelection selection;
- private IStatusLineManager statusLineManager;
-
- /**
- * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench
- * UI.
- *
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action)
- {
- if (selection.getFirstElement() instanceof IFile)
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection s = HandlerUtil.getActiveWorkbenchWindow(event)
+ .getActivePage().getSelection();
+ IStructuredSelection selection = null;
+ if (s instanceof IStructuredSelection) {
+ selection = (IStructuredSelection)s;
+ }
+
+ if (selection != null && selection.getFirstElement() instanceof IFile)
{
final IFile currentFile = (IFile) selection.getFirstElement();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(Display.getDefault().getActiveShell());
+ GenDocRunnable gendocRunnable = new GenDocRunnable(currentFile, null);
try
{
- dialog.run(false, true, new GenDocRunnable(currentFile, statusLineManager));
+ dialog.run(false, true, gendocRunnable);
}
catch (InvocationTargetException e)
{
@@ -70,30 +69,8 @@
{
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
}
- }
- }
-
- /**
- * Selection in the workbench has been changed. We can change the state of the 'real' action here if we want, but
- * this can only happen after the delegate has been created.
- *
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection newSelection)
- {
- this.selection = (IStructuredSelection) newSelection;
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- if (targetPart instanceof IViewPart)
- {
- IViewPart view = (IViewPart) targetPart;
- statusLineManager = view.getViewSite().getActionBars().getStatusLineManager();
- }
- else
- {
- statusLineManager = null;
- }
- }
+
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/run/GenDocRunnable.java b/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/run/GenDocRunnable.java
index 60ce9b8..72a778a 100644
--- a/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/run/GenDocRunnable.java
+++ b/plugins/org.eclipse.gendoc.ui/src/org/eclipse/gendoc/ui/run/GenDocRunnable.java
@@ -11,15 +11,21 @@
* Contributors:
* Maxime Leray (Atos Origin) maxime.leray@atosorigin.com - Initial API and implementation
* Pierre Gaufillet (Airbus) pierre.gaufillet@airbus.com - remove modal box after successful generations
+ * Antonio Campesino Robles (Ericsson) - Bug 530842
*
*****************************************************************************/
package org.eclipse.gendoc.ui.run;
+import java.io.File;
import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
@@ -28,6 +34,7 @@
import org.eclipse.gendoc.services.IGendocDiagnostician;
import org.eclipse.gendoc.services.IProgressMonitorService;
import org.eclipse.gendoc.services.exception.GenDocException;
+import org.eclipse.gendoc.tags.handlers.IConfigurationService;
import org.eclipse.gendoc.ui.Activator;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -64,6 +71,7 @@
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
{
// Init
+ IConfigurationService confService = GendocServices.getDefault().getService(IConfigurationService.class);
IGendocDiagnostician diagnostician = GendocServices.getDefault().getService(IGendocDiagnostician.class);
diagnostician.init();
IProgressMonitorService monitorService = (IProgressMonitorService) GendocServices.getDefault().getService(IProgressMonitorService.class);
@@ -90,7 +98,28 @@
}
finally
{
- GendocServices.getDefault().clear();
+ try {
+ URI uri = URI.create(confService.getOutput().replace(File.separatorChar, '/'));
+ if (uri.getScheme() == null) {
+ String path = confService.getOutput().replace(File.separatorChar, '/');
+ if (path.startsWith("/"))
+ path = path.substring(1);
+ uri = URI.create("file:/"+path);
+ }
+
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri);
+ for (IFile f : files) {
+ try {
+ f.getParent().refreshLocal(1, new NullProgressMonitor());
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
+ }
+ }
+ } catch (Exception e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
+ }
+
+ GendocServices.getDefault().clear();
}
}
diff --git a/plugins/org.eclipse.gendoc.wizard/plugin.xml b/plugins/org.eclipse.gendoc.wizard/plugin.xml
index 38d2a83..fbf9239 100644
--- a/plugins/org.eclipse.gendoc.wizard/plugin.xml
+++ b/plugins/org.eclipse.gendoc.wizard/plugin.xml
@@ -3,56 +3,47 @@
<plugin>
<extension-point id="org.eclipse.gendoc.wizard.runner" name="GendocPoint" schema="schema/org.eclipse.gendoc.wizard.runner.exsd"/>
<extension
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="org.eclipse.gendoc.wizard.popup.actions.GenerateDocumentationHandler"
- description="generate the documentation"
- id="org.eclipse.gendoc.wizard.GenerateDoc"
- name="Generate documentation with Gendoc">
- </command>
- </extension>
- <extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.popup.any">
<command
- commandId="org.eclipse.gendoc.wizard.GenerateDoc"
+ commandId="org.eclipse.gendoc.script"
icon="icons/gendoc16.ico"
- label="Generate Documentation with Gendoc"
+ label="Generate Documentation using Gendoc"
style="push"
tooltip="Use Gendoc to generate documentation from model">
<visibleWhen
checkEnabled="false">
<iterate
ifEmpty="false">
+ <and>
<or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.gendoc.wizard.isEnabled">
- </test>
- <adapt
- type="org.eclipse.core.resources.IFile">
- <test
- forcePluginActivation="true"
- property="org.eclipse.gendoc.wizard.isEnabled">
- </test>
- </adapt>
- <adapt
- type="java.util.Collection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.gendoc.wizard.isCollectionEnabled">
- </test>
- </adapt>
- <adapt
- type="org.eclipse.emf.ecore.EObject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.gendoc.wizard.isEnabled">
- </test>
- </adapt>
- </or>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
+ <adapt
+ type="java.util.Collection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isCollectionEnabled">
+ </test>
+ </adapt>
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
+ </adapt>
+ </or>
+ <not>
+ <adapt
+ type="org.eclipse.core.resources.IFile">
+ </adapt>
+ </not>
+ </and>
</iterate>
</visibleWhen>
</command>
@@ -80,4 +71,43 @@
</run>
</application>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.gendoc.wizard.popup.actions.GenerateDocumentationHandler"
+ commandId="org.eclipse.gendoc.script">
+ <enabledWhen>
+ <iterate
+ ifEmpty="false">
+ <or>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
+ <adapt
+ type="org.eclipse.core.resources.IFile">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
+ </adapt>
+ <adapt
+ type="java.util.Collection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isCollectionEnabled">
+ </test>
+ </adapt>
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
+ </adapt>
+ </or>
+ </iterate>
+ </enabledWhen>
+ </handler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizard.java b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizard.java
index f01c426..f945982 100644
--- a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizard.java
+++ b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizard.java
@@ -9,21 +9,26 @@
*
* Contributors:
* Anne Haugommard (Atos Origin) anne.haugommard@atosorigin.com - Initial API and implementation
+ * Antonio Campesino Robles (Ericsson) - Bug 530842
*
*****************************************************************************/
package org.eclipse.gendoc.wizard;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.emf.common.util.BasicDiagnostic;
@@ -130,13 +135,15 @@
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
{
IGendocDiagnostician diagnostician = GendocServices.getDefault().getService(IGendocDiagnostician.class);
+ IConfigurationService parameter = GendocServices.getDefault().getService(IConfigurationService.class);
+
diagnostician.init();
IProgressMonitorService monitorService = (IProgressMonitorService) GendocServices.getDefault().getService(IProgressMonitorService.class);
monitorService.setMonitor(monitor);
+ String outputDirectory = page.getOutputPath();
try
{
- IConfigurationService parameter = GendocServices.getDefault().getService(IConfigurationService.class);
parameter.addParameter(replacePercentBySpace(page.getSelected().getOutputKey(), 3), replacePercentBySpace(page.getFullOutputPath(), 3));
parameter.addParameter(replacePercentBySpace(page.getSelected().getModelKey(), 3), page.getModel());
for(AdditionnalParameterItem item : page.getAdditionnalParameters()) {
@@ -162,6 +169,27 @@
}
finally
{
+ try {
+ URI uri = URI.create(parameter.getOutput().replace(File.separatorChar, '/'));
+ if (uri.getScheme() == null) {
+ String path = parameter.getOutput().replace(File.separatorChar, '/');
+ if (path.startsWith("/"))
+ path = path.substring(1);
+ uri = URI.create("file:/"+path);
+ }
+
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri);
+ for (IFile f : files) {
+ try {
+ f.getParent().refreshLocal(1, new NullProgressMonitor());
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
+ }
+ }
+ } catch (Exception e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
+ }
+
GendocServices.getDefault().clear();
}
}
diff --git a/pom.xml b/pom.xml
index d5e643e..7c6e29c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
<module>plugins/org.eclipse.gendoc.services.odt</module>
<module>plugins/org.eclipse.gendoc.services.pptx</module>
<module>plugins/org.eclipse.gendoc.services.xlsx</module>
+ <module>plugins/org.eclipse.gendoc.table</module>
<module>plugins/org.eclipse.gendoc.tags</module>
<module>plugins/org.eclipse.gendoc.tags.handlers</module>
<module>plugins/org.eclipse.gendoc.tags.html</module>
diff --git a/tests/org.eclipse.gendoc.services.openoffice.test/src/org/eclipse/gendoc/services/openoffice/test/OpenOfficeVerifyHelper.java b/tests/org.eclipse.gendoc.services.openoffice.test/src/org/eclipse/gendoc/services/openoffice/test/OpenOfficeVerifyHelper.java
index 69c9dba..f0c40dc 100644
--- a/tests/org.eclipse.gendoc.services.openoffice.test/src/org/eclipse/gendoc/services/openoffice/test/OpenOfficeVerifyHelper.java
+++ b/tests/org.eclipse.gendoc.services.openoffice.test/src/org/eclipse/gendoc/services/openoffice/test/OpenOfficeVerifyHelper.java
@@ -224,7 +224,7 @@
Assert.assertEquals(message,expected,value);
break;
case 1:
- Assert.assertNotEquals(message,expected,value);
+ Assert.assertNotSame(message,expected,value);
break;
case 2:
Assert.assertNull(message,value);