Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339342 - CTabFolder should throw IllegalArgumentException when a disposed control is set as its top right control
Summary: CTabFolder should throw IllegalArgumentException when a disposed control is s...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M1   Edit
Assignee: Carolyn MacLeod CLA
QA Contact: Bogdan Gheorghe CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 07:41 EST by Remy Suen CLA
Modified: 2012-06-18 14:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-03-09 07:41:01 EST
The setDefaultButton(Button) method from Decorations will throw an IllegalArgumentException when a disposed button is set, why doesn't CTabFolder's setTopRight(Control) method do the same?

Display display = new Display();
Shell shell = new Shell(display, SWT.SHELL_TRIM);
shell.setLayout(new FillLayout());

CTabFolder folder = new CTabFolder(shell, SWT.CLOSE);
Composite c = new Composite(folder, SWT.NONE);
c.dispose();
folder.setTopRight(c);

shell.open();

while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
}
display.dispose();