Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-05-07 08:01:44 +0000
committerAnsgar Radermacher2014-05-07 09:26:33 +0000
commitf3fbb4a5d62b2d4e4d1eb24824acb0df881ca3a8 (patch)
treeb5294468af70eeb4fc053f52e5a2649b20a87b56 /extraplugins
parent42e4f56af102f9442b5a40f23257b37633b95b1a (diff)
downloadorg.eclipse.papyrus-f3fbb4a5d62b2d4e4d1eb24824acb0df881ca3a8.tar.gz
org.eclipse.papyrus-f3fbb4a5d62b2d4e4d1eb24824acb0df881ca3a8.tar.xz
org.eclipse.papyrus-f3fbb4a5d62b2d4e4d1eb24824acb0df881ca3a8.zip
433984 - [QDesginer] Refactoring - move C++ project generation to "standard" code generation
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties3
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.xml5
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/schema/language.exsd109
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java1
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java21
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/ILangSupport.java98
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/LanguageSupport.java49
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties1
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF5
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml4
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CLanguageSupport.java2
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppLanguageSupport.java23
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppLanguageSupport.java2
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml10
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java81
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java2
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF4
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.emtl118
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.mtl4
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java5
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java2
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo2
26 files changed, 199 insertions, 368 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF
index aa49bdda6e1..020680c55dd 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF
@@ -1,6 +1,5 @@
Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.acceleo,
- org.eclipse.papyrus.acceleo.extensions
+Export-Package: org.eclipse.papyrus.acceleo
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.acceleo.engine;bundle-version="3.2.2",
org.eclipse.acceleo.parser;bundle-version="3.2.2",
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties
index f2e8d42a1b3..5f3abe40576 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties
@@ -4,8 +4,7 @@ bin.includes = META-INF/,\
.,\
about.html,\
plugin.properties,\
- build.acceleo,\
- schema/
+ build.acceleo
output..=bin/
src.includes=about.html
source..=src/
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.xml
deleted file mode 100644
index 70f0b0af878..00000000000
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension-point id="language" name="languageSupport" schema="schema/language.exsd"/>
- </plugin>
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/schema/language.exsd b/extraplugins/codegen/org.eclipse.papyrus.acceleo/schema/language.exsd
deleted file mode 100644
index 9e7e950f59b..00000000000
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/schema/language.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.qompass.designer.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.papyrus.qompass.designer.core" id="language" name="languageSupport"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="client"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="client">
- <complexType>
- <attribute name="language" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.qompass.designer.core.ILangSupport"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java
index b25719f6106..a3867d5466d 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Messages.java
@@ -4,7 +4,6 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.papyrus.acceleo.messages"; //$NON-NLS-1$
- public static String LanguageSupport_LanguageNotSupported;
public static String ModelElementsCreator_UnsupportedModelElement;
static {
// initialize resource bundle
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
index bcd1e2a6c19..b0d072d74a2 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/ModelElementsCreator.java
@@ -102,7 +102,8 @@ abstract public class ModelElementsCreator {
protected IProject project;
/**
- * Main function for user calls. Creates code for a packageable element.
+ * Main function for user calls. Creates code for a packageable element. In case of a passed package, the contained elements
+ * are generated recursively.
*
* @param monitor
* a progress monitor
@@ -112,7 +113,7 @@ abstract public class ModelElementsCreator {
*/
public void createPackageableElement(IProgressMonitor monitor, PackageableElement element) throws CoreException {
IContainer packageContainer = getContainer(element);
- createPackageableElement(packageContainer, monitor, element);
+ createPackageableElement(packageContainer, monitor, element, true);
}
/**
@@ -127,9 +128,9 @@ abstract public class ModelElementsCreator {
* the element for which code should be generated
* @throws CoreException
*/
- public void createPackageableElement(IContainer packageContainer, IProgressMonitor monitor, PackageableElement element) throws CoreException {
+ public void createPackageableElement(IContainer packageContainer, IProgressMonitor monitor, PackageableElement element, boolean recursive) throws CoreException {
if(element instanceof Package) {
- createPackage(packageContainer, monitor, (Package)element);
+ createPackage(packageContainer, monitor, (Package)element, recursive);
}
else if((element instanceof PrimitiveType) || (element instanceof Enumeration) || (element instanceof Usage)) {
// do nothing, included in package
@@ -249,7 +250,7 @@ abstract public class ModelElementsCreator {
* the package for which code should be created
* @throws CoreException
*/
- protected void createPackage(IContainer packageContainer, IProgressMonitor monitor, Package pkg) throws CoreException {
+ protected void createPackage(IContainer packageContainer, IProgressMonitor monitor, Package pkg, boolean recurse) throws CoreException {
if (monitor != null) {
monitor.subTask("generate package " + pkg.getQualifiedName()); //$NON-NLS-1$
}
@@ -266,11 +267,11 @@ abstract public class ModelElementsCreator {
createPackageFiles(packageContainer, monitor, pkg);
- // Continue generation parsing package content
- // If CppNoCodeGen on package, it applies to its content
-
- for(PackageableElement currentElement : pkg.getPackagedElements()) {
- createPackageableElement(packageContainer, monitor, currentElement);
+ if (recurse) {
+ // Continue generation parsing package contents
+ for(PackageableElement currentElement : pkg.getPackagedElements()) {
+ createPackageableElement(packageContainer, monitor, currentElement, recurse);
+ }
}
}
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/ILangSupport.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/ILangSupport.java
deleted file mode 100644
index ffd1621d277..00000000000
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/ILangSupport.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 CEA LIST.
- * 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:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.acceleo.extensions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.InstanceSpecification;
-import org.eclipse.uml2.uml.PackageableElement;
-
-/**
- * Interface used by Qompass extensions that support a specific programming language
- */
-public interface ILangSupport {
-
- /**
- * Create a project for a specific language and configure it (according to gathered configuration
- * data before). In case of C/C++ for instance, a CDT project should be created, in case of Java,
- * a JDT project.
- * And implementation should call setProject and setSettings before returning the project
- *
- * @param projectName
- * the named of the project
- * @param node
- * the node for which the project should be created
- * @return the created project
- */
- public IProject createProject(String projectName, InstanceSpecification node);
-
- /**
- * Set project information
- *
- * @param project
- * the project (must already been initialized)
- */
- public void setProject(IProject project);
-
- public IProject getProject();
-
- /**
- * Re-create the project settings from model information
- *
- * @param node
- * node for which settings should be set
- * @throws TransformationException
- */
- public void setSettings(InstanceSpecification node);
-
- /**
- * Generate code for a specific language
- *
- * @param monitor
- * a progress monitor
- * @param element
- * a packageable element, typically a classifier or a package
- *
- * @throws TransformationException
- */
- public void generateCode(IProgressMonitor monitor, PackageableElement element);
-
- /**
- * Clean the code for a certain element, i.e. remove code that has previously generated for this element
- * This code is required for differential code generation which needs to remove elements for instance
- * after they have been renamed.
- *
- * @param project
- * project in which code should be generated
- * @param element
- * the element for which the generate code should be removed
- * @throws TransformationException
- */
- public void cleanCode(IProgressMonitor monitor, PackageableElement element);
-
- /**
- * Reset gathered configuration data
- *
- * @see gatherConfigData
- */
- public void resetConfigurationData();
-
-
- /**
- * Gather configuration data from implementations, e.g. required include paths or libraries
- *
- * @param implementation
- * a class copied to the target
- */
- public void gatherConfigData(Class implementation);
-}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/LanguageSupport.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/LanguageSupport.java
deleted file mode 100644
index 6cdcf04775b..00000000000
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/extensions/LanguageSupport.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 CEA LIST.
- * 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:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.papyrus.acceleo.extensions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.papyrus.acceleo.Activator;
-import org.eclipse.papyrus.acceleo.Messages;
-
-
-/**
- * Support for multiple target languages via the Eclipse extension mechanism
- */
-public class LanguageSupport {
-
- public static final String ILANG_SUPPORT_ID = Activator.PLUGIN_ID + ".language"; //$NON-NLS-1$
-
- public static ILangSupport getLangSupport(String language)
- {
- IExtensionRegistry reg = Platform.getExtensionRegistry();
- IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID);
- for(IConfigurationElement configElement : configElements) {
- try {
- final String extLanguage = configElement.getAttribute("language"); //$NON-NLS-1$
- if(extLanguage.equals(language)) {
- // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes)
- final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$
- if(obj instanceof ILangSupport) {
- return (ILangSupport)obj;
- }
- }
- } catch (CoreException exception) {
- exception.printStackTrace();
- }
- }
- throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, language));
- }
-}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties
index a1fd22aef6b..ad6e5a9fa79 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties
+++ b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/messages.properties
@@ -1,2 +1 @@
-LanguageSupport_LanguageNotSupported=Support for language %s not configured
ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element %s
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF
index f0422fe489e..db5248274a4 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF
@@ -5,13 +5,14 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.ecore,
org.eclipse.uml2.uml,
org.eclipse.cdt.ui,
- org.eclipse.papyrus.cpp.codegen;bundle-version="1.0.0",
org.eclipse.ui.ide,
org.eclipse.core.resources,
org.eclipse.cdt.managedbuilder.core;bundle-version="8.0.0",
org.eclipse.cdt.core;bundle-version="5.4.0",
org.eclipse.papyrus.acceleo;bundle-version="1.0.0",
- org.eclipse.papyrus.cpp.profile;bundle-version="1.0.0"
+ org.eclipse.papyrus.cpp.profile;bundle-version="1.0.0",
+ org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.0.0",
+ org.eclipse.papyrus.cpp.codegen;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml
index f2f58f3324b..5852f0817dd 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml
@@ -2,14 +2,14 @@
<?eclipse version="3.2"?>
<plugin>
<extension
- point="org.eclipse.papyrus.acceleo.language">
+ point="org.eclipse.papyrus.codegen.extensionpoints.language">
<client
class="org.eclipse.papyrus.cpp.cdtproject.CppLanguageSupport"
language="C++">
</client>
</extension>
<extension
- point="org.eclipse.papyrus.acceleo.language">
+ point="org.eclipse.papyrus.codegen.extensionpoints.language">
<client
class="org.eclipse.papyrus.cpp.cdtproject.CLanguageSupport"
language="C">
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CLanguageSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CLanguageSupport.java
index cc4ff155a89..e69a470745f 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CLanguageSupport.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CLanguageSupport.java
@@ -2,7 +2,7 @@ package org.eclipse.papyrus.cpp.cdtproject;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.acceleo.extensions.ILangSupport;
+import org.eclipse.papyrus.codegen.extensionpoints.ILangSupport;
import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants;
/**
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppLanguageSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppLanguageSupport.java
index 060cf8bcfa4..4e2c82aefb9 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppLanguageSupport.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppLanguageSupport.java
@@ -26,7 +26,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.UniqueEList;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.papyrus.C_Cpp.ExternLibrary;
-import org.eclipse.papyrus.acceleo.extensions.ILangSupport;
+import org.eclipse.papyrus.codegen.extensionpoints.ILangSupport;
import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -34,7 +34,6 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -59,7 +58,7 @@ public class C_CppLanguageSupport implements ILangSupport {
* @param projectName
* @return
*/
- public IProject createProject(String projectName, InstanceSpecification node)
+ public IProject createProject(String projectName, String targetOS)
{
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -91,7 +90,7 @@ public class C_CppLanguageSupport implements ILangSupport {
throw new RuntimeException("could not create CDT project ..."); //$NON-NLS-1$
}
setProject(project);
- setSettings(node);
+ setSettings(targetOS);
return project;
}
@@ -103,7 +102,7 @@ public class C_CppLanguageSupport implements ILangSupport {
return m_project;
}
- public void setSettings(InstanceSpecification node)
+ public void setSettings(String targetOS)
{
try {
// ((CProject) project).
@@ -129,19 +128,9 @@ public class C_CppLanguageSupport implements ILangSupport {
// define name of used operating system from model (attribute of "Target" stereotype)
// and add it to list of macros
- /*
- Target target = UMLUtil.getStereotypeApplication(node, Target.class);
- if(target == null) {
- // get information from node referenced by the instance
- target = UMLUtil.getStereotypeApplication(DepUtils.getClassifier(node), Target.class);
+ if (targetOS != null) {
+ macros.add("OS_" + targetOS); //$NON-NLS-1$
}
- if(target != null) {
- OperatingSystem os = target.getUsedOS();
- if(os != null) {
- macros.add("OS_" + os.getBase_Class().getName()); //$NON-NLS-1$
- }
- }
- */
// define macros
EList<ICLanguageSettingEntry> icMacros =
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppLanguageSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppLanguageSupport.java
index bedad0060cf..a8f79a19a1a 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppLanguageSupport.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppLanguageSupport.java
@@ -2,7 +2,7 @@ package org.eclipse.papyrus.cpp.cdtproject;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.acceleo.extensions.ILangSupport;
+import org.eclipse.papyrus.codegen.extensionpoints.ILangSupport;
import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants;
import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator;
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..c537b63063c
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.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/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF
index ad797a366e5..e9f1ceb72c4 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.acceleo.ui;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.papyrus.acceleo.ui;bundle-version="1.0.0",
- org.eclipse.core.resources
+ org.eclipse.core.resources,
+ org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml
index 6bdb3afbbe4..e9111f464b8 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml
@@ -29,6 +29,16 @@
</command>
</extension>
<extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="Re-write CDT project settings"
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.cpp.codegen.cdtproject"
+ defaultHandler="org.eclipse.papyrus.cpp.codegen.ui.handlers.CDTprojectHandler"
+ name="Configure CDT project">
+ </command>
+ </extension>
+ <extension
point="org.eclipse.ui.preferencePages">
<page
category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java
new file mode 100644
index 00000000000..87582af21dc
--- /dev/null
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2013 CEA LIST
+ *
+ * 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:
+ * Ansgar Radermacher - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.papyrus.cpp.codegen.ui.handlers;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.papyrus.acceleo.ui.handlers.CmdHandler;
+import org.eclipse.papyrus.codegen.extensionpoints.ILangSupport;
+import org.eclipse.papyrus.codegen.extensionpoints.LanguageSupport;
+import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.PackageableElement;
+
+/**
+ * Handler for C++ code generation
+ */
+public class CDTprojectHandler extends CmdHandler {
+
+ private static final String LANGUAGE_NAME = "C++"; //$NON-NLS-1$
+
+ // ------------------------------------------------------------------------
+ // Execution
+ // ------------------------------------------------------------------------
+
+ @Override
+ public boolean isEnabled() {
+ updateSelectedEObject();
+
+ if (selectedEObject instanceof Package || selectedEObject instanceof Classifier) {
+ URI uri = selectedEObject.eResource().getURI();
+
+ // URIConverter uriConverter = resource.getResourceSet().getURIConverter();
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ if(uri.segmentCount() < 2) {
+ return false;
+ }
+ IProject modelProject = root.getProject(uri.segment(1));
+ return modelProject.exists();
+ }
+
+ return false;
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ if(selectedEObject instanceof PackageableElement) {
+ PackageableElement pe = (PackageableElement)selectedEObject;
+
+ IProject modelProject = LocateCppProject.getTargetProject(pe, true);
+ if(modelProject == null) {
+ return null;
+ }
+
+ // get the container for the current element
+ ILangSupport langSupport = LanguageSupport.getLangSupport(LANGUAGE_NAME);
+ if (langSupport != null) {
+ langSupport.resetConfigurationData();
+ langSupport.setSettings(null);
+ }
+ else {
+ return null;
+ }
+ }
+ return null;
+ }
+}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java
index 7278b7d9ab4..7c77a01a07a 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java
@@ -86,6 +86,8 @@ public class CodegenPreferencePage extends FieldEditorPreferencePage implements
"Suffix for C++ header files ", getFieldEditorParent()));
addField(new StringFieldEditor(CppCodeGenConstants.P_IMPLEM_SUFFIX,
"Suffix for C++ implementation files ", getFieldEditorParent()));
+ addField(new StringFieldEditor(CppCodeGenConstants.P_PROJECT_PREFIX,
+ "Prefix for generated C++ (CDT) projects ", getFieldEditorParent()));
// Add P_COMMENT_HEADER
addTextField(CppCodeGenConstants.P_COMMENT_HEADER, "Header for generated files",
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF
index c1cf9535f5a..8832f7d4793 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF
@@ -9,7 +9,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.filesystem;bundle-version="1.3.200",
org.eclipse.papyrus.acceleo;bundle-version="1.0.0",
org.eclipse.cdt.core;resolution:=optional,
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
+ org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.cpp.codegen;uses:="org.eclipse.ui.plugin,org.osgi.framework,org.eclipse.uml2.uml",
org.eclipse.papyrus.cpp.codegen.preferences;uses:="org.eclipse.jface.preference,org.eclipse.core.runtime.preferences",
org.eclipse.papyrus.cpp.codegen.transformation;
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.emtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.emtl
index 31678662463..f3905cb70d3 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.emtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.emtl
@@ -97,16 +97,8 @@
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="&#xA;&#xA;"/>
<body xsi:type="mtl:TemplateInvocation">
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
- <definition href="CppIncludeUtils.emtl#/0/CppIncludeBody"/>
- <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/11">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
- </argument>
- </body>
- <body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="&#xA;&#xA;"/>
- <body xsi:type="mtl:TemplateInvocation">
- <eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
<definition href="Constants.emtl#/0/constDerivedIncludes"/>
- <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/12">
+ <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/11">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
</argument>
</body>
@@ -115,7 +107,7 @@
<body xsi:type="mtl:TemplateInvocation">
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
<definition href="CppIncludeUtils.emtl#/0/IncludeDirective"/>
- <argument xsi:type="ocl.ecore:VariableExp" name="path" referredVariable="/0/CppClassBody/%.15/path">
+ <argument xsi:type="ocl.ecore:VariableExp" name="path" referredVariable="/0/CppClassBody/%.13/path">
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
</argument>
</body>
@@ -123,11 +115,11 @@
<loopVariable name="path">
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
</loopVariable>
- <iterSet xsi:type="ocl.ecore:OperationCallExp" eType="/13/OrderedSet(String)">
- <source xsi:type="ocl.ecore:OperationCallExp" eType="/13/Sequence(String)">
- <source xsi:type="mtl:QueryInvocation" eType="/13/Sequence(String)">
+ <iterSet xsi:type="ocl.ecore:OperationCallExp" eType="/12/OrderedSet(String)">
+ <source xsi:type="ocl.ecore:OperationCallExp" eType="/12/Sequence(String)">
+ <source xsi:type="mtl:QueryInvocation" eType="/12/Sequence(String)">
<definition href="util/clazz/CppClassIncludeClassDeclaration.emtl#/0/CppClassAllIncludesDeclarationBody"/>
- <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/14">
+ <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/13">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
</argument>
</source>
@@ -137,6 +129,14 @@
</iterSet>
</body>
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="&#xA;"/>
+ <body xsi:type="mtl:TemplateInvocation">
+ <eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
+ <definition href="CppIncludeUtils.emtl#/0/CppIncludeBody"/>
+ <argument xsi:type="ocl.ecore:VariableExp" name="self" referredVariable="/18">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
+ </argument>
+ </body>
+ <body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="&#xA;&#xA;"/>
<body xsi:type="mtl:QueryInvocation">
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
<definition href="../utils/CppGenUtils.emtl#/0/openNS"/>
@@ -503,9 +503,6 @@
<ocl.ecore:Variable name="self">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
</ocl.ecore:Variable>
- <ocl.ecore:Variable name="self">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
- </ocl.ecore:Variable>
<ecore:EPackage name="collections">
<eClassifiers xsi:type="ocl.ecore:SequenceType" name="Sequence(String)" instanceClassName="java.util.List">
<elementType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/>
@@ -548,6 +545,9 @@
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
</ocl.ecore:Variable>
<ocl.ecore:Variable name="self">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
+ </ocl.ecore:Variable>
+ <ocl.ecore:Variable name="self">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
</ocl.ecore:Variable>
<ecore:EAnnotation source="positions">
@@ -698,7 +698,7 @@
</eAnnotations>
<eAnnotations source="positions.29" references="/0/CppClassBody/%.11">
<details key="start" value="1138"/>
- <details key="end" value="1154"/>
+ <details key="end" value="1160"/>
<details key="line" value="0"/>
</eAnnotations>
<eAnnotations source="positions.30" references="/0/CppClassBody/%.11/self">
@@ -707,72 +707,72 @@
<details key="line" value="0"/>
</eAnnotations>
<eAnnotations source="positions.31" references="/0/CppClassBody/%.12">
- <details key="start" value="1156"/>
- <details key="end" value="1158"/>
+ <details key="start" value="1162"/>
+ <details key="end" value="1163"/>
<details key="line" value="26"/>
</eAnnotations>
<eAnnotations source="positions.32" references="/0/CppClassBody/%.13">
- <details key="start" value="1159"/>
- <details key="end" value="1181"/>
+ <details key="start" value="1163"/>
+ <details key="end" value="1284"/>
+ <details key="line" value="26"/>
+ </eAnnotations>
+ <eAnnotations source="positions.33" references="/0/CppClassBody/%.13/%">
+ <details key="start" value="1252"/>
+ <details key="end" value="1275"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.33" references="/0/CppClassBody/%.13/self">
- <details key="start" value="-1"/>
- <details key="end" value="-1"/>
+ <eAnnotations source="positions.34" references="/0/CppClassBody/%.13/%/path">
+ <details key="start" value="1252"/>
+ <details key="end" value="1256"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.34" references="/0/CppClassBody/%.14">
- <details key="start" value="1183"/>
- <details key="end" value="1184"/>
+ <eAnnotations source="positions.35" references="/0/CppClassBody/%.13/%.1">
+ <details key="start" value="1277"/>
+ <details key="end" value="1278"/>
<details key="line" value="28"/>
</eAnnotations>
- <eAnnotations source="positions.35" references="/0/CppClassBody/%.15">
- <details key="start" value="1184"/>
- <details key="end" value="1305"/>
- <details key="line" value="28"/>
+ <eAnnotations source="positions.36" references="/0/CppClassBody/%.13/path">
+ <details key="start" value="1169"/>
+ <details key="end" value="1182"/>
+ <details key="line" value="26"/>
</eAnnotations>
- <eAnnotations source="positions.36" references="/0/CppClassBody/%.15/%">
- <details key="start" value="1273"/>
- <details key="end" value="1296"/>
+ <eAnnotations source="positions.37" references="/0/CppClassBody/%.13/%.2">
+ <details key="start" value="1185"/>
+ <details key="end" value="1248"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.37" references="/0/CppClassBody/%.15/%/path">
- <details key="start" value="1273"/>
- <details key="end" value="1277"/>
+ <eAnnotations source="positions.38" references="/0/CppClassBody/%.13/%.2/%">
+ <details key="start" value="1185"/>
+ <details key="end" value="1232"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.38" references="/0/CppClassBody/%.15/%.1">
- <details key="start" value="1298"/>
- <details key="end" value="1299"/>
- <details key="line" value="30"/>
- </eAnnotations>
- <eAnnotations source="positions.39" references="/0/CppClassBody/%.15/path">
- <details key="start" value="1190"/>
- <details key="end" value="1203"/>
- <details key="line" value="28"/>
- </eAnnotations>
- <eAnnotations source="positions.40" references="/0/CppClassBody/%.15/%.2">
- <details key="start" value="1206"/>
- <details key="end" value="1269"/>
+ <eAnnotations source="positions.39" references="/0/CppClassBody/%.13/%.2/%/%">
+ <details key="start" value="1185"/>
+ <details key="end" value="1221"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.41" references="/0/CppClassBody/%.15/%.2/%">
- <details key="start" value="1206"/>
- <details key="end" value="1253"/>
+ <eAnnotations source="positions.40" references="/0/CppClassBody/%.13/%.2/%/%/self">
+ <details key="start" value="-1"/>
+ <details key="end" value="-1"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.42" references="/0/CppClassBody/%.15/%.2/%/%">
- <details key="start" value="1206"/>
- <details key="end" value="1242"/>
+ <eAnnotations source="positions.41" references="/0/CppClassBody/%.14">
+ <details key="start" value="1285"/>
+ <details key="end" value="1286"/>
+ <details key="line" value="29"/>
+ </eAnnotations>
+ <eAnnotations source="positions.42" references="/0/CppClassBody/%.15">
+ <details key="start" value="1287"/>
+ <details key="end" value="1303"/>
<details key="line" value="0"/>
</eAnnotations>
- <eAnnotations source="positions.43" references="/0/CppClassBody/%.15/%.2/%/%/self">
+ <eAnnotations source="positions.43" references="/0/CppClassBody/%.15/self">
<details key="start" value="-1"/>
<details key="end" value="-1"/>
<details key="line" value="0"/>
</eAnnotations>
<eAnnotations source="positions.44" references="/0/CppClassBody/%.16">
- <details key="start" value="1306"/>
+ <details key="start" value="1305"/>
<details key="end" value="1307"/>
<details key="line" value="31"/>
</eAnnotations>
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.mtl
index f3ab44b4861..af47e965998 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.mtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/acceleo/CppClassBody.mtl
@@ -22,13 +22,13 @@
[constIncludeHFile()/]
[IncludeDirective( getNearestPackage().getFullPath() + '/' + class.name + '.' + getHeaderSuffix() )/]
-[CppIncludeBody()/]
-
[constDerivedIncludes()/]
[for (path : String | CppClassAllIncludesDeclarationBody()->flatten()->asOrderedSet())]
[path.IncludeDirective()/]
[/for]
+[CppIncludeBody()/]
+
[openNS(class)/]
[CppStaticAttributes(class)/]
[if not isTemplate()]
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
index 807effc4dc1..1aab3893c60 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
@@ -152,8 +152,9 @@ public class CppGenUtils {
}
for(Namespace ns : ne.allNamespaces()) {
- // don't add top-level
- if(ns.getOwner() != null) {
+ // don't add qualified name for specific top-level namespace "root".
+ // TODO: specific workaround for the way Qompass creates its target model. Needs to be removed.
+ if(!((ns.getOwner() == null) && ns.getName().equals("root"))) { //$NON-NLS-1$
qName = ns.getName() + "::" + qName; //$NON-NLS-1$
}
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java
index 90c2b9b1d33..4739b75b0dd 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java
@@ -56,7 +56,7 @@ public class SyncModelToCDT {
// get the container for the current element
ModelElementsCreator mec = new CppModelElementsCreator(modelProject);
srcPkg = mec.getContainer(classifier);
- mec.createPackageableElement(srcPkg, null, classifier); // need listener for sync in both directions!
+ mec.createPackageableElement(srcPkg, null, classifier, false); // need listener for sync in both directions!
cppFile = srcPkg.getFile(new Path(name + ".cpp")); // TODO: extension is configurable! //$NON-NLS-1$
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF
index 441c972e1e8..661b2f7fd7a 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF
@@ -35,7 +35,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.ui
+ org.eclipse.ui,
+ org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo
index 2308e9d2c6e..f1dfcddd5ce 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo
@@ -18,7 +18,7 @@
<acceleoCompiler
sourceFolder="${target.folder}"
outputFolder="${target.folder}"
- dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;"
+ dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;${target.folder}/../../org.eclipse.papyrus.uml.tools.utils;${target.folder}/../../org.eclipse.papyrus.codegen.extensionpoints;"
binaryResource="false"
packagesToRegister="">
</acceleoCompiler>

Back to the top