Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 375353
Collapse All | Expand All

(-)src/org/eclipse/swt/widgets/FontDialog.java (-6 / +18 lines)
Lines 14-19 Link Here
14
14
15
import org.eclipse.rwt.graphics.Graphics;
15
import org.eclipse.rwt.graphics.Graphics;
16
import org.eclipse.rwt.internal.RWTMessages;
16
import org.eclipse.rwt.internal.RWTMessages;
17
import org.eclipse.rwt.widgets.DialogCallback;
18
import org.eclipse.rwt.widgets.DialogUtil;
17
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.SWTException;
20
import org.eclipse.swt.SWTException;
19
import org.eclipse.swt.events.*;
21
import org.eclipse.swt.events.*;
Lines 170-175 Link Here
170
    return fontData;
172
    return fontData;
171
  }
173
  }
172
174
175
  @Override
173
  protected void prepareOpen() {
176
  protected void prepareOpen() {
174
    initializeDefaults();
177
    initializeDefaults();
175
    createShell();
178
    createShell();
Lines 216-221 Link Here
216
    shell = new Shell( parent, SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL );
219
    shell = new Shell( parent, SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL );
217
    shell.setText( getText() );
220
    shell.setText( getText() );
218
    shell.addShellListener( new ShellAdapter() {
221
    shell.addShellListener( new ShellAdapter() {
222
      @Override
219
      public void shellClosed( ShellEvent event ) {
223
      public void shellClosed( ShellEvent event ) {
220
        handleShellClose();
224
        handleShellClose();
221
      }
225
      }
Lines 281-286 Link Here
281
    GridData listData = new GridData( SWT.FILL, SWT.FILL, true, true );
285
    GridData listData = new GridData( SWT.FILL, SWT.FILL, true, true );
282
    lstFontFamily.setLayoutData( listData );
286
    lstFontFamily.setLayoutData( listData );
283
    lstFontFamily.addSelectionListener( new SelectionAdapter() {
287
    lstFontFamily.addSelectionListener( new SelectionAdapter() {
288
      @Override
284
      public void widgetSelected( SelectionEvent event ) {
289
      public void widgetSelected( SelectionEvent event ) {
285
        int selectionIndex = lstFontFamily.getSelectionIndex();
290
        int selectionIndex = lstFontFamily.getSelectionIndex();
286
        if( selectionIndex != -1 ) {
291
        if( selectionIndex != -1 ) {
Lines 332-337 Link Here
332
    Button changeColorButton = new Button( result, SWT.PUSH );
337
    Button changeColorButton = new Button( result, SWT.PUSH );
333
    changeColorButton.setText( RWTMessages.getMessage( "RWT_FontDialogFontColorSelect" ) );
338
    changeColorButton.setText( RWTMessages.getMessage( "RWT_FontDialogFontColorSelect" ) );
334
    changeColorButton.addSelectionListener( new SelectionAdapter() {
339
    changeColorButton.addSelectionListener( new SelectionAdapter() {
340
      @Override
335
      public void widgetSelected( SelectionEvent event ) {
341
      public void widgetSelected( SelectionEvent event ) {
336
        openColorDialog();
342
        openColorDialog();
337
      }
343
      }
Lines 339-355 Link Here
339
  }
345
  }
340
346
341
  private void openColorDialog() {
347
  private void openColorDialog() {
342
    ColorDialog dialog = new ColorDialog( shell );
348
    final ColorDialog dialog = new ColorDialog( shell );
343
    dialog.setRGB( rgb );
349
    dialog.setRGB( rgb );
344
    RGB selected = dialog.open();
350
    DialogUtil.open( dialog, new DialogCallback() {
345
    if( selected != null ) {
351
      public void dialogClosed( int returnCode ) {
346
      rgb = selected;
352
        RGB selected = dialog.getRGB();
347
      updateControls();
353
        if( selected != null ) {
348
    }
354
          rgb = selected;
355
          updateControls();
356
        }
357
      }
358
    } );
349
  }
359
  }
350
360
351
  private void addChangeListeners() {
361
  private void addChangeListeners() {
352
    SelectionListener selectionListener = new SelectionAdapter() {
362
    SelectionListener selectionListener = new SelectionAdapter() {
363
      @Override
353
      public void widgetSelected( SelectionEvent event ) {
364
      public void widgetSelected( SelectionEvent event ) {
354
        updateFontData();
365
        updateFontData();
355
      }
366
      }
Lines 405-410 Link Here
405
    data.widthHint = Math.max( widthHint, minSize.x );
416
    data.widthHint = Math.max( widthHint, minSize.x );
406
    result.setLayoutData( data );
417
    result.setLayoutData( data );
407
    result.addSelectionListener( new SelectionAdapter() {
418
    result.addSelectionListener( new SelectionAdapter() {
419
      @Override
408
      public void widgetSelected( SelectionEvent event ) {
420
      public void widgetSelected( SelectionEvent event ) {
409
        FontDialog.this.returnCode = returnCode;
421
        FontDialog.this.returnCode = returnCode;
410
        shell.close();
422
        shell.close();

Return to bug 375353