Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cecb50306c912757ce3893141ed82e1bcbd2eeb4 (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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
/*****************************************************************************
 * Copyright (c) 2009 CEA LIST.
 *
 *
 * 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
 *
 *****************************************************************************/
package org.eclipse.papyrus.infra.hyperlink.ui;

import org.eclipse.papyrus.infra.hyperlink.messages.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;


/**
 * The Class AbstractLookForDiagramShell. This Class has been generated from
 * VisualEditor. Do not modify it manually by adding behavior! you will lose the
 * capacity to open with VE. So this class is abstract and it contains set of
 * getter in order to connect behavior in subclasses
 */
public class AbstractLookForEditorShell {

	/** The lookfor shell. */
	private Shell lookforShell = null; // @jve:decl-index=0:visual-constraint="108,60"

	/** The c tab folder. */
	private CTabFolder cTabFolder = null;

	/** The diagram listcomposite. */
	private Composite diagramListcomposite = null;

	/** The tree viewcomposite. */
	private Composite treeViewcomposite = null;

	/** The modeltree. */
	private final Tree modeltree = null;

	/** The new diagrambutton. */
	private Button newDiagrambutton = null;

	/** The remove diagrambutton. */
	private Button removeDiagrambutton = null;

	/** The O kbutton. */
	private Button OKbutton = null;

	/** The cancelbutton. */
	private Button cancelbutton = null;

	/** The diagram listtree. */
	private final Tree diagramListtree = null;

	/** The diagramfiltered tree. */
	private FilteredTree diagramfilteredTree = null;

	/** The mode filtered tree. */
	private FilteredTree modeFilteredTree = null;

	/** The c label. */
	private CLabel cLabel = null;

	/**
	 * This method initializes lookforShell.
	 */
	protected void createLookforShell() {
		GridData gridData2 = new GridData();
		gridData2.horizontalAlignment = GridData.FILL;
		gridData2.verticalAlignment = GridData.CENTER;
		GridData gridData1 = new GridData();
		gridData1.grabExcessHorizontalSpace = false;
		gridData1.horizontalAlignment = GridData.FILL;
		gridData1.verticalAlignment = GridData.CENTER;
		gridData1.grabExcessVerticalSpace = false;
		GridLayout gridLayout1 = new GridLayout();
		gridLayout1.numColumns = 5;
		gridLayout1.makeColumnsEqualWidth = true;
		// this line has to be commented in order to open with VISUAL EDITOR
		lookforShell = new Shell(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.DIALOG_TRIM | SWT.RESIZE);

		// lookforShell = new Shell();
		lookforShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		createCTabFolder();
		lookforShell.setLayout(gridLayout1);
		lookforShell.setSize(new Point(501, 313));
		new Label(lookforShell, SWT.NONE);
		new Label(lookforShell, SWT.NONE);
		new Label(lookforShell, SWT.NONE);
		OKbutton = new Button(lookforShell, SWT.NONE);
		OKbutton.setText(Messages.AbstractLookForEditorShell_OK);
		OKbutton.setLayoutData(gridData1);
		OKbutton.setEnabled(false);
		cancelbutton = new Button(lookforShell, SWT.NONE);
		cancelbutton.setText(Messages.AbstractLookForEditorShell_Cancel);
		cancelbutton.setLayoutData(gridData2);
	}

	/**
	 * This method initializes cTabFolder.
	 */
	protected void createCTabFolder() {
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.horizontalSpan = 5;
		gridData.verticalAlignment = GridData.FILL;
		cTabFolder = new CTabFolder(lookforShell, SWT.NONE);
		cTabFolder.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		cTabFolder.setLayoutData(gridData);
		createDiagramListcomposite();
		createTreeViewcomposite();
		CTabItem cTabItem = new CTabItem(cTabFolder, SWT.None);
		cTabItem.setControl(diagramListcomposite);
		cTabItem.setText(Messages.AbstractLookForEditorShell_EditorsList);// TODO change this name into Editor List
		CTabItem cTabItem1 = new CTabItem(cTabFolder, SWT.None);
		cTabItem1.setText(Messages.AbstractLookForEditorShell_TreeView);
		cTabItem1.setControl(treeViewcomposite);
	}

	/**
	 * This method initializes diagramListcomposite.
	 */
	private void createDiagramListcomposite() {
		GridLayout gridLayout2 = new GridLayout();
		diagramListcomposite = new Composite(cTabFolder, SWT.BORDER);
		diagramListcomposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		createDiagramfilteredTree();
		diagramListcomposite.setLayout(gridLayout2);
	}

	/**
	 * This method initializes treeViewcomposite.
	 */
	private void createTreeViewcomposite() {
		GridData gridData5 = new GridData();
		gridData5.horizontalAlignment = GridData.FILL;
		gridData5.verticalAlignment = GridData.CENTER;
		GridData gridData4 = new GridData();
		gridData4.horizontalAlignment = GridData.FILL;
		gridData4.verticalAlignment = GridData.CENTER;
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		treeViewcomposite = new Composite(cTabFolder, SWT.NONE);
		treeViewcomposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		createModelFilteredTree();
		treeViewcomposite.setLayout(gridLayout);
		newDiagrambutton = new Button(treeViewcomposite, SWT.NONE);
		newDiagrambutton.setText(Messages.AbstractLookForEditorShell_New);
		newDiagrambutton.setLayoutData(gridData4);
		removeDiagrambutton = new Button(treeViewcomposite, SWT.NONE);
		removeDiagrambutton.setText(Messages.AbstractLookForEditorShell_Remove);
		removeDiagrambutton.setLayoutData(gridData5);
		cLabel = new CLabel(treeViewcomposite, SWT.NONE);
		cLabel.setText("   "); //$NON-NLS-1$
		cLabel.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
	}

	/**
	 * Gets the modeltree.
	 *
	 * @return the modeltree
	 */
	// @unused
	protected Tree getModeltree() {
		return modeltree;
	}

	/**
	 * Gets the new diagrambutton.
	 *
	 * @return the newDiagrambutton
	 */
	protected Button getNewDiagrambutton() {
		return newDiagrambutton;
	}

	/**
	 * Sets the new diagrambutton.
	 *
	 * @param newDiagrambutton
	 *            the newDiagrambutton to set
	 */
	// @unused
	protected void setNewDiagrambutton(Button newDiagrambutton) {
		this.newDiagrambutton = newDiagrambutton;
	}

	/**
	 * Gets the remove diagrambutton.
	 *
	 * @return the removeDiagrambutton
	 */
	protected Button getRemoveDiagrambutton() {
		return removeDiagrambutton;
	}

	/**
	 * Sets the remove diagrambutton.
	 *
	 * @param removeDiagrambutton
	 *            the removeDiagrambutton to set
	 */
	// @unused
	protected void setRemoveDiagrambutton(Button removeDiagrambutton) {
		this.removeDiagrambutton = removeDiagrambutton;
	}

	/**
	 * Gets the o kbutton.
	 *
	 * @return the oKbutton
	 */
	protected Button getOKbutton() {
		return OKbutton;
	}

	/**
	 * Sets the o kbutton.
	 *
	 * @param oKbutton
	 *            the oKbutton to set
	 */
	// @unused
	protected void setOKbutton(Button oKbutton) {
		OKbutton = oKbutton;
	}

	/**
	 * Gets the cancelbutton.
	 *
	 * @return the cancelbutton
	 */
	protected Button getCancelbutton() {
		return cancelbutton;
	}

	/**
	 * Sets the cancelbutton.
	 *
	 * @param cancelbutton
	 *            the cancelbutton to set
	 */
	// @unused
	protected void setCancelbutton(Button cancelbutton) {
		this.cancelbutton = cancelbutton;
	}

	/**
	 * Gets the diagram listtree.
	 *
	 * @return the diagramListtree
	 */
	// @unused
	protected Tree getDiagramListtree() {
		return diagramListtree;
	}

	/**
	 * Gets the lookfor shell.
	 *
	 * @return the lookforShell
	 */
	protected Shell getLookforShell() {
		return lookforShell;
	}

	/**
	 * Sets the lookfor shell.
	 *
	 * @param lookforShell
	 *            the lookforShell to set
	 */
	// @unused
	protected void setLookforShell(Shell lookforShell) {
		this.lookforShell = lookforShell;
	}

	/**
	 * This method initializes diagramfilteredTree.
	 */
	private void createDiagramfilteredTree() {
		GridData gridData6 = new GridData();
		gridData6.horizontalAlignment = GridData.FILL;
		gridData6.grabExcessHorizontalSpace = true;
		gridData6.grabExcessVerticalSpace = true;
		gridData6.verticalAlignment = GridData.FILL;
		diagramfilteredTree = new FilteredTree(diagramListcomposite, SWT.BORDER, new PatternFilter(), true);
		diagramfilteredTree.setLayoutData(gridData6);
	}

	/**
	 * This method initializes filteredTree.
	 */
	private void createModelFilteredTree() {
		GridData gridData3 = new GridData();
		gridData3.horizontalAlignment = GridData.FILL;
		gridData3.grabExcessHorizontalSpace = true;
		gridData3.grabExcessVerticalSpace = true;
		gridData3.verticalSpan = 3;
		gridData3.verticalAlignment = GridData.FILL;
		modeFilteredTree = new FilteredTree(treeViewcomposite, SWT.BORDER, new PatternFilter(), true);
		modeFilteredTree.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		modeFilteredTree.setLayoutData(gridData3);
	}

	/**
	 * Gets the diagramfiltered tree.
	 *
	 * @return the diagramfilteredTree
	 */
	protected FilteredTree getDiagramfilteredTree() {
		return diagramfilteredTree;
	}

	/**
	 * Gets the mode filtered tree.
	 *
	 * @return the modeFilteredTree
	 */
	protected FilteredTree getModeFilteredTree() {
		return modeFilteredTree;
	}

}

Back to the top