Bug 19104 Basket for problems with .java files outside build path
1) .java file is not inside a source folder - "Rename" refactoring is enabled but does not work: no preview and does not rename if finished is pressed. 2) .java file that is inside a non-Java project - Lots of problems when views hold on to a working copy which can not be mapped to a compilation unit after the editor has been closed - shows red squiggly lines when using "Show Source of selected element only" - same problems as 1) MORE WILL FOLLOW TOMORROW
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ModifyParametersAction.java
return;
		}
		startRefactoring();	
	}
		
	private boolean canEnable(IStructuredSelection selection){
		if (selection.isEmpty() || selection.size() != 1) 
			return false;
		
		Object first= selection.getFirstElement();
		return (first instanceof IMethod) && shouldAcceptElement((IMethod)first);
	}
		
	private boolean canRun(ITextSelection selection){
		IJavaElement[] elements= resolveElements();
		if (elements.length != 1)
			return false;
		return (elements[0] instanceof IMethod) && shouldAcceptElement((IMethod)elements[0]);
	}
	private boolean shouldAcceptElement(IMethod method) {
		try{
			fRefactoring= new ModifyParametersRefactoring(method);
			return fRefactoring.checkPreactivation().isOK();
		} catch (JavaModelException e) {
			
			if (JavaModelUtil.filterNotPresentException(e))
				JavaPlugin.log(e); 
			return false;
		}	
	}