Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2019-03-13 05:35:34 -0400
committerJan Belle2019-03-13 05:35:34 -0400
commit6ddba2137388e0833a0f8fe607f0e4146b78346e (patch)
treecec1b543043d03a2f7ac8926e152460274c69cdb
parentd26bec8b94967dba8f5011aa8f5c268018c4836e (diff)
downloadorg.eclipse.etrice-6ddba2137388e0833a0f8fe607f0e4146b78346e.tar.gz
org.eclipse.etrice-6ddba2137388e0833a0f8fe607f0e4146b78346e.tar.xz
org.eclipse.etrice-6ddba2137388e0833a0f8fe607f0e4146b78346e.zip
[ui] Fix genmodel file selection in generator run configuration
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java38
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java7
2 files changed, 5 insertions, 40 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 1eb87a754..f4f0476e1 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
@@ -16,7 +16,6 @@ package org.eclipse.etrice.generator.launch;
import org.eclipse.core.runtime.CoreException;
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;
@@ -33,7 +32,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
/**
@@ -76,7 +74,6 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
private Button libButton;
private Button saveGenModel;
private Text genModelPath;
- private Button browsePath;
private Button debugButton;
private Button mscButton;
private Button verboseButton;
@@ -120,6 +117,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
}
});
+ Label label = new Label(mainComposite, SWT.NONE);
+ label.setText("The file name for the generator model:");
genModelPath = new Text(mainComposite, SWT.SINGLE | SWT.BORDER);
genModelPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
genModelPath.addModifyListener(new ModifyListener() {
@@ -130,18 +129,6 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
updateLaunchConfigurationDialog();
}
});
- browsePath = createPushButton(mainComposite, "Browse...", null);
- //browsePath.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 1, 1));
- browsePath.addSelectionListener(new SelectionListener() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- handlePathButtonSelected();
- }
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- handlePathButtonSelected();
- }
- });
useTranslationButton = createCheckButton(mainComposite, "perform code translation");
useTranslationButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
@@ -167,7 +154,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
verboseButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
verboseButton.addSelectionListener(new UpdateConfig());
- Label label = new Label(mainComposite, SWT.NONE);
+ label = new Label(mainComposite, SWT.NONE);
label.setText("The main method name:");
mainMethodName = new Text(mainComposite, SWT.SINGLE | SWT.BORDER);
mainMethodName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -226,7 +213,6 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
protected void handleSaveGenModelSelected() {
boolean save = saveGenModel.getSelection();
genModelPath.setEnabled(save);
- browsePath.setEnabled(save);
validate();
setDirty(true);
updateLaunchConfigurationDialog();
@@ -256,23 +242,6 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
setErrorMessage(null);
}
- /**
- *
- */
- protected void handlePathButtonSelected() {
- SaveAsDialog dialog = new SaveAsDialog(getShell());
- dialog.setOriginalName("genmodel.rim");
- dialog.open();
- if(dialog.getResult() != null) {
- String fname = dialog.getResult().toString();
- String path = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", null) + fname;
- genModelPath.setText(path);
- setErrorMessage(null);
- setDirty(true);
- updateLaunchConfigurationDialog();
- }
- }
-
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@@ -291,7 +260,6 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
boolean save = configuration.getAttribute(SAVE_GEN_MODEL, false);
saveGenModel.setSelection(save);
genModelPath.setEnabled(save);
- browsePath.setEnabled(save);
genModelPath.setText(configuration.getAttribute(GEN_MODEL_PATH, ""));
mainMethodName.setText(configuration.getAttribute(MAIN_METHOD_NAME, AbstractGeneratorOptions.MAIN_NAME.getDefaultValue()));
debugButton.setSelection(configuration.getAttribute(DEBUG, false));
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 d6d78e6af..27c87e787 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
@@ -26,7 +26,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -187,15 +186,14 @@ public abstract class GeneratorLaunchConfigurationDelegate extends AbstractJavaL
* @throws CoreException
*/
protected void addArguments(ILaunchConfiguration configuration, IProject project, StringBuffer argString) throws CoreException {
+ String projectDir = project.getLocation().toString() + "/";
if (configuration.getAttribute(GeneratorConfigTab.LIB, false)) {
argString.append(" -"+AbstractGeneratorOptions.LIB.getName());
}
if (configuration.getAttribute(GeneratorConfigTab.SAVE_GEN_MODEL, false)) {
String genModelPath = configuration.getAttribute(GeneratorConfigTab.GEN_MODEL_PATH, "?");
- genModelPath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(genModelPath);
- String path = new Path(genModelPath).toOSString();
argString.append(" -"+AbstractGeneratorOptions.SAVE_GEN_MODEL.getName());
- argString.append(" "+path);
+ argString.append(" "+projectDir + genModelPath);
}
if (!configuration.getAttribute(GeneratorConfigTab.MAIN_METHOD_NAME, AbstractGeneratorOptions.MAIN_NAME.getDefaultValue()).equals(AbstractGeneratorOptions.MAIN_NAME.getDefaultValue())) {
argString.append(" -"+AbstractGeneratorOptions.MAIN_NAME.getName());
@@ -223,7 +221,6 @@ public abstract class GeneratorLaunchConfigurationDelegate extends AbstractJavaL
ScopedPreferenceStore prefStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.etrice.generator.ui");
- String projectDir = project.getLocation().toString() + "/";
boolean override = configuration.getAttribute(GeneratorConfigTab.OVERRIDE_DIRECTORIES, false);
String srcgenDir = prefStore.getString(PreferenceConstants.GEN_DIR);
if (override) {

Back to the top