use of org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext in project egit by eclipse.
the class GitChangeSetContentProvider method getTraversals.
@Override
protected ResourceTraversal[] getTraversals(ISynchronizationContext context, Object object) {
if (object instanceof IAdaptable) {
if (traversalCache.containsKey(object)) {
return traversalCache.get(object);
}
ResourceMapping rm = getResourceMapping(object);
if (rm == null) {
return null;
}
GitSubscriberMergeContext ctx = (GitSubscriberMergeContext) getContext();
ResourceMappingContext rmCtx = new GitSubscriberResourceMappingContext((GitResourceVariantTreeSubscriber) ctx.getSubscriber(), ctx.getSyncData());
try {
ResourceTraversal[] traversals = rm.getTraversals(rmCtx, new NullProgressMonitor());
traversalCache.put(object, traversals);
return traversals;
} catch (CoreException e) {
Activator.logError(e.getMessage(), e);
}
}
return null;
}
use of org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext 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()]);
}
Aggregations