Bug 305036 [Path Variables] Minor API changes in Dynamic Path Variables area
I'm attaching a patch illustrating what should be done in this area.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/PathVariableSelectionDialog.java
IPath selectionPath = selection[0].path;
			if (currentResource != null)
				selectionPath = URIUtil.toPath(currentResource.getPathVariableManager().resolveURI(URIUtil.toURI(selectionPath)));
			IFileInfo info = IDEResourceInfoUtils.getFileInfo(selectionPath);
			IPathVariable pathVariable = null;
			if (currentResource != null)
				pathVariable = currentResource.getPathVariableManager().getPathVariable(selection[0].name);
			if (info.exists() && info.isDirectory()
					|| (pathVariable != null && pathVariable.getExtensions() != null)) {
				extendButton.setEnabled(true);
			} else {
				extendButton.setEnabled(false);
			}
                
        } else {
			extendButton.setEnabled(false);
		}
    }
	/**
	 * Sets the resource for which the path variable is being edited.
	 * 
	 * @param resource
	 * @since 3.6
	 */
	public void setResource(IResource resource) {
		currentResource = resource;
		pathVariablesGroup.setResource(resource);
	}
}