Bug 43653 Error while deleting resources
An error dialog is displayed while deleting resources, and a few exceptions are printed to the log. I haven't tested how reproducible this problem is. The machine is Eclipse-GTK-I20030925, GNOME, RedHat 9. STEPS: 1.) Make a workspace containing CVS projects for the platform-ui module, and binary projects with linked content for the remaining Eclipse projects. (this project is from a previous I-build) 2.) Select all the binary projects, from the top to the bottom. 3.) Press the "Delete" key. OBSERVED RESULTS: Deletion starts to occur, but stops at some point with an error dialog. Closing the dialog and pressing delete again completes the deletion.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OrganizeImportsAction.java
*/
	public void selectionChanged(IStructuredSelection selection) {
		setEnabled(isEnabled(selection));
	}
	
	private ICompilationUnit[] getCompilationUnits(IStructuredSelection selection) {
		HashSet result= new HashSet();
		Object[] selected= selection.toArray();
		for (int i= 0; i < selected.length; i++) {
			try {
				if (selected[i] instanceof IJavaElement) {
					IJavaElement elem= (IJavaElement) selected[i];
					switch (elem.getElementType()) {
						case IJavaElement.TYPE:
							if (elem.getParent().getElementType() == IJavaElement.COMPILATION_UNIT) {
								result.add(elem.getParent());
							}
							break;						
						case IJavaElement.COMPILATION_UNIT:
							result.add(elem);
							break;
						case IJavaElement.IMPORT_CONTAINER:
							result.add(elem.getParent());
							break;							
						case IJavaElement.PACKAGE_FRAGMENT:
							collectCompilationUnits((IPackageFragment) elem, result);
							break;
						case IJavaElement.PACKAGE_FRAGMENT_ROOT:
							collectCompilationUnits((IPackageFragmentRoot) elem, result);
							break;