Search in sources :

Example 1 with GitModelObjectContainer

use of org.eclipse.egit.ui.internal.synchronize.model.GitModelObjectContainer in project egit by eclipse.

the class GitContainerMapping method getTraversals.

@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    GitModelObject[] children = ((GitModelObjectContainer) getModelObject()).getChildren();
    Set<ResourceTraversal> result = new LinkedHashSet<>();
    final GitSynchronizeDataSet dataSet;
    if (context instanceof GitSubscriberResourceMappingContext)
        dataSet = ((GitSubscriberResourceMappingContext) context).getSyncData();
    else
        dataSet = null;
    for (GitModelObject child : children) {
        if (child.isContainer())
            result.addAll(createTraversalForContainer(child, dataSet));
        else
            result.add(createTraversalForFile(child, dataSet));
    }
    return result.toArray(new ResourceTraversal[result.size()]);
}
Also used : ResourceTraversal(org.eclipse.core.resources.mapping.ResourceTraversal) LinkedHashSet(java.util.LinkedHashSet) GitSynchronizeDataSet(org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet) GitSubscriberResourceMappingContext(org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext) GitModelObjectContainer(org.eclipse.egit.ui.internal.synchronize.model.GitModelObjectContainer) GitModelObject(org.eclipse.egit.ui.internal.synchronize.model.GitModelObject)

Aggregations

LinkedHashSet (java.util.LinkedHashSet)1 ResourceTraversal (org.eclipse.core.resources.mapping.ResourceTraversal)1 GitSubscriberResourceMappingContext (org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext)1 GitSynchronizeDataSet (org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet)1 GitModelObject (org.eclipse.egit.ui.internal.synchronize.model.GitModelObject)1 GitModelObjectContainer (org.eclipse.egit.ui.internal.synchronize.model.GitModelObjectContainer)1