Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6262acadf59651e0edc380e768a2a74afc08e3ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/*****************************************************************************
 * Copyright (c) 2010, 2014 CEA LIST and others.
 *
 *    
 * 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:
 *  Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
 *  Christian W. Damus (CEA) - bug 410346
 */
package org.eclipse.papyrus.uml.diagram.clazz.custom.ui;

import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ExpandBar;
import org.eclipse.swt.widgets.ExpandItem;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

/**
 * DO not modify manually, this class was generated by a visual editor
 * 
 */
public class AbstractTemplateParameterConfigurationDialog extends Dialog {

	protected Object result;

	protected Shell shlTemplateparameterconfiguration;

	protected Button choosePararameteredElementButton;

	protected CLabel parameteredElementLabel;

	protected CLabel parameteredElementContent;

	protected Button chooseDefaultParameterButton;

	protected CLabel defaultElementLabel;

	protected CLabel defaultElementContent;

	protected Button btnCancel;

	protected Button btnExecute;

	/**
	 * Create the dialog.
	 * 
	 * @param parent
	 * @param style
	 */
	public AbstractTemplateParameterConfigurationDialog(Shell parent, int style) {
		super(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
		setText("SWT Dialog");
	}

	public Button getBtnCancel() {
		return btnCancel;
	}

	public Button getBtnExecute() {
		return btnExecute;
	}

	/**
	 * Open the dialog.
	 * 
	 * @return the result
	 */
	public Object open() {
		createContents();
		shlTemplateparameterconfiguration.open();
		shlTemplateparameterconfiguration.layout();
		Display display = getParent().getDisplay();
		while(!shlTemplateparameterconfiguration.isDisposed()) {
			if(!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	protected void createContents() {
		Display display = Display.getCurrent();
		Rectangle rect = display.getBounds();
		shlTemplateparameterconfiguration = new Shell(getParent(), getStyle());
		shlTemplateparameterconfiguration.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		shlTemplateparameterconfiguration.setSize(426, 281);
		shlTemplateparameterconfiguration.setText("TemplateParameterConfiguration");
		shlTemplateparameterconfiguration.setLocation(new Point(rect.x + (rect.width / 2), rect.y + (rect.height / 2) - shlTemplateparameterconfiguration.getSize().y));
		Label lblCreationOfA = new Label(shlTemplateparameterconfiguration, SWT.NONE);
		lblCreationOfA.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
		FontData[] fontdatas = { new FontData("Tahoma", 12, SWT.BOLD) };
		lblCreationOfA.setFont(Activator.getFontManager().get(fontdatas));
		lblCreationOfA.setText("Creation of a new template parameter:");
		lblCreationOfA.setBounds(10, 10, 408, 28);
		ExpandBar expandBarRef = new ExpandBar(shlTemplateparameterconfiguration, SWT.NONE);
		expandBarRef.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		expandBarRef.setLocation(10, 43);
		expandBarRef.setSize(408, 70);
		ExpandItem xpndtmChooseYourParamter = new ExpandItem(expandBarRef, SWT.NONE);
		xpndtmChooseYourParamter.setExpanded(true);
		xpndtmChooseYourParamter.setText("Set the  paramatered element in the model");
		Composite composite_1 = new Composite(expandBarRef, SWT.NONE);
		composite_1.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		xpndtmChooseYourParamter.setControl(composite_1);
		choosePararameteredElementButton = new Button(composite_1, SWT.NONE);
		choosePararameteredElementButton.addSelectionListener(new SelectionAdapter() {

			@Override
			public void widgetSelected(SelectionEvent e) {
			}
		});
		choosePararameteredElementButton.setImage(Activator.getPluginIconImage("org.eclipse.papyrus.uml.icons", "resource/gif/Package.gif"));
		choosePararameteredElementButton.setBounds(322, 10, 68, 23);
		choosePararameteredElementButton.setText("...");
		parameteredElementLabel = new CLabel(composite_1, SWT.NONE);
		parameteredElementLabel.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		parameteredElementLabel.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
		parameteredElementLabel.setBounds(10, 10, 110, 19);
		parameteredElementLabel.setText("ParameteredElement:");
		parameteredElementContent = new CLabel(composite_1, SWT.NONE);
		parameteredElementContent.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		parameteredElementContent.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
		parameteredElementContent.setBounds(126, 10, 178, 19);
		parameteredElementContent.setText("New Label");
		xpndtmChooseYourParamter.setHeight(40);
		ExpandBar expandBarDefault = new ExpandBar(shlTemplateparameterconfiguration, SWT.NONE);
		expandBarDefault.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		expandBarDefault.setBounds(10, 120, 408, 70);
		ExpandItem xpndtmSetTheDefault = new ExpandItem(expandBarDefault, SWT.NONE);
		xpndtmSetTheDefault.setExpanded(true);
		xpndtmSetTheDefault.setText("Set the default element for this parameter");
		Composite composite = new Composite(expandBarDefault, SWT.NONE);
		composite.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		xpndtmSetTheDefault.setControl(composite);
		chooseDefaultParameterButton = new Button(composite, SWT.NONE);
		chooseDefaultParameterButton.setImage(Activator.getPluginIconImage("org.eclipse.papyrus.uml.icons", "resource/gif/Package.gif"));
		chooseDefaultParameterButton.setBounds(322, 10, 68, 23);
		chooseDefaultParameterButton.setText("...");
		defaultElementLabel = new CLabel(composite, SWT.NONE);
		defaultElementLabel.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		defaultElementLabel.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
		defaultElementLabel.setBounds(10, 10, 88, 19);
		defaultElementLabel.setText("DefaultElement:");
		defaultElementContent = new CLabel(composite, SWT.NONE);
		defaultElementContent.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		defaultElementContent.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
		defaultElementContent.setBounds(104, 10, 205, 19);
		defaultElementContent.setText("New Label");
		xpndtmSetTheDefault.setHeight(40);
		btnExecute = new Button(shlTemplateparameterconfiguration, SWT.NONE);
		btnExecute.setBounds(342, 216, 68, 23);
		btnExecute.setText("Execute");
		btnCancel = new Button(shlTemplateparameterconfiguration, SWT.NONE);
		btnCancel.setBounds(252, 216, 68, 23);
		btnCancel.setText("Cancel");
	}

	/**
	 * @return the result
	 */
	public Object getResult() {
		return result;
	}

	/**
	 * @return the choosePararameteredElementButton
	 */
	public Button getChoosePararameteredElementButton() {
		return choosePararameteredElementButton;
	}

	/**
	 * @return the parameteredElementLabel
	 */
	public CLabel getParameteredElementLabel() {
		return parameteredElementLabel;
	}

	/**
	 * @return the parameteredElementContent
	 */
	public CLabel getParameteredElementContent() {
		return parameteredElementContent;
	}

	/**
	 * @return the chooseDefaultParameterButton
	 */
	public Button getChooseDefaultParameterButton() {
		return chooseDefaultParameterButton;
	}

	/**
	 * @return the defaultElementLabel
	 */
	public CLabel getDefaultElementLabel() {
		return defaultElementLabel;
	}

	/**
	 * @return the defaultElementContent
	 */
	public CLabel getDefaultElementContent() {
		return defaultElementContent;
	}
}

Back to the top