Bug 17396 Organize import on multiple CUs flickers
20020521 Should use a WorkspaceModifyOperation
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OrganizeImportsAction.java
ICompilationUnit[] cus= getCompilationUnits(selection);
		boolean isEnabled= cus.length > 0;
		for (int i= 0; i < cus.length; i++) {
			if (!JavaModelUtil.isEditable(cus[i])) {
				isEnabled= false;
				break;
			}
		}
		setEnabled(isEnabled);
	}
	
	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);
							break;
						case IJavaElement.IMPORT_CONTAINER:
							result.add(elem.getParent());
							break;
						case IJavaElement.PACKAGE_FRAGMENT:
							IPackageFragment pack= (IPackageFragment) elem;
							result.addAll(Arrays.asList(pack.getCompilationUnits()));
							break;
					}