Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2014-04-05 13:28:30 +0000
committerHenrik Rentz-Reichert2014-04-05 14:24:22 +0000
commit4cd2e58dfbd33bd964a845e066e82af9e770a083 (patch)
tree752e03227684223f137c281717df1f1a9176a7c4 /plugins/org.eclipse.etrice.generator.launch
parent7d7132b2595d7b4ca7719d1c17144ff0d6a6bd59 (diff)
downloadorg.eclipse.etrice-4cd2e58dfbd33bd964a845e066e82af9e770a083.tar.gz
org.eclipse.etrice-4cd2e58dfbd33bd964a845e066e82af9e770a083.tar.xz
org.eclipse.etrice-4cd2e58dfbd33bd964a845e066e82af9e770a083.zip
Bug 431754: add possibility to deactivate detail code translation for C generator
https://bugs.eclipse.org/431754 Change-Id: I0e68d4046ce9116b7cc27d917a00f8eefb753c18
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.launch')
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java14
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java3
2 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
index 5290b8dea..49318d5e3 100644
--- a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
@@ -15,10 +15,12 @@ package org.eclipse.etrice.generator.launch;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.etrice.generator.ui.preferences.PreferenceConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -30,6 +32,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
/**
* @author Henrik Rentz-Reichert
@@ -67,6 +70,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
public static final String DEBUG = "Debug";
public static final String MSC = "MSC";
public static final String VERBOSE = "Verbose";
+ public static final String USE_TRAANSLATION = "UseTranslation";
private Button libButton;
private Button documentationButton;
@@ -76,6 +80,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
private Button debugButton;
private Button mscButton;
private Button verboseButton;
+ private Button useTranslationButton;
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
@@ -135,6 +140,10 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
documentationButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
documentationButton.addSelectionListener(new UpdateConfig());
+ useTranslationButton = createCheckButton(mainComposite, "perform code translation");
+ useTranslationButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
+ useTranslationButton.addSelectionListener(new UpdateConfig());
+
debugButton = createCheckButton(mainComposite, "generate debug output");
debugButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
debugButton.addSelectionListener(new UpdateConfig());
@@ -229,6 +238,10 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
debugButton.setSelection(configuration.getAttribute(DEBUG, false));
mscButton.setSelection(configuration.getAttribute(MSC, true));
verboseButton.setSelection(configuration.getAttribute(VERBOSE, false));
+
+ ScopedPreferenceStore prefStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.etrice.generator.ui");
+ boolean useTranslation = prefStore.getBoolean(PreferenceConstants.GEN_USE_TRANSLATION);
+ useTranslationButton.setSelection(configuration.getAttribute(USE_TRAANSLATION, useTranslation));
}
catch (CoreException e) {
e.printStackTrace();
@@ -248,6 +261,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
configuration.setAttribute(DEBUG, debugButton.getSelection());
configuration.setAttribute(MSC, mscButton.getSelection());
configuration.setAttribute(VERBOSE, verboseButton.getSelection());
+ configuration.setAttribute(USE_TRAANSLATION, useTranslationButton.getSelection());
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java
index c245640b1..d41999e6c 100644
--- a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java
@@ -210,6 +210,9 @@ public abstract class GeneratorLaunchConfigurationDelegate extends AbstractJavaL
if (configuration.getAttribute(GeneratorConfigTab.VERBOSE, false)) {
argString.append(" "+AbstractGenerator.OPTION_VERBOSE_RT);
}
+ if (!configuration.getAttribute(GeneratorConfigTab.USE_TRAANSLATION, false)) {
+ argString.append(" "+AbstractGenerator.OPTION_NOTRANSLATE);
+ }
ScopedPreferenceStore prefStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.etrice.generator.ui");
if (prefStore.getBoolean(PreferenceConstants.GEN_INCREMENTAL)) {

Back to the top