| 1 | /** |
| 2 | * |
| 3 | */ |
| 4 | package de.uka.ipd.sdq.cip.runtime.dialogs; |
| 5 | |
| 6 | import org.eclipse.jface.dialogs.TitleAreaDialog; |
| 7 | import org.eclipse.swt.SWT; |
| 8 | import org.eclipse.swt.widgets.Composite; |
| 9 | import org.eclipse.swt.widgets.Control; |
| 10 | import org.eclipse.swt.widgets.Shell; |
| 11 | |
| 12 | import de.uka.ipd.sdq.cip.configuration.Transformation; |
| 13 | |
| 14 | /** |
| 15 | * @author thomass |
| 16 | * |
| 17 | */ |
| 18 | public class EditCompletionDialog extends TitleAreaDialog { |
| 19 | |
| 20 | private CompletionConfigurationWidget completionConfigurationWidget = null; |
| 21 | |
| 22 | private Transformation transformation = null; |
| 23 | |
| 24 | public EditCompletionDialog(Shell parentShell, Transformation transformation) { |
| 25 | super(parentShell); |
| 26 | this.transformation = transformation; |
| 27 | completionConfigurationWidget = new CompletionConfigurationWidget(); |
| 28 | |
| 29 | setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | protected Control createDialogArea(Composite parent) { |
| 34 | |
| 35 | setTitle("Edit completion"); |
| 36 | setMessage("Edit one completion and change its config"); |
| 37 | |
| 38 | Composite mainComponent = (Composite) super.createDialogArea(parent); |
| 39 | |
| 40 | completionConfigurationWidget.createControl(mainComponent); |
| 41 | completionConfigurationWidget.setTransformation(transformation); |
| 42 | return mainComponent; |
| 43 | |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | protected void okPressed() { |
| 48 | completionConfigurationWidget.getTransformation(transformation); |
| 49 | super.okPressed(); |
| 50 | } |
| 51 | } |