1 11 package org.eclipse.team.internal.core.mapping; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.core.resources.mapping.*; 15 import org.eclipse.team.core.mapping.ISynchronizationScope; 16 17 21 public class ResourceMappingInputScope extends AbstractResourceMappingScope { 22 23 ISynchronizationScope wrappedScope; 24 25 public ResourceMappingInputScope(ISynchronizationScope wrappedScope) { 26 27 this.wrappedScope = wrappedScope; 28 } 29 30 33 public ResourceMapping[] getInputMappings() { 34 return wrappedScope.getInputMappings(); 35 } 36 37 40 public ResourceMapping[] getMappings() { 41 return getInputMappings(); 42 } 43 44 47 public ResourceTraversal[] getTraversals() { 48 CompoundResourceTraversal result = new CompoundResourceTraversal(); 49 ResourceMapping[] mappings = getMappings(); 50 for (int i = 0; i < mappings.length; i++) { 51 ResourceMapping mapping = mappings[i]; 52 ResourceTraversal[] traversals = getTraversals(mapping); 53 result.addTraversals(traversals); 54 } 55 return result.asTraversals(); 56 } 57 58 61 public ResourceTraversal[] getTraversals(ResourceMapping mapping) { 62 if (!contains(mapping)) { 63 return null; 64 } 65 return wrappedScope.getTraversals(mapping); 66 } 67 68 private boolean contains(ResourceMapping mapping) { 69 ResourceMapping[] mappings = getMappings(); 70 for (int i = 0; i < mappings.length; i++) { 71 ResourceMapping child = mappings[i]; 72 if (child.equals(mapping)) { 73 return true; 74 } 75 } 76 return false; 77 } 78 79 82 public boolean hasAdditionalMappings() { 83 return false; 84 } 85 86 89 public boolean hasAdditonalResources() { 90 return false; 91 } 92 93 96 public ISynchronizationScope asInputScope() { 97 return this; 98 } 99 100 103 public IProject[] getProjects() { 104 return wrappedScope.getProjects(); 105 } 106 107 110 public ResourceMappingContext getContext() { 111 return wrappedScope.getContext(); 112 } 113 114 117 public void refresh(ResourceMapping[] mappings) { 118 wrappedScope.refresh(mappings); 119 } 120 } 121 | Popular Tags |