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/internal/ui/actions/SelectionConverter.java
* Converts the text selection provided by the given editor into an array of
	 * Java elements. If the selection doesn't cover a Java element and the selection's
	 * length is greater than 0 the methods returns the editor's input element.
	 */
	public static IJavaElement[] codeResolveOrInput(JavaEditor editor) throws JavaModelException {
		IJavaElement input= getInput(editor);
		ITextSelection selection= (ITextSelection)editor.getSelectionProvider().getSelection();
		IJavaElement[] result= codeResolve(input, selection);
		if (result.length == 0) {
			result= new IJavaElement[] {input};
		}
		return result;
	}
	
	public static IJavaElement[] codeResolveOrInputHandled(JavaEditor editor, Shell shell, String title) {
		try {
			return codeResolveOrInput(editor);
		} catch(JavaModelException e) {
			ExceptionHandler.handle(e, shell, title, ActionMessages.getString("SelectionConverter.codeResolve_failed")); 
		}
		return null;
	}
	
	/**
	 * Converts the text selection provided by the given editor a Java element by
	 * asking the user if code reolve returned more than one result. If the selection 
	 * doesn't cover a Java element and the selection's length is greater than 0 the 
	 * methods returns the editor's input element.
	 */
	public static IJavaElement codeResolveOrInput(JavaEditor editor, Shell shell, String title, String message) throws JavaModelException {