Bug 47874 Change Method Signature: enable if cursor is in signature [refactoring]
M5 Currently the user has to select the method name. Would be better if the refactoring will work if the cursor is inside the method's signature.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ModifyParametersAction.java
if (JavaModelUtil.filterNotPresentException(e))
				JavaPlugin.log(e);
			setEnabled(false);
		}
	}
    /*
     * @see SelectionDispatchAction#selectionChanged(ITextSelection)
     */
	public void selectionChanged(ITextSelection selection) {
		setEnabled(true);
	}
	
	/**
	 * Note: This method is for internal use only. Clients should not call this method.
	 */
	public void selectionChanged(JavaTextSelection selection) {
		try {
			setEnabled(canEnable(selection));
		} catch (JavaModelException e) {
			setEnabled(false);
		}
	}
	
	private boolean canEnable(JavaTextSelection selection) throws JavaModelException {
		IJavaElement[] elements= selection.resolveElementAtOffset(); 
		if (elements.length != 1)
			return false;
		if (! (elements[0] instanceof IMethod))
			return false;
		return ChangeSignatureRefactoring.isAvailable((IMethod)elements[0]);