Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer')
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/META-INF/MANIFEST.MF5
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/command/CreateDocumentModelCommand.java165
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java22
-rw-r--r--plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java20
4 files changed, 148 insertions, 64 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/META-INF/MANIFEST.MF
index e3822fd03af..3281630ad70 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/META-INF/MANIFEST.MF
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/META-INF/MANIFEST.MF
@@ -15,7 +15,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0",
org.eclipse.core.resources,
org.eclipse.papyrus.infra.hyperlink;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0"
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0",
+ org.eclipse.emf.ecore.edit;bundle-version="2.9.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.1.0",
+ com.google.guava;bundle-version="11.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.1.0.qualifier
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/command/CreateDocumentModelCommand.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/command/CreateDocumentModelCommand.java
index 6afb56c7ae6..d495076033d 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/command/CreateDocumentModelCommand.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/command/CreateDocumentModelCommand.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 468079
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.command;
@@ -21,8 +22,12 @@ import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.provider.EModelElementItemProvider;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
@@ -30,6 +35,7 @@ import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
import org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFFunctions;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkHelper;
import org.eclipse.papyrus.infra.hyperlink.helper.HyperLinkHelperFactory;
@@ -37,6 +43,7 @@ import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkDocument;
import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject;
import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkException;
import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkHelpersRegistrationUtil;
+import org.eclipse.papyrus.infra.tools.util.TypeUtils;
import org.eclipse.papyrus.uml.developper.mde.I_DeveloperIDMStereotype;
import org.eclipse.papyrus.uml.developper.mde.I_DocumentStereotype;
import org.eclipse.papyrus.uml.developper.mde.handler.IDMAbstractHandler;
@@ -44,11 +51,14 @@ import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
import org.eclipse.uml2.uml.Actor;
import org.eclipse.uml2.uml.Association;
import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.BehavioredClassifier;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.DataType;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interface;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Package;
@@ -56,8 +66,12 @@ import org.eclipse.uml2.uml.PackageImport;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.UseCase;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+
/**
* this command transform a model to document model
*
@@ -78,6 +92,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
protected int nbUnverifiedRequirement = 0;
protected int nbRequirement = 0;
+ private AdapterFactory adapterFactory;
/**
*
@@ -97,6 +112,8 @@ public class CreateDocumentModelCommand extends RecordingCommand {
hyperLinkHelpers.addAll(HyperLinkHelpersRegistrationUtil.INSTANCE.getAllRegisteredHyperLinkHelper());
hyperlinkHelperFactory = new HyperLinkHelperFactory(hyperLinkHelpers);
+
+ adapterFactory = ((AdapterFactoryEditingDomain) domain).getAdapterFactory();
}
@Override
@@ -151,7 +168,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
// Get the requirements model package from the model
Model requirementsModel = getStereotypedPackage(I_DeveloperIDMStereotype.REQUIREMENTS_STEREOTYPE);
- // For each requirements, creates a line in the table
+ // For each requirements, creates a line in the table
if (requirementsModel != null) {
Package requirementsCoverageOUT = createSection(documentModel, "Requirements Coverage");
generateTableCoverage(requirementsModel, requirementsCoverageOUT);
@@ -177,7 +194,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
Package toc = (Package) documentModel.getPackagedElement("Table of Contents");
Stereotype tableOfContentStereotype = toc.getAppliedStereotype(I_DocumentStereotype.TABLEOFCONTENT_STEREOTYPE);
if (!(section.isStereotypeApplied(tableOfContentStereotype))) {
- Package chapter = createSection(toc, ((Package)section).getName());
+ Package chapter = createSection(toc, ((Package) section).getName());
IDMAbstractHandler.Toc2DocElt.put(chapter, (Package) section);
setTableOfContents(section, chapter);
}
@@ -200,10 +217,10 @@ public class CreateDocumentModelCommand extends RecordingCommand {
Element cddElement = elements.next();
Stereotype sectionStereotype = cddElement.getAppliedStereotype(I_DocumentStereotype.SECTION_STEREOTYPE);
if (sectionStereotype != null) {
- Package chapter = createSection(chapterPackage, ((Package)cddElement).getName());
+ Package chapter = createSection(chapterPackage, ((Package) cddElement).getName());
IDMAbstractHandler.Toc2DocElt.put(chapter, (Package) cddElement);
setTableOfContents(cddElement, chapter);
- }
+ }
}
}
}
@@ -213,14 +230,14 @@ public class CreateDocumentModelCommand extends RecordingCommand {
for (Iterator<EObject> itereq = requirementsIn.eAllContents(); itereq.hasNext();) {
EObject packageableElement = itereq.next();
if (packageableElement instanceof PackageImport) {
- PackageImport importedPackage = (PackageImport)packageableElement;
+ PackageImport importedPackage = (PackageImport) packageableElement;
if (importedPackage.getAppliedStereotype(I_DeveloperIDMStereotype.REQUIREMENTS_STEREOTYPE) != null) {
Model importedRequirementPackageIn = (Model) importedPackage.getImportedPackage();
generateRequirements(importedRequirementPackageIn, requirementsOUT);
}
- } else if (packageableElement instanceof Element){
+ } else if (packageableElement instanceof Element) {
Element currentReq = (Element) packageableElement;
- Stereotype reqStereotype = currentReq.getApplicableStereotype(SYS_ML_REQUIREMENTS_REQUIREMENT);
+ Stereotype reqStereotype = currentReq.getAppliedStereotype(SYS_ML_REQUIREMENTS_REQUIREMENT);
if (reqStereotype != null) {
String out = "- " + ((org.eclipse.uml2.uml.Class) currentReq).getName() + " (id=" + currentReq.getValue(reqStereotype, "id") + "): "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
out = out + "\n " + currentReq.getValue(reqStereotype, "text"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -248,7 +265,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
}
for (PackageableElement packageableElement : useCaseIN.getPackagedElements()) {
- if( (packageableElement instanceof Classifier) &&(!(packageableElement instanceof Actor)) &&(!(packageableElement instanceof Association) )){
+ if ((packageableElement instanceof Classifier) && (!(packageableElement instanceof Actor)) && (!(packageableElement instanceof Association))) {
Classifier subjectIn = (Classifier) packageableElement;
Package subSectionOUT = createSection(useCaseModelOUT, subjectIn.getName());
generateUseCaseFromSubject(copyImageUtil, subjectIn, subSectionOUT);
@@ -258,7 +275,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
}
- protected void generateUseCaseFromSubject(CopyToImageUtil copyImageUtil, Classifier subjectIN, Package useCaseModelOUT){
+ protected void generateUseCaseFromSubject(CopyToImageUtil copyImageUtil, Classifier subjectIN, Package useCaseModelOUT) {
// createRef diagram
if (containedDiagrams(subjectIN).size() > 0) {
Diagram currentDiagram = containedDiagrams(subjectIN).get(0);
@@ -280,7 +297,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
transformToContentWithUser(copyImageUtil, useCaseSectionOUT, currentComment);
}
} else if (packageableElement instanceof PackageImport) {
- PackageImport importedPackage = (PackageImport)packageableElement;
+ PackageImport importedPackage = (PackageImport) packageableElement;
if (importedPackage.getAppliedStereotype(I_DeveloperIDMStereotype.USECASES_STEREOTYPE) != null) {
Model importedUseCasesPackageIn = (Model) importedPackage.getImportedPackage();
generateUseCases(copyImageUtil, importedUseCasesPackageIn, useCaseModelOUT);
@@ -299,8 +316,7 @@ public class CreateDocumentModelCommand extends RecordingCommand {
}
transformToContentComment(HowToSection, currentComment);
createImageFromHyperLink(copyImageUtil, HowToSection, currentComment);
- }
- else {
+ } else {
transformToContentComment(useCaseSectionOUT, currentComment);
createImageFromHyperLink(copyImageUtil, useCaseSectionOUT, currentComment);
}
@@ -308,12 +324,12 @@ public class CreateDocumentModelCommand extends RecordingCommand {
protected void generateDesign(CopyToImageUtil copyImageUtil, Package designPackageIn, Package designPackageOUT) {
- if(designPackageIn.getPackageImports().size()>0){
+ if (designPackageIn.getPackageImports().size() > 0) {
for (PackageImport packageImport : designPackageIn.getPackageImports()) {
if (packageImport.getAppliedStereotype(I_DeveloperIDMStereotype.DESIGN_STEREOTYPE) != null) {
- Package importedDesignPackageIn = (Package) packageImport.getImportedPackage();
+ Package importedDesignPackageIn = packageImport.getImportedPackage();
Package subSectionOUT = createSection(designPackageOUT, importedDesignPackageIn.getName());
- IDMAbstractHandler.elt2DocElt.put((Element) importedDesignPackageIn, subSectionOUT);
+ IDMAbstractHandler.elt2DocElt.put(importedDesignPackageIn, subSectionOUT);
generateDesign(copyImageUtil, importedDesignPackageIn, subSectionOUT);
}
}
@@ -332,27 +348,72 @@ public class CreateDocumentModelCommand extends RecordingCommand {
for (Iterator<PackageableElement> iterator = designPackageIn.getPackagedElements().iterator(); iterator.hasNext();) {
EObject packageableElement = iterator.next();
- if (packageableElement instanceof Class) {
- Package designSectionOUT = createSection(designPackageOUT, ((Class)packageableElement).getName());
+ if ((packageableElement instanceof Class) || (packageableElement instanceof Interface) || (packageableElement instanceof DataType)) {
+ Package designSectionOUT = createSection(designPackageOUT, title((Classifier) packageableElement));
IDMAbstractHandler.elt2DocElt.put((Element) packageableElement, designSectionOUT);
- for (Iterator<Comment> iteComment = ((Class) packageableElement).getOwnedComments().iterator(); iteComment.hasNext();) {
+ generateTaxonomy(designSectionOUT, (Classifier) packageableElement);
+ for (Iterator<Comment> iteComment = ((Classifier) packageableElement).getOwnedComments().iterator(); iteComment.hasNext();) {
Comment currentComment = iteComment.next();
transformToContentWithUser(copyImageUtil, designSectionOUT, currentComment);
}
}
if (packageableElement instanceof Package) {
- Package designSectionOUT = createSection(designPackageOUT, ((Package)packageableElement).getName());
+ Package designSectionOUT = createSection(designPackageOUT, title((Package) packageableElement));
IDMAbstractHandler.elt2DocElt.put((Element) packageableElement, designSectionOUT);
- generateDesign(copyImageUtil, (Package)packageableElement, designSectionOUT);
+ generateDesign(copyImageUtil, (Package) packageableElement, designSectionOUT);
}
}
}
+ protected String title(NamedElement element) {
+ return String.format("%s %s", getMetaclassLabel(element), element.getLabel());
+ }
+
+ protected String getMetaclassLabel(Element element) {
+ String result;
+
+ EModelElementItemProvider itemProvider = TypeUtils.as(adapterFactory.adapt(element, IItemLabelProvider.class), EModelElementItemProvider.class);
+ if (itemProvider == null) {
+ result = element.eClass().getName();
+ } else {
+ result = itemProvider.getResourceLocator().getString(String.format("_UI_%s_type", element.eClass().getName())); //$NON-NLS-1$
+ }
+
+ return result;
+ }
+
+ protected void generateTaxonomy(Package designSection, Classifier classifier) {
+ String taxonomy = ""; //$NON-NLS-1$
+
+ if (!classifier.getGenerals().isEmpty()) {
+ taxonomy = taxonomy + " - specializes " + Joiner.on(", ").join(
+ Iterables.transform(classifier.getGenerals(), EMFFunctions.getFeature(UMLPackage.Literals.NAMED_ELEMENT__NAME, String.class)));
+ }
+
+ if (classifier instanceof BehavioredClassifier) {
+ BehavioredClassifier behaviored = (BehavioredClassifier) classifier;
+ if (!behaviored.getImplementedInterfaces().isEmpty()) {
+ if (!taxonomy.isEmpty()) {
+ taxonomy = taxonomy + "\n\n"; //$NON-NLS-1$
+ }
+
+ taxonomy = taxonomy + " - realizes " + Joiner.on(", ").join(
+ Iterables.transform(behaviored.getImplementedInterfaces(), EMFFunctions.getFeature(UMLPackage.Literals.NAMED_ELEMENT__NAME, String.class)));
+ }
+ }
+
+ if (!taxonomy.isEmpty()) {
+ Comment comment = designSection.createOwnedComment();
+ Stereotype contentStereotype = comment.getApplicableStereotype(I_DocumentStereotype.CONTENT_STEREOTYPE);
+ comment.applyStereotype(contentStereotype);
+ comment.setBody(taxonomy);
+ }
+ }
protected void generateTests(CopyToImageUtil copyImageUtil, Package testIN, Package testModelOUT) {
- if(testIN.getPackageImports().size()>0){
+ if (testIN.getPackageImports().size() > 0) {
for (PackageImport packageImport : testIN.getPackageImports()) {
if (packageImport.getAppliedStereotype(I_DeveloperIDMStereotype.EXECUTABLETEST_STEREOTYPE) != null
|| packageImport.getAppliedStereotype(SYS_ML_REQUIREMENTS_TESTCASE) != null
@@ -380,14 +441,13 @@ public class CreateDocumentModelCommand extends RecordingCommand {
if (packageableElement instanceof Package) {
Package testCaseSectionOUT = createSection(testModelOUT, ((Package) packageableElement).getName());
IDMAbstractHandler.elt2DocElt.put((Element) packageableElement, testCaseSectionOUT);
- generateTests(copyImageUtil, (Package)packageableElement, testCaseSectionOUT);
+ generateTests(copyImageUtil, (Package) packageableElement, testCaseSectionOUT);
for (Iterator<Comment> iteComment = ((Package) packageableElement).getOwnedComments().iterator(); iteComment.hasNext();) {
Comment currentComment = iteComment.next();
createImageFromHyperLink(copyImageUtil, testCaseSectionOUT, currentComment);
transformToContentComment(testCaseSectionOUT, currentComment);
}
- }
- else if (packageableElement instanceof Behavior ||packageableElement instanceof Classifier) {
+ } else if (packageableElement instanceof Behavior || packageableElement instanceof Classifier) {
Package testCaseSectionOUT = createSection(testModelOUT, ((NamedElement) packageableElement).getName());
IDMAbstractHandler.elt2DocElt.put((Element) packageableElement, testCaseSectionOUT);
@@ -404,14 +464,14 @@ public class CreateDocumentModelCommand extends RecordingCommand {
/**
*
* Generate the Requirements Coverage "Section" Package in the document model.
- * First, retrieves the requirements package in the model.
+ * First, retrieves the requirements package in the model.
* Then, for each requirement, create a comment with "Line" stereotype.
* A line has cells, and those cells are represented by a comment with the "Cell" stereotype.
* And a cell has contents, those contents are represented by a comment with the "CellContent" stereotype
*
* @param documentModel
*/
- protected void generateTableCoverage(Model requirementsModel, Package requirementsCoverageOUT) {
+ protected void generateTableCoverage(Model requirementsModel, Package requirementsCoverageOUT) {
// Create the comment with the table stereotype
Comment table = requirementsCoverageOUT.createOwnedComment();
@@ -443,11 +503,11 @@ public class CreateDocumentModelCommand extends RecordingCommand {
Stereotype cellStereotype = table.getApplicableStereotype(I_DocumentStereotype.CELL_STEREOTYPE);
Stereotype lineStereotype = table.getApplicableStereotype(I_DocumentStereotype.LINE_STEREOTYPE);
- // Iterates for each requirements
+ // Iterates for each requirements
for (Iterator<EObject> itereq = requirementsModel.eAllContents(); itereq.hasNext();) {
EObject packageableElement = itereq.next();
if (packageableElement instanceof PackageImport) {
- PackageImport importedPackage = (PackageImport)packageableElement;
+ PackageImport importedPackage = (PackageImport) packageableElement;
if (importedPackage.getAppliedStereotype(I_DeveloperIDMStereotype.REQUIREMENTS_STEREOTYPE) != null) {
Model importedRequirementPackageIn = (Model) importedPackage.getImportedPackage();
setTableCoverage(importedRequirementPackageIn, requirementsCoverageOUT, table, unsatisfiedRequirementComment, unverifiedRequirementComment);
@@ -488,7 +548,8 @@ public class CreateDocumentModelCommand extends RecordingCommand {
@SuppressWarnings("unchecked")
List<NamedElement> cddSatisfiedBy = (List<NamedElement>) currentReq.getValue(reqStereotype, "satisfiedBy");
- /* If the requirement is unsatisfied,
+ /*
+ * If the requirement is unsatisfied,
* add it to the unsatisfiedRequirement list (for tracability)
* creates a comment with the cellContentStereotype (to add reference in the documentation)
*/
@@ -501,14 +562,16 @@ public class CreateDocumentModelCommand extends RecordingCommand {
unsatisfiedReq.setBody((String) currentReq.getValue(reqStereotype, "id"));
}
- /* Iterate on satisfied elements of the requirements.
+ /*
+ * Iterate on satisfied elements of the requirements.
* For each one, create the cellContent.
- * Then, add it to the SatisfiedBy cell of the table */
+ * Then, add it to the SatisfiedBy cell of the table
+ */
for (Iterator<NamedElement> iterSatisified = cddSatisfiedBy.iterator(); iterSatisified.hasNext();) {
NamedElement satisfiedElement = iterSatisified.next();
Comment satisfiedByCellContent = satisfiedByCell.createOwnedComment();
- satisfiedByCellContent.applyStereotype(refContentStereotype);
+ satisfiedByCellContent.applyStereotype(refContentStereotype);
satisfiedByCellContent.setValue(refContentStereotype, I_DocumentStereotype.REF_CONTENT_REF_ATT, satisfiedElement);
satisfiedByCellContent.setBody(satisfiedElement.getName());
@@ -516,14 +579,15 @@ public class CreateDocumentModelCommand extends RecordingCommand {
satisfiedByCell.setBody("Satisfied elements");
- // Generate VerifiedBy cell of the table
+ // Generate VerifiedBy cell of the table
Comment verifiedByCell = lineComment.createOwnedComment();
verifiedByCell.applyStereotype(cellStereotype);
@SuppressWarnings("unchecked")
List<NamedElement> cddVerifiededBy = (List<NamedElement>) currentReq.getValue(reqStereotype, "verifiedBy");
- /* If the requirement is unverified,
+ /*
+ * If the requirement is unverified,
* add it to the unverifiedRequirement list (for tracability)
* creates a comment with the cellContentStereotype (to add reference in the documentation)
*/
@@ -536,24 +600,25 @@ public class CreateDocumentModelCommand extends RecordingCommand {
unverifiedReq.setBody((String) currentReq.getValue(reqStereotype, "id"));
}
- /* Iterate on verified elements of the requirements.
+ /*
+ * Iterate on verified elements of the requirements.
* For each one, create the cellContent.
- * Then, add it to the VerifiedBy cell of the table
+ * Then, add it to the VerifiedBy cell of the table
*/
for (Iterator<NamedElement> iterVerified = cddVerifiededBy.iterator(); iterVerified.hasNext();) {
NamedElement verifiedElement = iterVerified.next();
Comment verifiedByCellContent = verifiedByCell.createOwnedComment();
- verifiedByCellContent.applyStereotype(refContentStereotype);
+ verifiedByCellContent.applyStereotype(refContentStereotype);
verifiedByCellContent.setValue(refContentStereotype, I_DocumentStereotype.REF_CONTENT_REF_ATT, verifiedElement);
- verifiedByCellContent.setBody(verifiedElement.getName()) ;
+ verifiedByCellContent.setBody(verifiedElement.getName());
}
verifiedByCell.setBody("Verified elements");
}
- unsatisfiedRequirementComment.setBody("Unsatisfied requirements (" + nbUnsatisfiedRequirement + " out of " + nbRequirement + ") : ");
+ unsatisfiedRequirementComment.setBody("Unsatisfied requirements (" + nbUnsatisfiedRequirement + " out of " + nbRequirement + ") : ");
unverifiedRequirementComment.setBody("Unverified requirements (" + nbUnverifiedRequirement + " out of " + nbRequirement + ") : ");
}
}
@@ -626,11 +691,11 @@ public class CreateDocumentModelCommand extends RecordingCommand {
Comment commentImg = designPackageOUT.createOwnedComment();
Stereotype refStereotype = commentImg.getApplicableStereotype(I_DocumentStereotype.IMAGEREF_STEREOTYPE);
commentImg.applyStereotype(refStereotype);
- String tmpDirectoryPath=directoryPath.substring(1);
- String path=IMGpath.replace("\\", "/").toString();
- int index=path.indexOf(tmpDirectoryPath);
- if(index==0){
- path="."+path.substring(tmpDirectoryPath.length());
+ String tmpDirectoryPath = directoryPath.substring(1);
+ String path = IMGpath.replace("\\", "/").toString();
+ int index = path.indexOf(tmpDirectoryPath);
+ if (index == 0) {
+ path = "." + path.substring(tmpDirectoryPath.length());
}
commentImg.setValue(refStereotype, I_DocumentStereotype.IMAGEREF_REF_ATT, path);
commentImg.setBody(hyperLinkObject.getTooltipText());
@@ -710,11 +775,11 @@ public class CreateDocumentModelCommand extends RecordingCommand {
Comment commentImg = currentModel.createOwnedComment();
Stereotype refStereotype = commentImg.getApplicableStereotype(I_DocumentStereotype.IMAGEREF_STEREOTYPE);
commentImg.applyStereotype(refStereotype);
- String tmpDirectoryPath=directoryPath.substring(1);
- String path=imagePath.toString();
- int index=path.indexOf(tmpDirectoryPath);
- if(index==0){
- path="."+path.substring(tmpDirectoryPath.length());
+ String tmpDirectoryPath = directoryPath.substring(1);
+ String path = imagePath.toString();
+ int index = path.indexOf(tmpDirectoryPath);
+ if (index == 0) {
+ path = "." + path.substring(tmpDirectoryPath.length());
}
commentImg.setValue(refStereotype, I_DocumentStereotype.IMAGEREF_REF_ATT, path);
commentImg.setBody(currentDiagram.getName());
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
index 567241eea72..80c38de6714 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetHTMLTextHandler.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 468079
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.handler;
@@ -35,7 +36,7 @@ import org.eclipse.uml2.uml.Stereotype;
public class GetHTMLTextHandler extends IDMAbstractHandler {
protected static final String INTERNAL_DIRECTORY_NAME = "/doc"; //$NON-NLS-1$
-
+
@@ -45,11 +46,18 @@ public class GetHTMLTextHandler extends IDMAbstractHandler {
System.err.println(getCurrentProject().getLocationURI().getPath());
IDMAbstractHandler.elt2DocElt.clear();
IDMAbstractHandler.Toc2DocElt.clear();
- CreateDocumentModelCommand createDocumentModelCommand = new CreateDocumentModelCommand(transactionalEditingDomain, (Model) getSelection(), getCurrentProject().getLocationURI().getPath() + INTERNAL_DIRECTORY_NAME);
- transactionalEditingDomain.getCommandStack().execute(createDocumentModelCommand);
- IProject project = getCurrentProject();
- TranscriptionEngine engine = new TranscriptionEngine((Model) getSelection(), project, new HTMLTranscription());
- engine.traduce();
+
+ try {
+ CreateDocumentModelCommand createDocumentModelCommand = new CreateDocumentModelCommand(transactionalEditingDomain, (Model) getSelection(), getCurrentProject().getLocationURI().getPath() + INTERNAL_DIRECTORY_NAME);
+ transactionalEditingDomain.getCommandStack().execute(createDocumentModelCommand);
+ IProject project = getCurrentProject();
+ TranscriptionEngine engine = new TranscriptionEngine((Model) getSelection(), project, new HTMLTranscription());
+ engine.traduce();
+ } finally {
+ IDMAbstractHandler.elt2DocElt.clear();
+ IDMAbstractHandler.Toc2DocElt.clear();
+ }
+
return null;
}
diff --git a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
index af418f54fb0..1f8bd1ae1e5 100644
--- a/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.uml.developer.mde/src/org/eclipse/papyrus/uml/developper/mde/handler/GetWikiTextHandler.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 468079
*
*****************************************************************************/
package org.eclipse.papyrus.uml.developper.mde.handler;
@@ -39,11 +40,18 @@ public class GetWikiTextHandler extends IDMAbstractHandler {
System.err.println(getCurrentProject().getLocationURI().getPath());
IDMAbstractHandler.elt2DocElt.clear();
IDMAbstractHandler.Toc2DocElt.clear();
- CreateDocumentModelCommand createDocumentModelCommand = new CreateDocumentModelCommand(transactionalEditingDomain, (Model) getSelection(), getCurrentProject().getLocationURI().getPath() + INTERNAL_DIRECTORY_NAME);
- transactionalEditingDomain.getCommandStack().execute(createDocumentModelCommand);
- IProject project = getCurrentProject();
- TranscriptionEngine engine = new TranscriptionEngine((Model) getSelection(), project, new WikiTranscription());
- engine.traduce();
+
+ try {
+ CreateDocumentModelCommand createDocumentModelCommand = new CreateDocumentModelCommand(transactionalEditingDomain, (Model) getSelection(), getCurrentProject().getLocationURI().getPath() + INTERNAL_DIRECTORY_NAME);
+ transactionalEditingDomain.getCommandStack().execute(createDocumentModelCommand);
+ IProject project = getCurrentProject();
+ TranscriptionEngine engine = new TranscriptionEngine((Model) getSelection(), project, new WikiTranscription());
+ engine.traduce();
+ } finally {
+ IDMAbstractHandler.elt2DocElt.clear();
+ IDMAbstractHandler.Toc2DocElt.clear();
+ }
+
return null;
}

Back to the top