Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2016-04-16 18:22:47 +0000
committerHenrik Rentz-Reichert2016-04-16 18:22:47 +0000
commitc1b463dd3d17db63ea6465b6c9863ceba17175d9 (patch)
tree292e8c4ab40cc3faf3d912c094571a82124c5b9d
parentd4ca6ae5f62de526394f5cf66fd3713640557058 (diff)
parent64200cdb596bd054a66a90b6892e29e11ab015f2 (diff)
downloadorg.eclipse.etrice-c1b463dd3d17db63ea6465b6c9863ceba17175d9.tar.gz
org.eclipse.etrice-c1b463dd3d17db63ea6465b6c9863ceba17175d9.tar.xz
org.eclipse.etrice-c1b463dd3d17db63ea6465b6c9863ceba17175d9.zip
Merge remote-tracking branch 'origin/master'
Reduced o.e.e.genertor.ui.cdt dependency to org.eclipse.ui.workbench;bundle-version="3.106.0" (was 3.106.2) Conflicts: plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java Change-Id: I9e13b3cd61a480059d674f08e2e5912040a1565a
-rw-r--r--features/org.eclipse.etrice.feature/feature.xml7
-rw-r--r--plugins/org.eclipse.etrice.doc/make.xml.launch18
-rw-r--r--plugins/org.eclipse.etrice.doc/run_online-doc.xml.launch19
-rw-r--r--plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CPPProjectConfigurator.java6
-rw-r--r--plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java175
-rw-r--r--plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java149
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java3
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java5
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java5
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java12
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java4
-rw-r--r--plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java21
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/StructureClassSupport.java142
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp134
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h152
-rw-r--r--tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtDatatypes.h40
18 files changed, 521 insertions, 377 deletions
diff --git a/features/org.eclipse.etrice.feature/feature.xml b/features/org.eclipse.etrice.feature/feature.xml
index 2d0e579fd..05bf843c4 100644
--- a/features/org.eclipse.etrice.feature/feature.xml
+++ b/features/org.eclipse.etrice.feature/feature.xml
@@ -271,13 +271,6 @@ http://www.eclipse.org/legal/epl-v10.html
unpack="false"/>
<plugin
- id="org.eclipse.etrice.core.config.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.etrice.core.config.ui"
download-size="0"
install-size="0"
diff --git a/plugins/org.eclipse.etrice.doc/make.xml.launch b/plugins/org.eclipse.etrice.doc/make.xml.launch
new file mode 100644
index 000000000..4218d3899
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/make.xml.launch
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.doc/make.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.doc"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="onlineDoc,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.doc/make.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.etrice.doc/run_online-doc.xml.launch b/plugins/org.eclipse.etrice.doc/run_online-doc.xml.launch
new file mode 100644
index 000000000..b8bd666e3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/run_online-doc.xml.launch
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.doc/run_online-doc.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.doc"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.doc/run_online-doc.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF
index 4873f6a9f..4846fb4b0 100644
--- a/plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.ui.cdt/META-INF/MANIFEST.MF
@@ -9,10 +9,11 @@ Require-Bundle: org.eclipse.etrice.generator.ui;bundle-version="0.5.0",
org.eclipse.cdt.core;bundle-version="5.5.0",
org.eclipse.cdt.managedbuilder.core;bundle-version="8.2.0",
org.eclipse.equinox.common;bundle-version="3.6.200",
- org.eclipse.ui.workbench;bundle-version="3.106.2",
+ org.eclipse.ui.workbench;bundle-version="3.106.0",
org.eclipse.equinox.preferences;bundle-version="3.5.200",
org.eclipse.core.commands;bundle-version="3.6.100",
org.eclipse.ui.ide;bundle-version="3.10.2",
org.eclipse.emf.common;bundle-version="2.10.1",
org.eclipse.emf.common.ui;bundle-version="2.9.0"
-Import-Package: org.eclipse.core.resources
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.core.runtime.jobs
diff --git a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CPPProjectConfigurator.java b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CPPProjectConfigurator.java
index 629b986bf..bf46752ac 100644
--- a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CPPProjectConfigurator.java
+++ b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CPPProjectConfigurator.java
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @author Henrik Rentz-Reichert
*
*/
-public class CPPProjectConfigurator extends ProjectConfigurator {
+public class CPPProjectConfigurator extends CProjectConfigurator {
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.ui.cdt.ProjectConfigurator#isApplicable(org.eclipse.core.resources.IProject)
@@ -41,9 +41,9 @@ public class CPPProjectConfigurator extends ProjectConfigurator {
* @see org.eclipse.etrice.generator.ui.cdt.ProjectConfigurator#getCompilerId()
*/
@Override
- public String getCompilerId() {
+ public boolean isIncludePathId(String id) {
// NOTE: for some reason the "${workspace_loc:/${ProjName}/src-gen}" include path has to be added for the C compiler!
- return "cdt.managedbuild.tool.gnu.c.compiler";
+ return super.isIncludePathId(id);
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java
index e32944532..c9df00377 100644
--- a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java
+++ b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/CProjectConfigurator.java
@@ -26,10 +26,21 @@ import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.etrice.generator.ui.wizard.WizardHelpers;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
@@ -40,6 +51,8 @@ import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
*/
public class CProjectConfigurator extends ProjectConfigurator {
+ private static final String C_RUNTIME_FOLDER_NAME = "c-runtime";
+
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.ui.cdt.ProjectConfigurator#isApplicable(org.eclipse.core.resources.IProject)
*/
@@ -52,8 +65,15 @@ public class CProjectConfigurator extends ProjectConfigurator {
* @see org.eclipse.etrice.generator.ui.cdt.ProjectConfigurator#getCompilerId()
*/
@Override
- public String getCompilerId() {
- return "cdt.managedbuild.tool.gnu.c.compiler";
+ public boolean isIncludePathId(String id) {
+ if (id.startsWith("cdt.managedbuild.tool.gnu.c.compiler"))
+ return true;;
+ if (id.startsWith("org.eclipse.cdt.msvc.cl.inputType.c"))
+ return true;
+ if (id.startsWith("cdt.managedbuild.tool.gnu.c.compiler.input"))
+ return true;
+
+ return false;
}
/* (non-Javadoc)
@@ -62,7 +82,13 @@ public class CProjectConfigurator extends ProjectConfigurator {
@Override
public List<CIncludePathEntry> getIncludePaths() {
List<CIncludePathEntry> srcIncludes = new ArrayList<CIncludePathEntry>();
- srcIncludes.add(new CIncludePathEntry("/${ProjName}/src-gen", ICSettingEntry.LOCAL));
+ srcIncludes.add(new CIncludePathEntry("${workspace_loc:/${ProjName}/src-gen}", ICSettingEntry.LOCAL));
+ if (isCopyRuntime()) {
+ srcIncludes.add(new CIncludePathEntry("${workspace_loc:/${ProjName}/"+C_RUNTIME_FOLDER_NAME+"/src/common}", ICSettingEntry.LOCAL));
+ srcIncludes.add(new CIncludePathEntry("${workspace_loc:/${ProjName}/"+C_RUNTIME_FOLDER_NAME+"/src/config}", ICSettingEntry.LOCAL));
+ srcIncludes.add(new CIncludePathEntry("${workspace_loc:/${ProjName}/"+C_RUNTIME_FOLDER_NAME+"/src/util}", ICSettingEntry.LOCAL));
+ srcIncludes.add(new CIncludePathEntry("${workspace_loc:/${ProjName}/"+C_RUNTIME_FOLDER_NAME+"/src/platforms/"+getPlatform()+"}", ICSettingEntry.LOCAL));
+ }
return srcIncludes;
}
@@ -72,14 +98,19 @@ public class CProjectConfigurator extends ProjectConfigurator {
@Override
public Map<String, String> getProjectRefInfo(ICConfigurationDescription configDescription, String toolChain) {
Map<String, String> projectRefInfo = configDescription.getReferenceInfo();
- if (toolChain == MINGW_TOOLCHAIN) {
- projectRefInfo.put("org.eclipse.etrice.runtime.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919");
- projectRefInfo.put("org.eclipse.etrice.modellib.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.847049798");
- }
- else if (toolChain == POSIX_TOOLCHAIN) {
- projectRefInfo.put("org.eclipse.etrice.runtime.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052");
- projectRefInfo.put("org.eclipse.etrice.modellib.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.847049798.58778989");
+
+ // need to configure these dependencies only if we don't copy the runtime
+ if (!isCopyRuntime()) {
+ if (toolChain == MINGW_TOOLCHAIN) {
+ projectRefInfo.put("org.eclipse.etrice.runtime.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919");
+ projectRefInfo.put("org.eclipse.etrice.modellib.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.847049798");
+ }
+ else if (toolChain == POSIX_TOOLCHAIN) {
+ projectRefInfo.put("org.eclipse.etrice.runtime.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052");
+ projectRefInfo.put("org.eclipse.etrice.modellib.c", "cdt.managedbuild.config.gnu.mingw.lib.debug.847049798.58778989");
+ }
}
+
return projectRefInfo;
}
@@ -98,12 +129,20 @@ public class CProjectConfigurator extends ProjectConfigurator {
* org.eclipse.core.runtime.IProgressMonitor, java.lang.String)
*/
@Override
- public void copyRuntime(IProject project, IProgressMonitor progressMonitor,
- String platform) {
+ public void copyRuntime(IProject project, IProgressMonitor progressMonitor, String platform) {
+ copyCRuntime(project, progressMonitor);
+ copyCModellib(project, progressMonitor);
+ }
+
+ /**
+ * @param project
+ * @param progressMonitor
+ */
+ private void copyCRuntime(IProject project, IProgressMonitor progressMonitor) {
ImportOperation importOperation = null;
ZipFile zipFile = null;
try {
- zipFile = WizardHelpers.getRuntimeZip();
+ zipFile = WizardHelpers.getCRuntimeZip();
if (zipFile != null) {
ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(zipFile);
List<?> children = structureProvider.getChildren(structureProvider.getRoot());
@@ -118,7 +157,7 @@ public class CProjectConfigurator extends ProjectConfigurator {
}
if (current!=null) {
importOperation = new ImportOperation(
- project.getFullPath().append("c-runtime-src"),
+ project.getFullPath().append(C_RUNTIME_FOLDER_NAME),
current,
structureProvider,
OVERWRITE_ALL_QUERY);
@@ -153,6 +192,87 @@ public class CProjectConfigurator extends ProjectConfigurator {
}
}
+ /**
+ * @param project
+ * @param progressMonitor
+ */
+ private void copyCModellib(IProject project, IProgressMonitor progressMonitor) {
+ ZipFile zipFile = null;
+ try {
+ zipFile = WizardHelpers.getCModellibZip();
+ if (zipFile != null) {
+ ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(zipFile);
+ List<?> children = structureProvider.getChildren(structureProvider.getRoot());
+ ZipEntry current = null;
+ for (Object child : children) {
+ if (child instanceof ZipEntry) {
+ if (((ZipEntry) child).getName().equals("model/")) {
+ current = (ZipEntry) child;
+ break;
+ }
+ }
+ }
+ if (current!=null) {
+ children = structureProvider.getChildren(current);
+ IPath modelFolderPath = getPath();
+ for (Object child : children) {
+ if (child instanceof ZipEntry) {
+ if (! ((ZipEntry) child).isDirectory()) {
+ ImportOperation importOperation = new ImportOperation(
+ modelFolderPath,
+ child,
+ structureProvider,
+ OVERWRITE_ALL_QUERY);
+ importOperation.setContext(null);
+ importOperation.run(new SubProgressMonitor(progressMonitor, 1));
+ }
+ }
+ }
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ final IContainer modelFolder = root.getFolder(modelFolderPath.append("model"));
+ final IPath newPath = modelFolder.getFullPath().removeLastSegments(1).append("c-modellib");
+
+ ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().createRule(modelFolder);
+ WorkspaceModifyOperation operation = new WorkspaceModifyOperation(rule) {
+
+ @Override
+ protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+
+ modelFolder.move(newPath, true, monitor);
+ }
+
+ };
+
+ try {
+ operation.run(progressMonitor);
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ finally {
+ if (zipFile != null) {
+ try {
+ zipFile.close();
+ } catch (IOException e) {
+ // Ignore.
+ }
+ }
+ }
+ }
+
protected ZipFile createZipFile(File file) {
try {
return new ZipFile(file);
@@ -163,4 +283,31 @@ public class CProjectConfigurator extends ProjectConfigurator {
}
return null;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.generator.ui.cdt.ProjectConfigurator#customizeBuildConfig(org.eclipse.cdt.managedbuilder.core.IConfiguration)
+ */
+ @Override
+ protected void customizeBuildConfig(IProject project, IConfiguration buildConfig) {
+ if (isCopyRuntime()) {
+ IFolder folder = project.getFolder(C_RUNTIME_FOLDER_NAME);
+ folder = folder.getFolder("src");
+ folder = folder.getFolder("platforms");
+ try {
+ // exclude from the build if this is a folder and not the selected platform
+ for (IResource member : folder.members()) {
+ if (member.getType()==IResource.FOLDER && !member.getName().equals(getPlatform())) {
+ IPath path = member.getProjectRelativePath();
+ IFolderInfo folderInfo = buildConfig.createFolderInfo(path);
+ if (folderInfo!=null) {
+ folderInfo.setExclude(true);
+ }
+ }
+ }
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java
index 3e7286a6f..d42ba2bb0 100644
--- a/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java
+++ b/plugins/org.eclipse.etrice.generator.ui.cdt/src/org/eclipse/etrice/generator/ui/cdt/ProjectConfigurator.java
@@ -37,34 +37,62 @@ public abstract class ProjectConfigurator implements IProjectConfigurator {
final static String MINGW_TOOLCHAIN = "MinGW GCC";
final static String POSIX_TOOLCHAIN = "Linux GCC";
+ private boolean copyRuntime;
+ private String platform;
+ private IPath path;
public ProjectConfigurator() {
}
- public abstract boolean isApplicable(IProject project);
- public abstract String getCompilerId();
- public abstract List<CIncludePathEntry> getIncludePaths();
- public abstract Map<String, String> getProjectRefInfo(ICConfigurationDescription configDescription, String toolChain);
- public abstract void copyRuntime(IProject project, IProgressMonitor progressMonitor, String platform);
+ protected abstract boolean isApplicable(IProject project);
+ protected abstract boolean isIncludePathId(String id);
+ protected abstract List<CIncludePathEntry> getIncludePaths();
+ protected abstract Map<String, String> getProjectRefInfo(ICConfigurationDescription configDescription, String toolChain);
+ protected abstract void copyRuntime(IProject project, IProgressMonitor progressMonitor, String platform);
+ protected abstract void customizeBuildConfig(IProject project, IConfiguration buildConfig);
@Override
- public void configure(IProject project, IProgressMonitor progressMonitor, boolean copyRuntime, String platform) {
+ public void configure(IProject project, IPath path, boolean copyRuntime, String platform, IProgressMonitor progressMonitor) {
+ this.copyRuntime = copyRuntime;
+ this.platform = platform;
+ this.path = path;
+
try {
- if (!isApplicable(project))
- return;
-
- if (copyRuntime) {
- copyRuntime(project, progressMonitor, platform);
+ if (isApplicable(project)) {
+ if (copyRuntime) {
+ copyRuntime(project, progressMonitor, platform);
+ }
+
+ configureIncludesAndLibraries(project, progressMonitor);
}
-
- configureIncludesAndLibraries(project, progressMonitor);
}
catch (CoreException e) {
e.printStackTrace();
}
}
- public void configureIncludesAndLibraries(IProject project, IProgressMonitor progressMonitor) throws CoreException {
+ /**
+ * @return the path
+ */
+ protected IPath getPath() {
+ return path;
+ }
+
+ /**
+ * @return the platform
+ */
+ protected String getPlatform() {
+ return platform;
+ }
+
+ /**
+ * @return the copyRuntime
+ */
+ protected boolean isCopyRuntime() {
+ return copyRuntime;
+ }
+
+ protected void configureIncludesAndLibraries(IProject project, IProgressMonitor progressMonitor) throws CoreException {
ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project, true);
@@ -82,7 +110,7 @@ public abstract class ProjectConfigurator implements IProjectConfigurator {
for (ICConfigurationDescription configDescription : projectDescription.getConfigurations()) {
if (configDescription.getId() == null)
continue;
-
+
IConfiguration buildConfig = ManagedBuildManager.getConfigurationForDescription(configDescription);
String toolChain = "";
if (MINGW_TOOLCHAIN.equals(buildConfig.getToolChain().getName()))
@@ -94,6 +122,8 @@ public abstract class ProjectConfigurator implements IProjectConfigurator {
if (folderInfo!=null) {
folderInfo.setExclude(true);
}
+
+ customizeBuildConfig(project, buildConfig);
// set project references
/*
@@ -111,7 +141,7 @@ public abstract class ProjectConfigurator implements IProjectConfigurator {
continue;
// set source includes
- if (setting.getId().startsWith(getCompilerId())) {
+ if (isIncludePathId(setting.getId())) {
addSettings(setting, ICSettingEntry.INCLUDE_PATH, getIncludePaths());
}
@@ -133,93 +163,6 @@ public abstract class ProjectConfigurator implements IProjectConfigurator {
CoreModel.getDefault().setProjectDescription(project, projectDescription);
}
- // public static void addIncludePathsAndLibraries(IProject project)
- // throws CoreException {
- // if (!project.hasNature("org.eclipse.cdt.core.cnature"))
- // return;
- //
- // IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // IProject runtime = workspace.getRoot().getProject(
- // "org.eclipse.etrice.runtime.c");
- // IFolder common = runtime.getFolder("src/common");
- // IFolder config = runtime.getFolder("src/config");
- // IFolder posix = runtime.getFolder("src/platforms/MT_POSIX_GENERIC_GCC");
- // IFolder mingw = runtime.getFolder("src/platforms/MT_WIN_MinGW");
- // IFolder src_gen = project.getFolder("src-gen");
- // IFolder mingw_debug = project.getFolder("MinGWDebug");
- // IFolder mingw_release = project.getFolder("MinGWRelease");
- // IFolder posix_debug = project.getFolder("PosixDebug");
- // IFolder posix_release = project.getFolder("PosixRelease");
- //
- // ICProjectDescription projectDescription = CoreModel.getDefault()
- // .getProjectDescription(project, true);
- // ICConfigurationDescription configDecriptions[] = projectDescription
- // .getConfigurations();
- //
- // for (ICConfigurationDescription configDescription : configDecriptions) {
- // ICFolderDescription projectRoot = configDescription
- // .getRootFolderDescription();
- // ICLanguageSetting[] settings = projectRoot.getLanguageSettings();
- // for (ICLanguageSetting setting : settings) {
- // if (!"org.eclipse.cdt.core.gcc".equals(setting.getLanguageId())) {
- // continue;
- // }
- //
- // ICTargetPlatformSetting tgt = configDescription
- // .getTargetPlatformSetting();
- // String id = tgt.getId();
- //
- // ArrayList<ICLanguageSettingEntry> includes = new
- // ArrayList<ICLanguageSettingEntry>();
- // includes.add(new CIncludePathEntry(src_gen,
- // ICSettingEntry.LOCAL));
- // includes.add(new CIncludePathEntry(common, ICSettingEntry.LOCAL));
- // includes.add(new CIncludePathEntry(config, ICSettingEntry.LOCAL));
- // if (id.startsWith("cdt.managedbuild.target.gnu.platform.mingw.exe")) {
- // includes.add(new CIncludePathEntry(mingw,
- // ICSettingEntry.LOCAL));
- // } else if (id
- // .startsWith("cdt.managedbuild.target.gnu.platform.posix.exe")) {
- // includes.add(new CIncludePathEntry(posix,
- // ICSettingEntry.LOCAL));
- // }
- // addSettings(setting, ICSettingEntry.INCLUDE_PATH, includes);
- //
- // List<? extends ICLanguageSettingEntry> libPaths = null;
- // if
- // (id.startsWith("cdt.managedbuild.target.gnu.platform.mingw.exe.debug")) {
- // libPaths = Collections.singletonList(new CLibraryPathEntry(
- // mingw_debug, ICSettingEntry.LOCAL));
- // } else if (id
- // .startsWith("cdt.managedbuild.target.gnu.platform.mingw.exe.release")) {
- // libPaths = Collections.singletonList(new CLibraryPathEntry(
- // mingw_release, ICSettingEntry.LOCAL));
- // } else if (id
- // .startsWith("cdt.managedbuild.target.gnu.platform.posix.exe.debug")) {
- // libPaths = Collections.singletonList(new CLibraryPathEntry(
- // posix_debug, ICSettingEntry.LOCAL));
- // } else if (id
- // .startsWith("cdt.managedbuild.target.gnu.platform.posix.exe.release")) {
- // libPaths = Collections.singletonList(new CLibraryPathEntry(
- // posix_release, ICSettingEntry.LOCAL));
- // }
- // if (libPaths != null)
- // addSettings(setting, ICSettingEntry.LIBRARY_PATH, libPaths);
- //
- // List<? extends ICLanguageSettingEntry> libs = Collections
- // .singletonList(new CLibraryFileEntry(
- // "org.eclipse.etrice.runtime.c", 0));
- // addSettings(setting, ICSettingEntry.LIBRARY_FILE, libs);
- // }
- // }
- // try {
- // CoreModel.getDefault().setProjectDescription(project,
- // projectDescription);
- // } catch (CoreException e) {
- // e.printStackTrace();
- // }
- // }
-
/**
* Appends entries at the end, preserves order, prevents new duplicates.
*/
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java
index 8b8a6948c..8b8a2fd36 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/IProjectConfigurator.java
@@ -13,6 +13,7 @@
package org.eclipse.etrice.generator.ui.configurator;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.etrice.generator.ui.wizard.NewSetOfModelsWizard;
@@ -31,5 +32,5 @@ public interface IProjectConfigurator {
* @param copyRuntime <code>true</code> if runtime should be copied into the project
* @param platform the name of the chosen platform (others will be excluded from the build)
*/
- void configure(IProject project, IProgressMonitor progressMonitor, boolean copyRuntime, String platform);
+ void configure(IProject project, IPath path, boolean copyRuntime, String platform, IProgressMonitor progressMonitor);
}
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java
index 9b47e2e87..f2cd7cb13 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/configurator/ProjectConfigurationDelegator.java
@@ -19,6 +19,7 @@ import java.util.Map.Entry;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.etrice.generator.ui.wizard.NewSetOfModelsWizard;
@@ -90,12 +91,12 @@ public class ProjectConfigurationDelegator implements IProjectConfigurator {
* @see org.eclipse.etrice.generator.ui.configurator.IProjectConfigurator#configure(org.eclipse.core.resources.IProject)
*/
@Override
- public void configure(IProject project, IProgressMonitor progressMonitor, boolean copyRuntime, String platform) {
+ public void configure(IProject project, IPath path, boolean copyRuntime, String platform, IProgressMonitor progressMonitor) {
for (Entry<String, ArrayList<IProjectConfigurator>> entry : nature2configurators.entrySet()) {
try {
if (project.hasNature(entry.getKey())) {
for (IProjectConfigurator configurator : entry.getValue()) {
- configurator.configure(project, progressMonitor, copyRuntime, platform);
+ configurator.configure(project, path, copyRuntime, platform, progressMonitor);
}
}
} catch (CoreException e) {
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java
index 9f1dae7bc..dd7a003e3 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/NewSetOfModelsWizard.java
@@ -115,9 +115,10 @@ public class NewSetOfModelsWizard extends Wizard implements INewWizard {
ProjectConfigurationDelegator.getInstance().configure(
project,
- progressMonitor,
+ modelPage.getPath(),
optionsPage.getCopyRuntime(),
- optionsPage.getPlatform());
+ optionsPage.getPlatform(),
+ progressMonitor);
} catch (Exception e) {
Logger.getLogger(getClass()).error(e.getMessage(), e);
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java
index fa3e2c649..e4bcbc87d 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/WizardHelpers.java
@@ -30,7 +30,15 @@ import org.eclipse.emf.common.util.URI;
*/
public class WizardHelpers {
- public static ZipFile getRuntimeZip() {
+ public static ZipFile getCRuntimeZip() {
+ return getExampleZip("org.eclipse.etrice.runtime.c");
+ }
+
+ public static ZipFile getCModellibZip() {
+ return getExampleZip("org.eclipse.etrice.modellib.c");
+ }
+
+ private static ZipFile getExampleZip(String name) {
ZipFile zipFile = null;
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
@@ -46,7 +54,7 @@ public class WizardHelpers {
String projectName = projectDescriptorElement
.getAttribute("name");
if (projectName != null
- && projectName.equals("org.eclipse.etrice.runtime.c")) {
+ && projectName.equals(name)) {
String contentURI = projectDescriptorElement
.getAttribute("contentURI");
if (contentURI != null) {
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java
index 01a93a957..4714dfd7c 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/internal/COptionsPage.java
@@ -64,7 +64,7 @@ public class COptionsPage extends WizardPage {
buttonComposite.setLayout(new GridLayout(2, false));
copyRuntimeButton = new Button(buttonComposite, SWT.CHECK);
- copyRuntimeButton.setText("Copy C-Runtime into project");
+ copyRuntimeButton.setText("&Copy C-Runtime into project");
copyRuntimeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -130,7 +130,7 @@ public class COptionsPage extends WizardPage {
private List<String> getPlatformNames() {
List<String> result = new ArrayList<String>();
- ZipFile zipFile = WizardHelpers.getRuntimeZip();
+ ZipFile zipFile = WizardHelpers.getCRuntimeZip();
if (zipFile != null) {
ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(zipFile);
List<?> children = structureProvider.getChildren(structureProvider.getRoot());
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
index 02918d8e8..6338b22d2 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/support/HelpFeature.java
@@ -4,14 +4,17 @@
* 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:
* Juergen Haug (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.ui.common.base.support;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.doc.ContextHelpProvider;
import org.eclipse.etrice.ui.common.base.BaseImageProvider;
@@ -19,6 +22,7 @@ import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.ICustomContext;
import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
+import org.eclipse.ui.progress.UIJob;
public class HelpFeature extends AbstractCustomFeature {
@@ -59,8 +63,17 @@ public class HelpFeature extends AbstractCustomFeature {
}
@Override
- public void execute(ICustomContext context) {
- ContextHelpProvider.showHelp(getBoClassName(((ICustomContext) context).getPictogramElements()[0]));
+ public void execute(final ICustomContext context) {
+ UIJob job = new UIJob("Show Context Help"){
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ ContextHelpProvider.showHelp(getBoClassName(((ICustomContext) context).getPictogramElements()[0]));
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
}
@Override
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/StructureClassSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/StructureClassSupport.java
index 95bbe856f..17804780d 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/StructureClassSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/StructureClassSupport.java
@@ -4,10 +4,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:
* Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.ui.structure.support;
@@ -69,9 +69,9 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
public class StructureClassSupport {
-
+
public static final int MARGIN = 40;
-
+
private static final int LINE_WIDTH = 4;
public static final int DEFAULT_SIZE_X = 800;
public static final int DEFAULT_SIZE_Y = 500;
@@ -79,13 +79,13 @@ public class StructureClassSupport {
private static final IColorConstant BACKGROUND = new ColorConstant(255, 255, 255);
private class FeatureProvider extends DefaultFeatureProvider {
-
+
private class AddFeature extends AbstractAddFeature {
-
+
public AddFeature(IFeatureProvider fp) {
super(fp);
}
-
+
@Override
public boolean canAdd(IAddContext context) {
if (context.getNewObject() instanceof StructureClass) {
@@ -95,24 +95,24 @@ public class StructureClassSupport {
}
return false;
}
-
+
@Override
public PictogramElement add(IAddContext context) {
StructureClass ac = (StructureClass) context.getNewObject();
Diagram diag = (Diagram) context.getTargetContainer();
-
+
// CONTAINER SHAPE WITH RECTANGLE
IPeCreateService peCreateService = Graphiti.getPeCreateService();
ContainerShape containerShape =
peCreateService.createContainerShape(diag, true);
-
+
Graphiti.getPeService().setPropertyValue(containerShape, Constants.TYPE_KEY, Constants.CLS_TYPE);
// check whether the context has a size (e.g. from a create feature)
// otherwise define a default size for the shape
int width = context.getWidth() <= 0 ? DEFAULT_SIZE_X : context.getWidth();
int height = context.getHeight() <= 0 ? DEFAULT_SIZE_Y : context.getHeight();
-
+
{
IGaService gaService = Graphiti.getGaService();
@@ -120,10 +120,10 @@ public class StructureClassSupport {
// the width needed for the ports
Rectangle invisibleRectangle =
gaService.createInvisibleRectangle(containerShape);
-
+
gaService.setLocationAndSize(invisibleRectangle,
context.getX(), context.getY(), width + 2*MARGIN, height + 2*MARGIN);
-
+
// create and set visible rectangle inside invisible rectangle
// transparent first
Rectangle rect = gaService.createRectangle(invisibleRectangle);
@@ -138,65 +138,65 @@ public class StructureClassSupport {
rect.setFilled(false);
rect.setLineWidth(LINE_WIDTH);
gaService.setLocationAndSize(rect, MARGIN, MARGIN, width, height);
-
+
// create link and wire it
link(containerShape, ac);
link(getDiagram(), ac);
}
-
+
// call the layout feature
layoutPictogramElement(containerShape);
-
+
return containerShape;
-
+
}
-
+
}
-
+
private class LayoutFeature extends AbstractLayoutFeature {
-
+
private static final int MIN_HEIGHT = 100;
private static final int MIN_WIDTH = 250;
-
+
public LayoutFeature(IFeatureProvider fp) {
super(fp);
}
-
+
@Override
public boolean canLayout(ILayoutContext context) {
// return true, if pictogram element is linked to an ActorClass
PictogramElement pe = context.getPictogramElement();
if (!(pe instanceof ContainerShape))
return false;
-
+
EList<EObject> businessObjects = pe.getLink().getBusinessObjects();
return businessObjects.size() == 1
&& businessObjects.get(0) instanceof StructureClass;
}
-
+
@Override
public boolean layout(ILayoutContext context) {
boolean anythingChanged = false;
ContainerShape containerShape = (ContainerShape) context
.getPictogramElement();
-
+
GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
-
+
// height
if (containerGa.getHeight() < MIN_HEIGHT) {
containerGa.setHeight(MIN_HEIGHT);
anythingChanged = true;
}
-
+
// width
if (containerGa.getWidth() < MIN_WIDTH) {
containerGa.setWidth(MIN_WIDTH);
anythingChanged = true;
}
-
+
int w = containerGa.getWidth();
int h = containerGa.getHeight();
-
+
if (containerGa.getGraphicsAlgorithmChildren().size()==2) {
GraphicsAlgorithm ga = containerGa.getGraphicsAlgorithmChildren().get(0);
ga.setWidth(w-2*MARGIN);
@@ -206,12 +206,12 @@ public class StructureClassSupport {
ga.setHeight(h-2*MARGIN);
anythingChanged = true;
}
-
+
return anythingChanged;
}
-
+
}
-
+
private class OpenBehaviorDiagram extends AbstractCustomFeature {
public OpenBehaviorDiagram(IFeatureProvider fp) {
@@ -222,7 +222,7 @@ public class StructureClassSupport {
public String getName() {
return "Open Class Behavior";
}
-
+
@Override
public boolean canExecute(ICustomContext context) {
PictogramElement[] pes = context.getPictogramElements();
@@ -256,13 +256,13 @@ public class StructureClassSupport {
}
}
}
-
+
@Override
public boolean hasDoneChanges() {
return false;
}
}
-
+
private class ReconnectToModel extends AbstractCustomFeature {
public ReconnectToModel(IFeatureProvider fp) {
@@ -272,43 +272,43 @@ public class StructureClassSupport {
@Override
public void execute(ICustomContext context) {
DiagramEditorBase editor = (DiagramEditorBase) getDiagramBehavior().getDiagramContainer();
-
- Job job = new ChangeDiagramInputJob("blub", editor);
+
+ Job job = new ChangeDiagramInputJob("Change input for " + getDiagram().getName(), editor);
job.setUser(true);
job.schedule();
}
-
+
@Override
public boolean canExecute(ICustomContext context) {
return true;
}
-
+
@Override
public String getName() {
return "Reconnect Diagram to Model";
}
-
-
-
+
+
+
@Override
public boolean hasDoneChanges() {
return false;
}
-
+
@Override
public boolean isAvailable(IContext context) {
Object bo = fp.getBusinessObjectForPictogramElement(getDiagram());
-
+
return bo instanceof EObject && ((EObject)bo).eIsProxy();
}
}
-
+
private class ResizeFeature extends DefaultResizeShapeFeature{
public ResizeFeature(IFeatureProvider fp) {
super(fp);
}
-
+
@Override
public boolean canResizeShape(IResizeShapeContext context) {
if (!super.canResizeShape(context))
@@ -323,7 +323,7 @@ public class StructureClassSupport {
for (Shape childShape : containerShape.getChildren()) {
if (isOnInterface(sc, getBusinessObjectForPictogramElement(childShape)))
continue;
-
+
GraphicsAlgorithm ga = childShape.getGraphicsAlgorithm();
int x = ga.getX()+ga.getWidth()-ActorContainerRefSupport.MARGIN;
int y = ga.getY()+ga.getHeight()-ActorContainerRefSupport.MARGIN;
@@ -336,15 +336,15 @@ public class StructureClassSupport {
return false;
if (height>0 && height<ymax)
return false;
-
+
return true;
}
-
+
@Override
public void resizeShape(IResizeShapeContext context) {
ContainerShape containerShape = (ContainerShape) context.getShape();
StructureClass sc = (StructureClass) getBusinessObjectForPictogramElement(containerShape);
-
+
if (containerShape.getGraphicsAlgorithm()!=null) {
GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
if (containerGa.getGraphicsAlgorithmChildren().size()==2) {
@@ -354,7 +354,7 @@ public class StructureClassSupport {
GraphicsAlgorithm ga = containerGa.getGraphicsAlgorithmChildren().get(0);
double sx = (context.getWidth()-2*MARGIN)/(double)ga.getWidth();
double sy = (context.getHeight()-2*MARGIN)/(double)ga.getHeight();
-
+
for (Shape childShape : containerShape.getChildren()) {
if (isOnInterface(sc, getBusinessObjectForPictogramElement(childShape))) {
ga = childShape.getGraphicsAlgorithm();
@@ -372,7 +372,7 @@ public class StructureClassSupport {
if (childBo instanceof InterfaceItem) {
// in general InterfaceItem sit on the interface...
onInterface = true;
-
+
// ...with the exception of internal end ports
if (childBo instanceof Port) {
if (sc instanceof ActorClass) {
@@ -384,58 +384,58 @@ public class StructureClassSupport {
return onInterface;
}
}
-
+
private class DeleteFeature extends DeleteWithoutConfirmFeature {
public DeleteFeature(IFeatureProvider fp) {
super(fp);
}
-
+
@Override
public boolean canDelete(IDeleteContext context) {
return false;
}
}
-
+
private IFeatureProvider fp;
-
+
public FeatureProvider(IDiagramTypeProvider dtp, IFeatureProvider fp) {
super(dtp);
this.fp = fp;
}
-
+
@Override
public IAddFeature getAddFeature(IAddContext context) {
return new AddFeature(fp);
}
-
+
@Override
public ILayoutFeature getLayoutFeature(ILayoutContext context) {
return new LayoutFeature(fp);
}
-
+
@Override
public IUpdateFeature getUpdateFeature(IUpdateContext context) {
return new StructureClassUpdate(fp);
}
-
+
@Override
public ICustomFeature[] getCustomFeatures(ICustomContext context) {
return new ICustomFeature[] {
new OpenBehaviorDiagram(fp), new ReconnectToModel(fp)};
}
-
+
@Override
public IResizeShapeFeature getResizeShapeFeature(
IResizeShapeContext context) {
return new ResizeFeature(fp);
}
-
+
@Override
public IRemoveFeature getRemoveFeature(IRemoveContext context) {
return new CantRemoveFeature(fp);
}
-
+
@Override
public IDeleteFeature getDeleteFeature(IDeleteContext context) {
return new DeleteFeature(fp);
@@ -447,7 +447,7 @@ public class StructureClassSupport {
public BehaviorProvider(IDiagramTypeProvider dtp) {
super(dtp);
}
-
+
@Override
public GraphicsAlgorithm[] getClickArea(PictogramElement pe) {
GraphicsAlgorithm invisible = pe.getGraphicsAlgorithm();
@@ -455,7 +455,7 @@ public class StructureClassSupport {
invisible.getGraphicsAlgorithmChildren().get(0);
return new GraphicsAlgorithm[] { rectangle };
}
-
+
@Override
public GraphicsAlgorithm getSelectionBorder(PictogramElement pe) {
GraphicsAlgorithm invisible = pe.getGraphicsAlgorithm();
@@ -464,12 +464,12 @@ public class StructureClassSupport {
invisible.getGraphicsAlgorithmChildren().get(1);
return rectangle;
}
-
+
@Override
public IContextButtonPadData getContextButtonPad(
IPictogramElementContext context) {
IContextButtonPadData data = super.getContextButtonPad(context);
-
+
ICustomContext customContext = new CustomContext();
ICustomFeature reconnectToModel = afp.getCustomFeatures(customContext)[1];
if(reconnectToModel.isAvailable(customContext)){
@@ -477,23 +477,23 @@ public class StructureClassSupport {
entry.setIconId(IPlatformImageConstants.IMG_ECLIPSE_QUICKASSIST);
data.getDomainSpecificContextButtons().add(entry);
}
-
+
return data;
}
}
private FeatureProvider afp;
private BehaviorProvider tbp;
-
+
public StructureClassSupport(IDiagramTypeProvider dtp, IFeatureProvider fp) {
afp = new FeatureProvider(dtp, fp);
tbp = new BehaviorProvider(dtp);
}
-
+
public IFeatureProvider getFeatureProvider() {
return afp;
}
-
+
public IToolBehaviorProvider getToolBehaviorProvider() {
return tbp;
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
index 9f41aea52..d9e5df646 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
- * 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:
- * Peter Karlitschek (initial contribution)
- *
- *******************************************************************************/
-
-#include "common/messaging/Message.h"
-#include <iostream>
-#include <string>
-#include <cstring>
-#include <cstdlib>
-
-namespace etRuntime {
-
-Message::Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize) :
- m_address(addr),
- m_evtId(evtId),
- m_next(0),
- m_dataSize(0),
- m_data(0){
- if(dataToCopy != 0 && dataSize > 0){
- m_data = std::malloc(dataSize);
- if(m_data != 0){
- m_dataSize = dataSize;
- std::memcpy(m_data, dataToCopy, dataSize);
- }
- }
-}
-Message::Message(const Address& addr, int evtId, void* dataPtr) :
- m_address(addr),
- m_evtId(evtId),
- m_next(0),
- m_dataSize(0),
- m_data(dataPtr) {
-}
-Message::Message(const Address& addr, int evtId) :
- m_address(addr),
- m_evtId(evtId),
- m_next(0),
- m_dataSize(0),
- m_data(0) {
-}
-Message::~Message() {
- m_evtId = 0;
- m_next = 0;
- if(m_dataSize > 0)
- std::free(m_data);
- m_data = 0;
- m_dataSize = 0;
-}
-
-std::string Message::toString() const {
- std::stringstream strm;
- strm << "Message(" << m_address.toID() << ", evt=" << m_evtId << ")";
- if (m_data) {
- strm << std::showbase << std::hex << m_data;
- }
- return strm.str();
-}
-
-} /* namespace etRuntime */
+/*******************************************************************************
+ * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
+ * 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:
+ * Peter Karlitschek (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "common/messaging/Message.h"
+#include <iostream>
+#include <string>
+#include <cstring>
+#include <cstdlib>
+
+namespace etRuntime {
+
+Message::Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(0){
+ if(dataToCopy != 0 && dataSize > 0){
+ m_data = std::malloc(dataSize);
+ if(m_data != 0){
+ m_dataSize = dataSize;
+ std::memcpy(m_data, dataToCopy, dataSize);
+ }
+ }
+}
+Message::Message(const Address& addr, int evtId, void* dataPtr) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(dataPtr) {
+}
+Message::Message(const Address& addr, int evtId) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(0) {
+}
+Message::~Message() {
+ m_evtId = 0;
+ m_next = 0;
+ if(m_dataSize > 0)
+ std::free(m_data);
+ m_data = 0;
+ m_dataSize = 0;
+}
+
+std::string Message::toString() const {
+ std::stringstream strm;
+ strm << "Message(" << m_address.toID() << ", evt=" << m_evtId << ")";
+ if (m_data) {
+ strm << std::showbase << std::hex << m_data;
+ }
+ return strm.str();
+}
+
+} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
index ad1f064cc..b97802808 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
- * 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:
- * Peter Karlitschek (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef MESSAGE_H_
-#define MESSAGE_H_
-
-#include "common/messaging/Address.h"
-#include "stddef.h"
-#include <iostream>
-#include <sstream>
-#include <string>
-
-namespace etRuntime {
-
-class Message {
-
-public:
-
- // Messages with data TODO MessageBuffer
- Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize);
- Message(const Address& addr, int evtId, void* dataPtr);
-
- Message(const Address& addr, int evtId);
- ~Message();
-
- const Address& getAddress() const {
- return m_address;
- }
-
- int getEvtId() const {
- return m_evtId;
- }
-
- /** Pointer to data */
- void* getData() const {
- return m_data;
- }
-
- std::string toString() const;
-
-protected:
- friend class MessageSeQueue;
-
- void setNext(Message* msg) {
- m_next = msg;
- }
-
- Message* getNext() const {
- return m_next;
- }
-
-private:
- Address m_address;
- int m_evtId;
-
- Message* m_next;
- size_t m_dataSize;
- void* m_data;
-
- Message();
- Message(Message const&);
- Message& operator =(Message const&);
-
-};
-
-} /* namespace etRuntime */
-#endif /* MESSAGE_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
+ * 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:
+ * Peter Karlitschek (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef MESSAGE_H_
+#define MESSAGE_H_
+
+#include "common/messaging/Address.h"
+#include "stddef.h"
+#include <iostream>
+#include <sstream>
+#include <string>
+
+namespace etRuntime {
+
+class Message {
+
+public:
+
+ // Messages with data TODO MessageBuffer
+ Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize);
+ Message(const Address& addr, int evtId, void* dataPtr);
+
+ Message(const Address& addr, int evtId);
+ ~Message();
+
+ const Address& getAddress() const {
+ return m_address;
+ }
+
+ int getEvtId() const {
+ return m_evtId;
+ }
+
+ /** Pointer to data */
+ void* getData() const {
+ return m_data;
+ }
+
+ std::string toString() const;
+
+protected:
+ friend class MessageSeQueue;
+
+ void setNext(Message* msg) {
+ m_next = msg;
+ }
+
+ Message* getNext() const {
+ return m_next;
+ }
+
+private:
+ Address m_address;
+ int m_evtId;
+
+ Message* m_next;
+ size_t m_dataSize;
+ void* m_data;
+
+ Message();
+ Message(Message const&);
+ Message& operator =(Message const&);
+
+};
+
+} /* namespace etRuntime */
+#endif /* MESSAGE_H_ */
diff --git a/tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF
index b70fa5775..514f3fdf4 100644
--- a/tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF
@@ -10,7 +10,6 @@ Require-Bundle: org.eclipse.etrice.core.config;bundle-version="0.5.0",
org.eclipse.core.runtime,
org.eclipse.xtext;bundle-version="2.6.0",
org.eclipse.xtext.junit4;bundle-version="2.6.0",
- org.eclipse.xtext.ui.junit;bundle-version="2.6.0",
org.junit,
org.eclipse.ui.workbench;resolution:=optional
Import-Package: org.apache.log4j,
diff --git a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtDatatypes.h b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtDatatypes.h
index abe06201a..8cef5758c 100644
--- a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtDatatypes.h
+++ b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtDatatypes.h
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * Copyright (c) 2015 protos software gmbh (http://www.protos.de).
- * 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:
- * Juergen Haug (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _TESTETDATATYPES_H_
-#define _TESTETDATATYPES_H_
-
-#include "etDatatypes.h"
-
-void TestEtDatatypes_runSuite(void);
-
-#endif /* _TESTETDATATYPES_H_ */
+/*******************************************************************************
+ * Copyright (c) 2015 protos software gmbh (http://www.protos.de).
+ * 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _TESTETDATATYPES_H_
+#define _TESTETDATATYPES_H_
+
+#include "etDatatypes.h"
+
+void TestEtDatatypes_runSuite(void);
+
+#endif /* _TESTETDATATYPES_H_ */

Back to the top