Bug 39264 Override method dialog: Selection get's lost when toggling tree/flat mode
20030624 1. Open the setter/getter dialog, enable the tree mode 2. select some getters and setters 3. toggle to the flat list: Elements still selected 4. toggle to the tree mode: Tree collapsed (Should remember the old state) 5. Open the tree: No nodes checked, description still stays '2 of 5 selected'
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java
expanded.add(toImplementArray[i].getDeclaringType());
		}
		HashSet types= new HashSet(inheritedMethods.length);
		for (int i= 0; i < inheritedMethods.length; i++) {
			types.add(inheritedMethods[i].getDeclaringType());
		}
		
		IType[] typesArrays= (IType[]) types.toArray(new IType[types.size()]);
		ViewerSorter sorter= new OverrideMethodSorter(typeHierarchy);
		if (expanded.isEmpty() && typesArrays.length > 0) {
			sorter.sort(null, typesArrays); 
			expanded.add(typesArrays[0]);
		}
		setExpandedElements(expanded.toArray());
		
		ITreeContentProvider contentProvider= getContentProvider();
		((OverrideMethodContentProvider) contentProvider).init(inheritedMethods, typesArrays);
		setTitle(JavaUIMessages.getString("OverrideMethodDialog.dialog.title")); 
		setMessage(null);			
		setValidator(new OverrideMethodValidator(inheritedMethods.length));
		setSorter(sorter);
		setContainerMode(true);
		setSize(60, 18);			
		setInput(new Object());
	}
	
	/*
	 * @see CheckedTreeSelectionDialog#createTreeViewer(Composite)
	 */
	protected CheckboxTreeViewer createTreeViewer(Composite composite) {