Bug 38496 sort members: should be disabled on types with no members [code manipulation]
20030604 currently what you get is a no-op. not even an info dialog
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SortMembersAction.java
try {
			BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext();
			context.run(false, true, new WorkbenchRunnableAdapter(op));
		} catch (InvocationTargetException e) {
			ExceptionHandler.handle(e, shell, getDialogTitle(), null); 
		} catch (InterruptedException e) {
			
		}
	}
		
	private ICompilationUnit getSelectedCompilationUnit(IStructuredSelection selection) throws JavaModelException {
		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.getString("SortMembersAction.error.title"); 
	}	
}