Bonjour,

J'ai vu beaucoup de discussion sur le sujet, j'ai essayé pleins de choses mais rien qui ne résolve mon problème

J'ai une SelectionDialog, dans laquelle je construis plusieurs zones et j'ai besoin d'avoir dans une zone (code à partir de la ligne : // COMPOSITE OU MON SCROLL EST POSITIONNE !!!!!!!!!!!!!!) qui contient des sections un scroll vertical qui se met à jour en fonction des "expanded" et des "collapsed".

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
protected Control createDialogArea(Composite parent) {
 
		ImageDescriptor expandImage = null;
		expandImage = Activator.getImageDescriptor("icons/expandall.png");
		ImageDescriptor collapseImage = null;
		collapseImage = Activator.getImageDescriptor("icons/collapseall.png");
		ImageDescriptor titleImage = null;
		titleImage = Activator.getImageDescriptor("icons/mi_nav.png");
 
		toolkit = new FormToolkit(parent.getDisplay());
 
		final Composite dialogArea = (Composite) super.createDialogArea(parent);
		dialogArea.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		dialogArea.setLayout(new GridLayout(1, false));
 
		Composite compositePrincipal = new Composite(dialogArea, SWT.FILL);
		compositePrincipal.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
		GridLayout gl_composite = new GridLayout(2, true);
		gl_composite.horizontalSpacing = 0;
		gl_composite.verticalSpacing = 0;
		gl_composite.marginWidth = 0;
		gl_composite.marginHeight = 0;
		compositePrincipal.setLayout(gl_composite);
 
		Label lblRebuildWithBranch = new Label(compositePrincipal, SWT.NONE);
		lblRebuildWithBranch.setText("Rebuild with branch profiling feedback ...");
 
		Button btnNewButton = new Button(compositePrincipal, SWT.NONE);
		btnNewButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		btnNewButton.setImage(titleImage.createImage());
 
		Composite composite_1 = new Composite(dialogArea, SWT.NONE);
		composite_1.setLayout(new GridLayout(2, false));
		GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
		gd_composite_1.heightHint = 400;
		composite_1.setLayoutData(gd_composite_1);
 
		ToolBar toolBar = new ToolBar(composite_1, SWT.FLAT | SWT.VERTICAL);
		toolBar.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
 
		ToolItem lButExpanded = new ToolItem(toolBar, SWT.NONE);
		lButExpanded.setImage(expandImage.createImage());
 
		ToolItem lButCollapsed = new ToolItem(toolBar, SWT.NONE);
		lButCollapsed.setImage(collapseImage.createImage());
 
	// COMPOSITE OU MON SCROLL EST POSITIONNE !!!!!!!!!!!!!!
		final Composite compositeSections = new Composite(composite_1, SWT.BORDER | SWT.V_SCROLL);
		GridData gd_composite_9 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
		gd_composite_9.grabExcessHorizontalSpace = true;
		compositeSections.setLayoutData(gd_composite_9);
		compositeSections.setLayout(new GridLayout(1, false));
 
//* 1ere section : MAIN */		
		sectionMain = toolkit.createSection(compositeSections,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionMain.addExpansionListener(new ExpansionAdapter() {
			public void expansionStateChanged(ExpansionEvent e) {
				sectionMain.setExpanded(true); // this section is ALWAYS expanded !
				compositeSections.redraw();
			}});
		sectionMain.setText("Main");
		sectionMain.marginWidth = 10;
		sectionMain.marginHeight = 5;
		sectionMain.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
		sectionMain.setLayoutData(data);
 
		Composite sectionClient = toolkit.createComposite(sectionMain, SWT.WRAP);
		sectionClient.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		GridLayout layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = true;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClient.setLayoutData(data);
		sectionClient.setLayout(layout);
 
		Group groupMain = new Group(sectionClient, SWT.NONE);
		groupMain.setLayout(new GridLayout());
	  GridData gdGroup = new GridData(GridData.FILL_BOTH);
	  groupMain.setLayoutData(gdGroup);
 
	  groupMain.setText("Project:");
 
		Composite col1 = toolkit.createComposite(groupMain);
		col1.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 4;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		col1.setLayoutData(data);
		col1.setLayout(layout);
 
		// Project Label
		Label lProject = new Label(col1, SWT.FILL);
		lProject.setText("Project:");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lProject.setLayoutData(data);
		// Project Name
		Text lProjectName = new Text(col1, SWT.READ_ONLY|SWT.BORDER);
		lProjectName.setText(projectToBuild.getName());
		data = new GridData(GridData.FILL_HORIZONTAL);
		lProjectName.setLayoutData(data);
 
		sectionMain.setClient(sectionClient);
 
//* 2eme section : BUILD */	
		sectionBuild = toolkit.createSection(compositeSections,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionBuild.setText("Build");
		sectionBuild.marginWidth = 10;
		sectionBuild.marginHeight = 5;
		sectionBuild.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionBuild.setLayoutData(data);
 
		Composite sectionClientBuild = toolkit.createComposite(sectionBuild, SWT.WRAP);
		sectionClientBuild.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = true;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClientBuild.setLayoutData(data);
		sectionClientBuild.setLayout(layout);
 
		Group groupBuild = new Group(sectionClientBuild, SWT.NONE);
		groupBuild.setLayout(new GridLayout());
	  GridData gd = new GridData(GridData.FILL_BOTH);
	  groupBuild.setLayoutData(gd);
	  groupBuild.setText("Build options:");
 
		Text fBuildOptions = new Text(groupBuild, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
		fBuildOptions.setText("-g");
	  gd = new GridData(GridData.FILL_BOTH);
		gd.heightHint = 40;
	  gd.widthHint = 100;
	  fBuildOptions.setLayoutData(gd);
 
	  Group groupLink = new Group(sectionClientBuild, SWT.NONE);
	  groupLink.setLayout(new GridLayout());
	  gd = new GridData(GridData.FILL_BOTH);
	  groupLink.setLayoutData(gd);
	  groupLink.setText("Link options:");
 
		Text fLinkOptions = new Text(groupLink, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
		fLinkOptions.setText("");
	  gd = new GridData(GridData.FILL_BOTH);
		gd.heightHint = 40;
	  gd.widthHint = 100;
	  fLinkOptions.setLayoutData(gd);
 
		sectionBuild.setClient(sectionClientBuild);
 
//* 3eme section : RUN */
		sectionRun = toolkit.createSection(compositeSections,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionRun.setText("Run");
		sectionRun.marginWidth = 10;
		sectionRun.marginHeight = 5;
		sectionRun.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionRun.setLayoutData(data);
 
		Composite sectionClientRun = toolkit.createComposite(sectionRun, SWT.WRAP);
		sectionClientRun.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = true;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClientRun.setLayoutData(data);
		sectionClientRun.setLayout(layout);
 
///* 1ere sous-section de RUN : ARGUMENTS */	
		sectionArguments = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionArguments.setText("Arguments");
		sectionArguments.marginWidth = 10;
		sectionArguments.marginHeight = 5;
		sectionArguments.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionArguments.setLayoutData(data);
 
		Composite sectionClientArg = toolkit.createComposite(sectionArguments, SWT.WRAP);
		sectionClientArg.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = true;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClientArg.setLayoutData(data);
		sectionClientArg.setLayout(layout);
 
		Group group = new Group(sectionClientArg, SWT.NONE);
	  group.setLayout(new GridLayout());
	  gd = new GridData(GridData.FILL_BOTH);
	  group.setLayoutData(gd);
 
		group.setText("Program arguments:");
		Text fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
	  gd = new GridData(GridData.FILL_BOTH);
		gd.heightHint = 40;
	  gd.widthHint = 100;
		fPrgmArgumentsText.setLayoutData(gd);
		fPrgmArgumentsText.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent evt) {
				//updateLaunchConfigurationDialog();
			}
		});
 
		sectionArguments.setClient(sectionClientArg);
 
/* 2eme sous-section de RUN :  : ENVIRONMENT */	
		sectionEnvironment = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionEnvironment.setText("Environment");
		sectionEnvironment.marginWidth = 10;
		sectionEnvironment.marginHeight = 5;
		sectionEnvironment.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionEnvironment.setLayoutData(data);
 
		Composite sectionClientEnv = toolkit.createComposite(sectionEnvironment, SWT.WRAP);
		sectionClientEnv.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClientEnv.setLayoutData(data);
		sectionClientEnv.setLayout(layout);
 
		Label lEnvir = new Label(sectionClientEnv, SWT.FILL);
		lEnvir.setText("Environment variables to set:");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lEnvir.setLayoutData(data);
 
		Composite compoEnviTable = toolkit.createComposite(sectionClientEnv, SWT.WRAP);
		compoEnviTable.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 2;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		compoEnviTable.setLayoutData(data);
		compoEnviTable.setLayout(layout);
 
		Composite compoTable = toolkit.createComposite(compoEnviTable, SWT.WRAP);
		compoTable.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		compoTable.setLayoutData(data);
		compoTable.setLayout(layout);
 
		TableViewer environmentTable = new TableViewer(compoTable, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
		Table table = environmentTable.getTable();
		table.setLayout(new GridLayout());
		table.setLayoutData(new GridData(GridData.FILL_BOTH));
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		table.setItemCount(4);
		environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
			public void selectionChanged(SelectionChangedEvent event) {
				//handleTableSelectionChanged(event);
			}
		});
		environmentTable.addDoubleClickListener(new IDoubleClickListener() {
			public void doubleClick(DoubleClickEvent event) {
			}
		});
		// Create columns
		final TableColumn tc1 = new TableColumn(table, SWT.NONE, 0);
		tc1.setText("Variable");
		final TableColumn tc2 = new TableColumn(table, SWT.NONE, 1);
		tc2.setText("Value");
		final Table tref = table;
		final Composite comp = sectionClientEnv;
		sectionClientEnv.addControlListener(new ControlAdapter() {
			public void controlResized(ControlEvent e) {
				Rectangle area = comp.getClientArea();
				Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
				ScrollBar vBar = tref.getVerticalBar();
				int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
				if (size.y > area.height + tref.getHeaderHeight()) {
					Point vBarSize = vBar.getSize();
					width -= vBarSize.x;
				}
				Point oldSize = tref.getSize();
				if (oldSize.x > area.width) {
					tc1.setWidth(width/2-1);
					tc2.setWidth(width - tc1.getWidth());
					tref.setSize(area.width, area.height);
				} else {
					tref.setSize(area.width, area.height);
					tc1.setWidth(width/2-1);
					tc2.setWidth(width - tc1.getWidth());
				}
			}
		});
 
		sectionEnvironment.setClient(sectionClientEnv);
 
/* 3eme sous-section de RUN :  : RUNNER */	
		sectionRunner = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
		sectionRunner.setText("Runner");
		sectionRunner.marginWidth = 10;
		sectionRunner.marginHeight = 5;
		sectionRunner.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionRunner.setLayoutData(data);
 
		Composite sectionClientRunner = toolkit.createComposite(sectionRunner, SWT.WRAP);
		sectionClientRunner.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		sectionClientRunner.setLayoutData(data);
		sectionClientRunner.setLayout(layout);
 
		Composite run2 = toolkit.createComposite(sectionClientRunner);
		run2.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		run2.setLayoutData(data);
		run2.setLayout(layout);
 
		Group groupRunOption = new Group(run2, SWT.NONE);
		groupRunOption.setLayout(new GridLayout());
	  gd = new GridData(GridData.FILL_BOTH);
	  groupRunOption.setLayoutData(gd);
	  groupRunOption.setText("Runner options:");
 
	  Composite runoption = toolkit.createComposite(groupRunOption);
	  runoption.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		layout = new GridLayout();
		layout.numColumns = 4;
		layout.makeColumnsEqualWidth = false;
		data = new GridData(GridData.FILL_HORIZONTAL);
		runoption.setLayoutData(data);
		runoption.setLayout(layout);
 
		// Label option 1 Disable Core check coherency
		Label lOption1 = new Label(runoption, SWT.FILL);
		lOption1.setText("Disable Core check coherency");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption1.setLayoutData(data);
		// Button option 1 Disable Core check coherency
		Button lOption1But = new Button(runoption, SWT.CHECK);
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption1But.setLayoutData(data);
 
		// Label option 2 Disable CoreCfg check
		Label lOption2 = new Label(runoption, SWT.FILL);
		lOption2.setText("Disable CoreCfg check");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption2.setLayoutData(data);
		// Button option 2 
		Button lOption2But = new Button(runoption, SWT.CHECK);
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption2But.setLayoutData(data);
 
		// Label option 3 Disable Extension check
		Label lOption3 = new Label(runoption, SWT.FILL);
		lOption3.setText("Disable Extension check");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption3.setLayoutData(data);
		// Button option 3 
		Button lOption3But = new Button(runoption, SWT.CHECK);
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption3But.setLayoutData(data);
 
		// Label option 4 Disable XVR check
		Label lOption4 = new Label(runoption, SWT.FILL);
		lOption4.setText("Disable XVR check");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption4.setLayoutData(data);
		// Button option 4 
		Button lOption4But = new Button(runoption, SWT.CHECK);
		data = new GridData(GridData.FILL_HORIZONTAL);
		lOption4But.setLayoutData(data);
 
		// Target Label
		Label lTarget= new Label(run1, SWT.FILL);
		lTarget.setText("Target:");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lTarget.setLayoutData(data);
		// Target Name
		Combo lTargetName = new Combo(run1, SWT.READ_ONLY|SWT.BORDER);
		lTargetName.add("default");
		data = new GridData(GridData.FILL_HORIZONTAL);
		lTargetName.setLayoutData(data);
		lTargetName.select(0);
 
		sectionRunner.setClient(sectionClientRunner);
		sectionRun.setClient(sectionClientRun);
 
		return dialogArea;
	}
J'ai essayé avec un ScrolledComposite, pas mieux, voire pire...
Un petit coup de main serait le bien venu. Je teste dans tous les sens depuis 1 semaine

Merci d'avance.