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/PullUpAction.java
private static IMember[] convertToMemberArray(Object[] obj) {
		if (obj == null)
			return null;
		Set memberSet= new HashSet();
		memberSet.addAll(Arrays.asList(obj));
		return (IMember[]) memberSet.toArray(new IMember[memberSet.size()]);
	}
	private static RefactoringWizard createWizard(PullUpRefactoring refactoring){
		return new PullUpWizard(refactoring);
	}
		
	private void startRefactoring(IMember[] members) throws JavaModelException {
		PullUpRefactoring refactoring= createNewRefactoringInstance(members);
		Assert.isNotNull(refactoring);
		
		if (!ActionUtil.isProcessable(getShell(), refactoring.getDeclaringType()))
			return;
	
		Object newElementToProcess= new RefactoringStarter().activate(refactoring, createWizard(refactoring), getShell(), RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring"), true); 
		if (newElementToProcess == null)
			return;
		IStructuredSelection mockSelection= new StructuredSelection(newElementToProcess);
		selectionChanged(mockSelection);
		if (isEnabled())
			run(mockSelection);
		else
			MessageDialog.openInformation(getShell(), ActionMessages.getString("PullUpAction.problem.title"), ActionMessages.getString("PullUpAction.problem.message"));	 
	}	
}