Bug 29500 Cannot cancel organize imports
After selecting organize imports on my project (to reduce the 4175 warnings about unused imports I got when I upgraded to 2.1 M4), I decided that maybe this was going to take longer than I thought, so I tried to cancel the action. The cancel button on the dialog didn't to do anything. I can repeat this at will with my project. I'm using Sun's JDK 1.4.1_01 on Debian GNU/Linux, SWT/Motif.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OrganizeImportsAction.java
*/
	public OrganizeImportsAction(JavaEditor editor) {
		this(editor.getEditorSite());
		fEditor= editor;
	}
	
	/* (non-Javadoc)
	 * Method declared on SelectionDispatchAction.
	 */
	protected void selectionChanged(ITextSelection selection) {
		
	}
	
	/* (non-Javadoc)
	 * Method declared on SelectionDispatchAction.
	 */
	protected 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.COMPILATION_UNIT:
							result.add(elem);