Bug 125323 Add isAncestorOf method to ResourceMapping
It would be helpful to have an isAncestorOf method on ResourceMapping. Ideally, it would be abstract but for now, it would need a defautl implementation. I will attah a patch.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/model/CompositeResourceMapping.java
private final ResourceMapping[] mappings;
    private final IProject[] projects;
    /**
     * Create a composite mapping that obtains it's traversals from a set of sub-mappings.
     * @param modelObject the model object for this mapping
     * @param mappings the sub-mappings from which the traversals are obtained
     */
    public CompositeResourceMapping(Object modelObject, ResourceMapping[] mappings) {
        this.modelObject = modelObject;
        this.mappings = mappings;
        this.projects = getProjects(mappings);
    }
    /*
     * Return an array of all the projects of the given mappings.
     */
    private IProject[] getProjects(ResourceMapping[] mappings) {
        Set result = new HashSet();
        for (int i = 0; i < mappings.length; i++) {
            ResourceMapping mapping = mappings[i];
            result.addAll(Arrays.asList(mapping.getProjects()));
        }
        return (IProject[]) result.toArray(new IProject[result.size()]);
    }
    /* (non-Javadoc)
     * @see org.eclipse.core.internal.resources.mapping.ResourceMapping#getModelObject()
     */
    public Object getModelObject() {
        return modelObject;
    }
    /* (non-Javadoc)