Bug 47838 Make refactoring menu selection sensitive in editor [refactoring]
M5 Currently all refactoring actions are enabled in the editor's context menu. Make them selection dependent. Check if code resolve might be enough (no need to create an AST).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ChangeTypeAction.java
Object element= selection.getFirstElement();
		if (!(element instanceof IMember))
			return null;
		
		if (element instanceof IMethod) {
			IMethod method= (IMethod)element;
			String returnType= method.getReturnType();
			if (PrimitiveType.toCode(Signature.toString(returnType)) != null)
				return null;
			return method;
		} else if (element instanceof IField) {
			return (IField)element;
		}
		return null;
	}
	private static ChangeTypeRefactoring createRefactoring(ICompilationUnit cunit, ITextSelection selection) throws CoreException {
		return ChangeTypeRefactoring.create(cunit, selection.getOffset(), selection.getLength());
	}
	private RefactoringWizard createWizard(ChangeTypeRefactoring refactoring) {
		return new ChangeTypeWizard(refactoring);
	}
	private boolean checkEnabled(ITextSelection selection) {
		return fEditor != null && SelectionConverter.getInputAsCompilationUnit(fEditor) != null;
	}
	private RefactoringWizard createWizard(Refactoring refactoring) {
		return new ChangeTypeWizard((ChangeTypeRefactoring)refactoring);
	}
}