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 :

Lenteur d'ouverture d'une Dialog


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 Lenteur d'ouverture d'une Dialog
    Bonjour,

    J'ai fait le design d'une fenêtre assez compliquée (comprenez beaucoup de boutons (check), zones de texte...) avec WindowBuilder ! BONHEUR

    Cependant, la 1ere (pas les suivantes) ouverture prend un temps fou !!!!
    Alors, soit j'ai 10 zones de texte, 24 boutons check et 2 boutons push, mais quand même !!!!

    Une idée du pourquoi ???
    Merci

    Chris

  2. #2
    Nouveau membre du Club
    Inscrit en
    Juin 2006
    Messages
    31
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Juin 2006
    Messages : 31
    Points : 29
    Points
    29
    Par défaut
    Bonjour,

    comment lancez-vous votre fenêtre ?
    Par le biais de la preview de WindowBuilder ? Avez vous créé une product ? Est-ce juste un plugin dans lequel se trouve votre Dialog ?

  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
    Bonjour,

    en fait, j'ai juste récupérer le code généré par WB.
    Je l'ouvre via un popmenu dans une classe étendant ActionDelegate, j'ai tout un tas de tests avant l'ouverture, mais c'est vraiment la création des éléments graphiques qui est lente ...

    Sinon, histoire de faire patienter l'utilisateur je voulais mettre un sablier ... et impossible, j'y arrive pas.
    J'ai essayé ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Display.getDefault().getActiveShell().setCursor(new Cursor(null, SWT.CURSOR_WAIT));
    et j'ai le sablier qu'une fois que j'ai cliqué sur un bouton de ma souris ...

    A+
    Chris

  4. #4
    Nouveau membre du Club
    Inscrit en
    Juin 2006
    Messages
    31
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Juin 2006
    Messages : 31
    Points : 29
    Points
    29
    Par défaut
    Concernant le sablier, vous pouvez utiliser le code suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    BusyIndicator.showWhile(Display.getDefault(), new Runnable(){
     
    public void run(){
           // Code 
    }
     
    });
    Pour les problèmes de lenteur, je posais les questions précédentes car il me semble qu'il soit possible au lancement d'une product Eclipse de spécifier si les plugins doivent être lancés au démarrage de l'application OU au moment où le plugin est demandé (ce qui pourrait être votre cas).

    Autre chose, ayant utilisé WindowBuilder, il pourrait être le responsable :
    - redondance de codes / non optimisation
    - non libération de ressources
    - ...

    Pourriez-vous poster votre code (épuré) ?

  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
    Alors oui je pense que c'est pas très optimisé, mais là juste pour de la création de boutons et autres ...
    voici mon code, au cas où :
    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
     
    protected Control createDialogArea( Composite parent ) {
    		Composite container = (Composite) super.createDialogArea(parent);
    		GridLayout gridLayout = (GridLayout) container.getLayout();
     
    		Composite composite = new Composite(container, SWT.NONE);
    		composite.setLayout(new GridLayout(3, false));
    		GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
    		gd_composite.heightHint = 38;
    		composite.setLayoutData(gd_composite);
     
    		Label lblExpressionToWatch = new Label(composite, SWT.NONE);
    		lblExpressionToWatch.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    		lblExpressionToWatch.setText("Expression to watch:");
    		new Label(composite, SWT.NONE);
     
    		textExprToWatch = new Text(composite, SWT.BORDER);
    		GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
    		gd_text.widthHint = 294;
    		textExprToWatch.setLayoutData(gd_text);
    		textExprToWatch.setText(fExpression);
     
    		Composite composite_1 = new Composite(container, SWT.NONE);
    		composite_1.setLayout(new FormLayout());
    		GridData gd_composite_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    		gd_composite_1.heightHint = 72;
    		composite_1.setLayoutData(gd_composite_1);
     
    		Group grpStatus = new Group(composite_1, SWT.NONE);
    		grpStatus.setLayout(null);
    		FormData fd_grpStatus = new FormData();
    		fd_grpStatus.top = new FormAttachment(0);
    		fd_grpStatus.left = new FormAttachment(0);
    		fd_grpStatus.bottom = new FormAttachment(0, 66);
    		fd_grpStatus.right = new FormAttachment(0, 469);
    		grpStatus.setLayoutData(fd_grpStatus);
    		grpStatus.setText("Status");
     
    		btnCheckEnable = new Button(grpStatus, SWT.CHECK);
    		btnCheckEnable.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    				//SUPPRESS
    			}
    		});
    		btnCheckEnable.setBounds(10, 20, 91, 16);
    		//btnCheckButton.setText("Enable/Disable");
    		btnCheckEnable.setText("Enable/Disable");
     
    		btnCheckVerbose = new Button(grpStatus, SWT.CHECK);
    		btnCheckVerbose.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    				//SUPPRESS
    			}
    		});
    		btnCheckVerbose.setBounds(119, 20, 93, 16);
    		btnCheckVerbose.setText("Verbose on/off");
     
    		btnCheckCount = new Button(grpStatus, SWT.CHECK);
    		btnCheckCount.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    				//SUPPRESS
    			}
    		});
    		btnCheckCount.setBounds(10, 42, 54, 16);
    		btnCheckCount.setText("Count:");
     
    		textCount = new Text(grpStatus, SWT.BORDER);
    		textCount.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		textCount.setBounds(70, 42, 76, 19);
     
    		Composite composite_2 = new Composite(container, SWT.NONE);
    		composite_2.setLayout(new FormLayout());
    		GridData gd_composite_2 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    		gd_composite_2.heightHint = 119;
    		composite_2.setLayoutData(gd_composite_2);
     
    		Group grpOperator = new Group(composite_2, SWT.NONE);
    		grpOperator.setLayout(new FormLayout());
    		FormData fd_grpOperator = new FormData();
    		fd_grpOperator.bottom = new FormAttachment(0, 109);
    		fd_grpOperator.right = new FormAttachment(0, 469);
    		fd_grpOperator.top = new FormAttachment(0);
    		fd_grpOperator.left = new FormAttachment(0);
    		grpOperator.setLayoutData(fd_grpOperator);
    		grpOperator.setText("Operator");
     
    		Button button = new Button(grpOperator, SWT.RADIO);
    		button.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_button = new FormData();
    		fd_button.top = new FormAttachment(0, 10);
    		fd_button.left = new FormAttachment(0);
    		button.setLayoutData(fd_button);
    		button.setText("==");
     
    		Button button_1 = new Button(grpOperator, SWT.RADIO);
    		button_1.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_button_1 = new FormData();
    		fd_button_1.top = new FormAttachment(button, 0, SWT.TOP);
    		fd_button_1.left = new FormAttachment(button, 49);
    		button_1.setLayoutData(fd_button_1);
    		button_1.setText("!=");
     
    		Button button_2 = new Button(grpOperator, SWT.RADIO);
    		button_2.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_button_2 = new FormData();
    		fd_button_2.top = new FormAttachment(button, 0, SWT.TOP);
    		button_2.setLayoutData(fd_button_2);
    		button_2.setText(">=");
     
    		Button button_3 = new Button(grpOperator, SWT.RADIO);
    		button_3.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		fd_button_2.right = new FormAttachment(button_3, -53);
    		FormData fd_button_3 = new FormData();
    		fd_button_3.top = new FormAttachment(button, 0, SWT.TOP);
    		button_3.setLayoutData(fd_button_3);
    		button_3.setText(">");
     
    		Button button_4 = new Button(grpOperator, SWT.RADIO);
    		button_4.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		fd_button_3.right = new FormAttachment(button_4, -51);
    		FormData fd_button_4 = new FormData();
    		fd_button_4.top = new FormAttachment(button, 0, SWT.TOP);
    		button_4.setLayoutData(fd_button_4);
    		button_4.setText("<=");
     
    		Button button_5 = new Button(grpOperator, SWT.RADIO);
    		button_5.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		fd_button_4.right = new FormAttachment(button_5, -32);
    		FormData fd_button_5 = new FormData();
    		fd_button_5.top = new FormAttachment(button, 0, SWT.TOP);
    		fd_button_5.right = new FormAttachment(100, -21);
    		button_5.setLayoutData(fd_button_5);
    		button_5.setText("<");
     
    		Button btnInX = new Button(grpOperator, SWT.RADIO);
    		btnInX.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_btnInX = new FormData();
    		fd_btnInX.top = new FormAttachment(button, 6);
    		fd_btnInX.left = new FormAttachment(button, 0, SWT.LEFT);
    		btnInX.setLayoutData(fd_btnInX);
    		btnInX.setText("in [ x, y ]");
     
    		Button btnInxY = new Button(grpOperator, SWT.RADIO);
    		btnInxY.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_btnInxY = new FormData();
    		fd_btnInxY.bottom = new FormAttachment(btnInX, 0, SWT.BOTTOM);
    		fd_btnInxY.left = new FormAttachment(button_1, 0, SWT.LEFT);
    		btnInxY.setLayoutData(fd_btnInxY);
    		btnInxY.setText("in ]x, y]");
     
    		Button btnInxY_1 = new Button(grpOperator, SWT.RADIO);
    		btnInxY_1.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_btnInxY_1 = new FormData();
    		fd_btnInxY_1.top = new FormAttachment(btnInX, 6);
    		fd_btnInxY_1.left = new FormAttachment(button, 0, SWT.LEFT);
    		btnInxY_1.setLayoutData(fd_btnInxY_1);
    		btnInxY_1.setText("in ]x, y[");
     
    		Button btnInxY_2 = new Button(grpOperator, SWT.RADIO);
    		btnInxY_2.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_btnInxY_2 = new FormData();
    		fd_btnInxY_2.top = new FormAttachment(btnInxY_1, 0, SWT.TOP);
    		fd_btnInxY_2.left = new FormAttachment(button_1, 0, SWT.LEFT);
    		btnInxY_2.setLayoutData(fd_btnInxY_2);
    		btnInxY_2.setText("in [x, y [");
     
    		Label lblWhereX = new Label(grpOperator, SWT.NONE);
    		FormData fd_lblWhereX = new FormData();
    		fd_lblWhereX.top = new FormAttachment(button_2, 19);
    		fd_lblWhereX.left = new FormAttachment(btnInxY, 6);
    		lblWhereX.setLayoutData(fd_lblWhereX);
    		lblWhereX.setText("Where x:");
     
    		textWhereX = new Text(grpOperator, SWT.BORDER);
    		textWhereX.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		FormData fd_textWhereX = new FormData();
    		fd_textWhereX.top = new FormAttachment(lblWhereX, -3, SWT.TOP);
    		fd_textWhereX.right = new FormAttachment(lblWhereX, 51, SWT.RIGHT);
    		fd_textWhereX.left = new FormAttachment(lblWhereX, 6);
    		textWhereX.setLayoutData(fd_textWhereX);
     
    		Label lblAndY = new Label(grpOperator, SWT.NONE);
    		FormData fd_lblAndY = new FormData();
    		fd_lblAndY.left = new FormAttachment(textWhereX, 6);
    		fd_lblAndY.bottom = new FormAttachment(lblWhereX, 0, SWT.BOTTOM);
    		lblAndY.setLayoutData(fd_lblAndY);
    		lblAndY.setText("and y:");
     
    		textWhereY = new Text(grpOperator, SWT.BORDER);
    		textWhereY.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		FormData fd_textWhereY = new FormData();
    		fd_textWhereY.top = new FormAttachment(lblWhereX, -3, SWT.TOP);
    		fd_textWhereY.right = new FormAttachment(lblAndY, 57, SWT.RIGHT);
    		fd_textWhereY.left = new FormAttachment(lblAndY, 6);
    		textWhereY.setLayoutData(fd_textWhereY);
     
    		Button btnIn = new Button(grpOperator, SWT.RADIO);
    		btnIn.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		FormData fd_btnIn = new FormData();
    		fd_btnIn.top = new FormAttachment(btnInxY_1, 6);
    		fd_btnIn.left = new FormAttachment(button, 0, SWT.LEFT);
    		btnIn.setLayoutData(fd_btnIn);
    		btnIn.setText("in &");
     
    		textIn = new Text(grpOperator, SWT.BORDER);
    		textIn.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		FormData fd_textIn = new FormData();
    		fd_textIn.top = new FormAttachment(btnInxY_1, 6);
    		fd_textIn.left = new FormAttachment(btnIn, 4);
    		fd_textIn.right = new FormAttachment(btnInX, 0, SWT.RIGHT);
    		textIn.setLayoutData(fd_textIn);
     
    		Group grpValue = new Group(container, SWT.NONE);
    		GridData gd_grpValue = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    		gd_grpValue.widthHint = 459;
    		grpValue.setLayoutData(gd_grpValue);
    		grpValue.setText("Value");
     
    		textValue = new Text(grpValue, SWT.BORDER);
    		textValue.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		textValue.setBounds(10, 21, 431, 19);
     
    		Group grpActions = new Group(container, SWT.NONE);
    		GridData gd_grpActions = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    		gd_grpActions.heightHint = 83;
    		gd_grpActions.widthHint = 467;
    		grpActions.setLayoutData(gd_grpActions);
    		grpActions.setText("Actions");
     
    		Button btnBreak = new Button(grpActions, SWT.CHECK);
    		btnBreak.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnBreak.setBounds(10, 21, 67, 16);
    		btnBreak.setText("break");
     
    		Button btnEnableWp = new Button(grpActions, SWT.CHECK);
    		btnEnableWp.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnEnableWp.setBounds(86, 21, 74, 16);
    		btnEnableWp.setText("enable wp:");
     
    		textEnableWp = new Text(grpActions, SWT.BORDER);
    		textEnableWp.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		textEnableWp.setBounds(162, 21, 36, 19);
     
    		Button btnEnable = new Button(grpActions, SWT.CHECK);
    		btnEnable.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnEnable.setBounds(254, 21, 53, 16);
    		btnEnable.setText("enable");
     
    		Button btnDisableWp = new Button(grpActions, SWT.CHECK);
    		btnDisableWp.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnDisableWp.setBounds(347, 21, 74, 16);
    		btnDisableWp.setText("disable wp:");
     
    		textDisableWp = new Text(grpActions, SWT.BORDER);
    		textDisableWp.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		textDisableWp.setBounds(427, 20, 36, 19);
     
    		Button btnDisable = new Button(grpActions, SWT.CHECK);
    		btnDisable.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnDisable.setBounds(10, 43, 67, 16);
    		btnDisable.setText("disable");
     
    		Button btnTrace = new Button(grpActions, SWT.CHECK);
    		btnTrace.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnTrace.setBounds(86, 43, 67, 16);
    		btnTrace.setText("trace");
     
    		Button btnVcdTrace = new Button(grpActions, SWT.CHECK);
    		btnVcdTrace.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnVcdTrace.setBounds(162, 43, 74, 16);
    		btnVcdTrace.setText("VCD trace");
     
    		Button btnProfiling = new Button(grpActions, SWT.CHECK);
    		btnProfiling.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnProfiling.setBounds(254, 43, 59, 16);
    		btnProfiling.setText("profiling");
     
    		Button btnNop = new Button(grpActions, SWT.CHECK);
    		btnNop.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnNop.setBounds(347, 43, 85, 16);
    		btnNop.setText("NOP");
     
    		Button btnPrintMsg = new Button(grpActions, SWT.CHECK);
    		btnPrintMsg.addSelectionListener(new SelectionAdapter() {
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    			}
    		});
    		btnPrintMsg.setBounds(10, 65, 74, 16);
    		btnPrintMsg.setText("print MSG");
     
    		textPrintMsg = new Text(grpActions, SWT.BORDER);
    		textPrintMsg.addModifyListener(new ModifyListener() {
    			public void modifyText(ModifyEvent e) {
    			}
    		});
    		textPrintMsg.setBounds(96, 62, 367, 19);
     
    		Group grpResult = new Group(container, SWT.NONE);
    		GridData gd_grpResult = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    		gd_grpResult.heightHint = 131;
    		gd_grpResult.widthHint = 467;
    		grpResult.setLayoutData(gd_grpResult);
    		grpResult.setText("Result");
     
    		textResult = new Text(grpResult, SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL);
    		textResult.setBounds(10, 25, 453, 112);
    		equation = "st watch wp0: if " + textExprToWatch.getText();
    		result = equation;
    		textResult.setText(result);
     
    		return container;
    }
    J'ai juste supprimé les widgetSelected, pas trop possibilité de supprimer autres choses.

    encore merci

  6. #6
    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,

    Je ne veux pas lui jeter la pierre, mais je dirais que c'est dû à WindowsBuilder...
    Si tu essayes ce code:
    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
     public static void main(final String[] args) {
        final Display display = new Display();
        final Shell shell = new Shell(display);
        shell.setLayout(new GridLayout(1, false));
        shell.setText("SWT Test");
     
        // Check buttons.
        final Composite firstGroup = new Composite(shell, SWT.None);
        firstGroup.setLayout(new GridLayout(2, false));
        final Button check1 = new Button(firstGroup, SWT.CHECK);
        check1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check1.setText("1 - First Check");
        final Button check2 = new Button(firstGroup, SWT.CHECK);
        check2.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check2.setText("1 - Second Check");
        final Button check3 = new Button(firstGroup, SWT.CHECK);
        check3.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check3.setText("1 - Third Check");
        final Button check4 = new Button(firstGroup, SWT.CHECK);
        check4.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check4.setText("1 - Fourth Check");
     
        final Composite secondGroup = new Composite(shell, SWT.None);
        secondGroup.setLayout(new GridLayout(2, false));
        final Button check5 = new Button(secondGroup, SWT.CHECK);
        check5.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check5.setText("2 - First Check");
        final Button check6 = new Button(secondGroup, SWT.CHECK);
        check6.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check6.setText("2 - Second Check");
        final Button check7 = new Button(secondGroup, SWT.CHECK);
        check7.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check7.setText("2 - Third Check");
        final Button check8 = new Button(secondGroup, SWT.CHECK);
        check8.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check8.setText("2 - Fourth Check");
     
        final Composite thirdGroup = new Composite(shell, SWT.None);
        thirdGroup.setLayout(new GridLayout(2, false));
        final Button check9 = new Button(thirdGroup, SWT.CHECK);
        check9.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check9.setText("3 - First Check");
        final Button check10 = new Button(thirdGroup, SWT.CHECK);
        check10
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check10.setText("3 - Second Check");
        final Button check11 = new Button(thirdGroup, SWT.CHECK);
        check11
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check11.setText("3 - Third Check");
        final Button check12 = new Button(thirdGroup, SWT.CHECK);
        check12
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check12.setText("3 - Fourth Check");
     
        final Composite fourthGroup = new Composite(shell, SWT.None);
        fourthGroup.setLayout(new GridLayout(2, false));
        final Button check13 = new Button(fourthGroup, SWT.CHECK);
        check13
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check13.setText("4 - First Check");
        final Button check14 = new Button(fourthGroup, SWT.CHECK);
        check14
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check14.setText("4 - Second Check");
        final Button check15 = new Button(fourthGroup, SWT.CHECK);
        check15
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check15.setText("4 - Third Check");
        final Button check16 = new Button(fourthGroup, SWT.CHECK);
        check16
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check16.setText("4 - Fourth Check");
     
        final Composite fifthGroup = new Composite(shell, SWT.None);
        fifthGroup.setLayout(new GridLayout(2, false));
        final Button check17 = new Button(fifthGroup, SWT.CHECK);
        check17
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check17.setText("5 - First Check");
        final Button check18 = new Button(fifthGroup, SWT.CHECK);
        check18
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check18.setText("5 - Second Check");
        final Button check19 = new Button(fifthGroup, SWT.CHECK);
        check19
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check19.setText("5 - Third Check");
        final Button check20 = new Button(fifthGroup, SWT.CHECK);
        check20
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check20.setText("5 - Fourth Check");
     
        final Composite sixthGroup = new Composite(shell, SWT.None);
        sixthGroup.setLayout(new GridLayout(2, false));
        final Button check21 = new Button(sixthGroup, SWT.CHECK);
        check21
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check21.setText("6 - First Check");
        final Button check22 = new Button(sixthGroup, SWT.CHECK);
        check22
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check22.setText("6 - Second Check");
        final Button check23 = new Button(sixthGroup, SWT.CHECK);
        check23
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check23.setText("6 - Third Check");
        final Button check24 = new Button(sixthGroup, SWT.CHECK);
        check24
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        check24.setText("6 - Fourth Check");
     
        // Text fields.
        final Composite textComposite = new Composite(shell, SWT.NONE);
        textComposite.setLayout(new GridLayout(2, false));
        textComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
        final Label label1 = new Label(textComposite, SWT.NONE);
        label1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label1.setText("Text 1: ");
        final Text text1 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label2 = new Label(textComposite, SWT.NONE);
        label2.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label2.setText("Text 2: ");
        final Text text2 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label3 = new Label(textComposite, SWT.NONE);
        label3.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label3.setText("Text 3: ");
        final Text text3 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label4 = new Label(textComposite, SWT.NONE);
        label4.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label4.setText("Text 4: ");
        final Text text4 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text4.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label5 = new Label(textComposite, SWT.NONE);
        label5.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label5.setText("Text 5: ");
        final Text text5 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text5.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label6 = new Label(textComposite, SWT.NONE);
        label6.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label6.setText("Text 6: ");
        final Text text6 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label7 = new Label(textComposite, SWT.NONE);
        label7.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label7.setText("Text 7: ");
        final Text text7 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text7.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label8 = new Label(textComposite, SWT.NONE);
        label8.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label8.setText("Text 8: ");
        final Text text8 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text8.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label9 = new Label(textComposite, SWT.NONE);
        label9.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label9.setText("Text 9: ");
        final Text text9 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text9.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Label label10 = new Label(textComposite, SWT.NONE);
        label10
            .setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label10.setText("Text 10: ");
        final Text text10 =
          new Text(textComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
        text10.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
     
        // Buttons.
        final Composite buttonComposite = new Composite(shell, SWT.NONE);
        buttonComposite.setLayout(new GridLayout(2, false));
        buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        final Button okButton = new Button(buttonComposite, SWT.PUSH);
        okButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true));
        okButton.setText("Ok");
        final Button cancelButton = new Button(buttonComposite, SWT.PUSH);
        cancelButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false,
            false));
        cancelButton.setText("Cancel");
     
        shell.pack();
        shell.open();
        while (!shell.isDisposed()) {
          if (!display.readAndDispatch())
            display.sleep();
        }
        display.dispose();
      }
    C'est instantané.

    Attention, par contre, le BusyIndicator affiche un sablier mais le code exécuté dans le Runnable n'est pas exécuté dans le thread IHM...

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

  7. #7
    Nouveau membre du Club
    Inscrit en
    Juin 2006
    Messages
    31
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Juin 2006
    Messages : 31
    Points : 29
    Points
    29
    Par défaut
    Je n'osais pas le dire

    Il est intéressant pour produire rapidement (des maquettes client, par exemple) mais ne convient pas pour de la production.

    Rien de mieux que de se retrousser les manches et de mettre les mains dans le cambouis !

    Plus sérieusement, as-tu envisagé de le coder toi-même ?
    Et pourrais-tu fournir un peu plus de code ?
    (Je me répète) Les éléments de ton IHM sont-ils bindés ?

    Je m'avance peut-être mais je ne pense pas que le problème vienne de la création des éléments. J'ai conçu des IHM plus complexes et je n'ai pas noté de ralentissements flagrants...
    Existe-t-il des traitements gourmands autour de la création de ton Dialog ?

    Pour le BusyIndicator, un Display.synExec() devrait résoudre le problème, non ?

  8. #8
    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
    Salut,

    Effectivement en retravaillant un peu le code comme tu l'as fait Gueritarish ça va tout de suite mieux.

    1300371, je n'ai pas d'autres traitements gourmands, je suis en phase de prototypage.

    Merci à tous les 2, je vais mettre les mains dans le cambouis !
    J'avais rêvé une solution efficace, c'est pas encore ça ... mais effectivement pour du prototype c'est pas mal

    Je testerais le curseur, je vous tiens au courant !

    a+

  9. #9
    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
    Citation Envoyé par 1300371 Voir le message
    Pour le BusyIndicator, un Display.synExec() devrait résoudre le problème, non ?
    Si si, bien sûr. Ma remarque ne visait juste qu'à le rappeler
    Pas de questions technique par MP, les forums sont là pour ça.

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

Discussions similaires

  1. Réponses: 5
    Dernier message: 20/12/2010, 18h16
  2. Erreur lors de l'ouverture d'une boite de dialog
    Par kitue dans le forum C++Builder
    Réponses: 5
    Dernier message: 12/11/2009, 15h51
  3. [Dojo] Executer un Dialog Box à l'ouverture d'une page
    Par khattat dans le forum Bibliothèques & Frameworks
    Réponses: 8
    Dernier message: 27/03/2009, 18h02
  4. ouverture d une Dialog
    Par *alexandre* dans le forum SWT/JFace
    Réponses: 1
    Dernier message: 12/03/2008, 16h08
  5. lenteur lors de l'ouverture d'une table volumineuse
    Par gregcat dans le forum Bases de données
    Réponses: 18
    Dernier message: 19/04/2007, 08h25

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