Commit e55c4def authored by Eyrak Paen-Rochlitz's avatar Eyrak Paen-Rochlitz
Browse files

Merge branch '47-include_images-option-is-missing-from-doc-gen-launcher-config-tab' into 'master'

Resolve "include_images option is missing from doc gen launcher config tab"

Closes #47

See merge request !14
parents 77e63a11 c81de2a4
Pipeline #3939 passed with stage
in 0 seconds
......@@ -14,11 +14,52 @@
package org.eclipse.etrice.generator.launch.doc;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.etrice.generator.launch.GeneratorConfigTab;
import org.eclipse.etrice.generator.ui.preferences.PreferenceConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
public class DocGeneratorConfigTab extends GeneratorConfigTab {
public static final String INCLUDE_IMAGES = "includeImages";
private Button includeImages;
@Override
protected void addFurtherControls(Composite mainComposite) {
super.addFurtherControls(mainComposite);
createSeparator(mainComposite, 2);
includeImages = createCheckButton(mainComposite, "include image links in document");
includeImages.setToolTipText("this option generates image links for behavior and structure diagrams and the instance tree diagram");
includeImages.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
includeImages.addSelectionListener(new UpdateConfig());
}
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
super.initializeFrom(configuration);
try {
includeImages.setSelection(configuration.getAttribute(INCLUDE_IMAGES, false));
} catch (CoreException e) {
e.printStackTrace();
}
}
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
super.performApply(configuration);
configuration.setAttribute(INCLUDE_IMAGES, includeImages.getSelection());
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
......
......@@ -16,6 +16,11 @@ package org.eclipse.etrice.generator.launch.doc;
import com.google.inject.Module;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.etrice.generator.base.args.Arguments;
import org.eclipse.etrice.generator.doc.setup.DocGeneratorOptions;
import org.eclipse.etrice.generator.doc.setup.GeneratorModule;
import org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate;
import org.eclipse.etrice.generator.ui.preferences.PreferenceConstants;
......@@ -28,6 +33,14 @@ public class DocGeneratorLaunchConfigurationDelegate extends GeneratorLaunchConf
return new GeneratorModule();
}
@Override
protected void configureArguments(Arguments args, ILaunchConfiguration configuration, IProject project) throws CoreException {
super.configureArguments(args, configuration, project);
boolean includeImages = configuration.getAttribute(DocGeneratorConfigTab.INCLUDE_IMAGES, false);
args.set(DocGeneratorOptions.INCLUDE_IMAGES, includeImages);
}
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#getConsoleName()
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment