IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SWT/JFace Java Discussion :

Scroll dans un composite


Sujet :

SWT/JFace Java

  1. #1
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut Scroll dans un composite
    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.

  2. #2
    Membre expert
    Avatar de Gueritarish
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2007
    Messages
    1 800
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2007
    Messages : 1 800
    Points : 3 919
    Points
    3 919
    Par défaut
    Salut,

    Si j'ai un conseil à te donner, quand tu postes une aussi grande quantité de code (surtout en SWT), ce serait bien d'en faire une application SWT stand-alone (avec une boucle de dispatch) qu'on puisse exécuter ça rapidement.
    Donc, pour ton problème, tu jetteras une oeil là dessus:
    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
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
        private static FormToolkit toolkit;
        private static Section sectionMain;
     
        private static Section sectionBuild;
        private static Section sectionRun;
        private static Section sectionRunner;
        private static Section sectionArguments;
        private static Section sectionEnvironment;
     
        public static void main(String[] args) {
            final Display display = new Display();
            Shell shell = new Shell(display);
            shell.setLayout(new FillLayout());
     
            toolkit = new FormToolkit(display);
     
            final Composite dialogArea = new Composite(shell, SWT.NONE);
            dialogArea.setBackground(display
                .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));
            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));
     
            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);
            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));
     
            new ToolItem(toolBar, SWT.NONE);
     
            new ToolItem(toolBar, SWT.NONE);
     
            // COMPOSITE OU MON SCROLL EST POSITIONNE !!!!!!!!!!!!!!
            final ScrolledComposite scrolledCompositeSections =
                new ScrolledComposite(composite_1, SWT.BORDER | SWT.H_SCROLL
                    | SWT.V_SCROLL);
            scrolledCompositeSections.setLayout(new GridLayout(2, false));
            scrolledCompositeSections.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
            final Composite compositeSections =
                new Composite(scrolledCompositeSections, SWT.NONE);
            scrolledCompositeSections.setExpandHorizontal(true);
            scrolledCompositeSections.setExpandVertical(true);
            scrolledCompositeSections.setShowFocusedControl(true);
            scrolledCompositeSections.setContent(compositeSections);
            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);
                    compositeSections.layout();
                }
            });
            sectionMain.setText("Main");
            sectionMain.marginWidth = 10;
            sectionMain.marginHeight = 5;
            sectionMain.setBackground(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            GridData data = new GridData(GridData.FILL_HORIZONTAL);
            sectionMain.setLayoutData(data);
     
            Composite sectionClient =
                toolkit.createComposite(sectionMain, SWT.WRAP);
            sectionClient.setBackground(display.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(display.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("Test project");
            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(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            data = new GridData(GridData.FILL_HORIZONTAL);
            sectionBuild.setLayoutData(data);
            sectionBuild.addExpansionListener(new ExpansionAdapter() {
     
                @Override
                public void expansionStateChanged(ExpansionEvent arg0) {
                    compositeSections.layout();
                    scrolledCompositeSections.setMinSize(compositeSections
                        .computeSize(SWT.DEFAULT, SWT.DEFAULT));
                }
            });
     
            Composite sectionClientBuild =
                toolkit.createComposite(sectionBuild, SWT.WRAP);
            sectionClientBuild.setBackground(display.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(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            data = new GridData(GridData.FILL_HORIZONTAL);
            sectionRun.setLayoutData(data);
            sectionRun.addExpansionListener(new ExpansionAdapter() {
     
                @Override
                public void expansionStateChanged(ExpansionEvent arg0) {
                    compositeSections.layout();
                    scrolledCompositeSections.setMinSize(compositeSections
                        .computeSize(SWT.DEFAULT, SWT.DEFAULT));
                }
            });
     
            Composite sectionClientRun =
                toolkit.createComposite(sectionRun, SWT.WRAP);
            sectionClientRun.setBackground(display.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(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            data = new GridData(GridData.FILL_HORIZONTAL);
            sectionArguments.setLayoutData(data);
            sectionArguments.addExpansionListener(new ExpansionAdapter() {
     
                @Override
                public void expansionStateChanged(ExpansionEvent arg0) {
                    compositeSections.layout();
                    scrolledCompositeSections.setMinSize(compositeSections
                        .computeSize(SWT.DEFAULT, SWT.DEFAULT));
                }
            });
     
            Composite sectionClientArg =
                toolkit.createComposite(sectionArguments, SWT.WRAP);
            sectionClientArg.setBackground(display.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(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            data = new GridData(GridData.FILL_HORIZONTAL);
            sectionEnvironment.setLayoutData(data);
            sectionEnvironment.addExpansionListener(new ExpansionAdapter() {
     
                @Override
                public void expansionStateChanged(ExpansionEvent arg0) {
                    compositeSections.layout();
                    scrolledCompositeSections.setMinSize(compositeSections
                        .computeSize(SWT.DEFAULT, SWT.DEFAULT));
                }
            });
     
            Composite sectionClientEnv =
                toolkit.createComposite(sectionEnvironment, SWT.WRAP);
            sectionClientEnv.setBackground(display.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(display.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(display.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(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND));
            data = new GridData(GridData.FILL_HORIZONTAL);
            sectionRunner.setLayoutData(data);
            sectionRunner.addExpansionListener(new ExpansionAdapter() {
     
                @Override
                public void expansionStateChanged(ExpansionEvent arg0) {
                    compositeSections.layout();
                    scrolledCompositeSections.setMinSize(compositeSections
                        .computeSize(SWT.DEFAULT, SWT.DEFAULT));
                }
            });
     
            Composite sectionClientRunner =
                toolkit.createComposite(sectionRunner, SWT.WRAP);
            sectionClientRunner.setBackground(display.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(display.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(display.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);
     
     
            sectionRunner.setClient(sectionClientRunner);
            sectionRun.setClient(sectionClientRun);
     
            scrolledCompositeSections.setMinSize(compositeSections.computeSize(
                SWT.DEFAULT, SWT.DEFAULT));
     
            shell.open();
            while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) {
                    display.sleep();
                }
            }
            display.dispose();
        }
    Tu colles le contenu des balises CODE dans ton Eclipse (dans un package quelconque) et tu peux l'exécuter.
    Certaines choses sont à améliorer, mais je pense que tu as déjà l'idée directrice.

    Voilà, à+
    Gueritarish
    Pas de questions technique par MP, les forums sont là pour ça.

  3. #3
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Désolée, je n'ai jamais fait de SWT Stand-alone .... !
    Je teste ça et te tiens au courant.

    Du coup comment tu l'exécutes ?

  4. #4
    Membre expert
    Avatar de Gueritarish
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2007
    Messages
    1 800
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2007
    Messages : 1 800
    Points : 3 919
    Points
    3 919
    Par défaut
    Tu l'exécutes comme une application Java classique:
    • soit tu places ça dans une nouveau projet Java (il te faut préciser les JARs de SWT, JFace et Eclipse Forms dans le build path).
    • soit tu places ça dans ton plug-in Eclipse (que tu développes) dans n'importe quel package.
    • soit tu places ça dans ta méthode createDialogArea()


    Voilà, à+
    Gueritarish
    Pas de questions technique par MP, les forums sont là pour ça.

  5. #5
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Bonjour,

    Merci pour les infos
    Alors ça marche mieux, j'ai au moins un ascenseur digne de ce nom !
    Par contre dès que j'expand ou collapse une section, le scrollcomposite se retaille n'importe comment : CF image avant/après.
    Images attachées Images attachées   

  6. #6
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    en fait à chaque fois que je fais un expand d'une section, ça agrandit horizontalement les controls qui sont dans la section.

    Mais le scroll vertical disparait aussi !
    Pourquoi ?

  7. #7
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Ok, j'ai enlevé tous les "GridData.FILL_HORIZONTAL" ou autre FILL_, et c'est nickel.
    Reste plus qu'à retailler correctement mes controls et bloquer le retaillage de la fenêtre. Ça pourrait être mieux : garder le FILL et pouvoir retailler la dialog mais bon c'est mieux que rien et ça me convient.

    Merci à toi Gueritarish

  8. #8
    Membre expert
    Avatar de Gueritarish
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2007
    Messages
    1 800
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2007
    Messages : 1 800
    Points : 3 919
    Points
    3 919
    Par défaut
    Avec plaisir

    Sache qu'il y a beaucoup de constantes affichées par la classe GridData qui ne sont pas recommandées (comme les FILL_BOTH, ou FILL_HORIZONTAL, ...). Je pense qu'il vaut mieux définir ses data à la main (avec des new). C'est plus sûr.

    Pense au bouton
    Pas de questions technique par MP, les forums sont là pour ça.

  9. #9
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Avant de le fermer, une dernière question :

    comme j'ai enlevé tout mes FILL_... mes controls sont à la taille par défaut du texte qu'ils contiennent. Je voudrais imposer la taille (puisque ma dialog ne sera pas retaillable) de tous mes controls afin d'uniformiser la dialog.
    Je ne peux faire un simple setsize sur mes controls, puisqu'ils utilisent tous un Layout, j'avais vu et testé que la seule façon de réaliser ça c'était de mettre à null le setLayout du composite principal.

    J'ai essayé et bien sur je n'ai plus rien dans ma dialog, enfin si j'ai que ma 1ere section mais vide. et j'ai peur de toute façon de tout casser le comportement du scroll qui marche bien.

    Comment je peux faire ?
    merci !

  10. #10
    Membre expert
    Avatar de Gueritarish
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2007
    Messages
    1 800
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2007
    Messages : 1 800
    Points : 3 919
    Points
    3 919
    Par défaut
    Tu peux utiliser une indication de taille sur les GridData (avec heightHint et widthHint).
    Pas de questions technique par MP, les forums sont là pour ça.

  11. #11
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Oh yes !
    c'était aussi simple que ça ! et ça marche

    Merci encore de ton aide !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [scrolltop] La hauteur "scrollée" dans une page
    Par pmartin8 dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 06/12/2005, 14h44
  2. [CSS] Pas de scroll dans le body !
    Par pekka77 dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 02/12/2005, 17h59
  3. [DBGrid]scroll dans deux grilles
    Par dleu dans le forum Bases de données
    Réponses: 4
    Dernier message: 13/09/2004, 10h51
  4. [Débutant] Scrolls dans JTextArea
    Par k-reen dans le forum Composants
    Réponses: 2
    Dernier message: 30/06/2004, 16h14
  5. scroll dans un label
    Par Pretender dans le forum Composants VCL
    Réponses: 9
    Dernier message: 27/09/2002, 17h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo