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 278741 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/swt/widgets/Shell.java (-5 / +9 lines)
Lines 652-661 Link Here
652
        event.processEvent();
652
        event.processEvent();
653
        if( event.doit ) {
653
        if( event.doit ) {
654
          Shell.this.dispose();
654
          Shell.this.dispose();
655
          Shell[] dialogShells = getShells();
656
          for( int i = 0; i < dialogShells.length; i++ ) {
657
            dialogShells[ i ].dispose();
658
          }
659
        }
655
        }
660
      }
656
      }
661
    } );
657
    } );
Lines 941-947 Link Here
941
  ///////////
937
  ///////////
942
  // Disposal
938
  // Disposal
943
939
944
  final void releaseParent() {
940
  void releaseChildren() {
941
    super.releaseChildren();
942
    Shell[] dialogShells = getShells();
943
    for( int i = 0; i < dialogShells.length; i++ ) {
944
      dialogShells[ i ].dispose();
945
    }
946
  }
947
  
948
  void releaseParent() {
945
    // Do not call super.releaseParent()
949
    // Do not call super.releaseParent()
946
    // This method would try to remove a child-shell from its ControlHolder
950
    // This method would try to remove a child-shell from its ControlHolder
947
    // but shells are currently not added to the ControlHolder of its parent
951
    // but shells are currently not added to the ControlHolder of its parent
(-)src/org/eclipse/swt/widgets/Shell_Test.java (+12 lines)
Lines 195-200 Link Here
195
    shell.setVisible( false );
195
    shell.setVisible( false );
196
    assertEquals( "", log.toString() );
196
    assertEquals( "", log.toString() );
197
  }
197
  }
198
  
199
  public void testCloseChildShells() {
200
    Display display = new Display();
201
    Shell shell = new Shell( display, SWT.NONE );
202
    shell.open();
203
    Shell childShell = new Shell( shell );
204
    shell.close();
205
    assertTrue( childShell.isDisposed() );
206
  }
198
207
199
  public void testDisposeChildShell() {
208
  public void testDisposeChildShell() {
200
    Display display = new Display();
209
    Display display = new Display();
Lines 203-208 Link Here
203
    Shell childShell = new Shell( shell );
212
    Shell childShell = new Shell( shell );
204
    childShell.dispose();
213
    childShell.dispose();
205
    assertTrue( childShell.isDisposed() );
214
    assertTrue( childShell.isDisposed() );
215
    childShell = new Shell( shell );
216
    shell.dispose();
217
    assertTrue( childShell.isDisposed() );
206
  }
218
  }
207
219
208
  public void testCreateDescendantShell() {
220
  public void testCreateDescendantShell() {

Return to bug 278741