Bug 94902 Sort members should warn about possible semantic changes
I20050509-2010 Sort members changes the order of the literals in enumerations, which changes the values of the literals and can impact compatibility between network clients and storage formats. Also under some circumstances the initialization order of fields can affect the result.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SortMembersAction.java
PlatformUI.getWorkbench().getProgressService().runInUI(context,
				new WorkbenchRunnableAdapter(op, op.getScheduleRule()),
				op.getScheduleRule());
		} catch (InvocationTargetException e) {
			ExceptionHandler.handle(e, shell, getDialogTitle(), null); 
		} catch (InterruptedException e) {
			
		}
	}
		
	private ICompilationUnit getSelectedCompilationUnit(IStructuredSelection selection) {
		if (selection.size() == 1) {
			Object element= selection.getFirstElement();
			if (element instanceof ICompilationUnit) {
				return (ICompilationUnit) element;
			} else if (element instanceof IType) {
				IType type= (IType) element;
				if (type.getParent() instanceof ICompilationUnit) { 
					return type.getCompilationUnit();
				}
			}
		}
		return null;
	}
	
	private String getDialogTitle() {
		return ActionMessages.SortMembersAction_error_title; 
	}	
}