private SubscriberChangeEvent[] handleRemovedRoot(IResource removedRoot) { // Determine if any of the roots of the compare are affected List removals = new ArrayList(resources.length); for (int j = 0; j < resources.length; j++) { IResource root = resources[j]; if (removedRoot.getFullPath().isPrefixOf(root.getFullPath())) { // The root is no longer managed by CVS removals.add(root); try { tree.flushVariants(root, IResource.DEPTH_INFINITE); } catch (TeamException e) { CVSProviderPlugin.log(e); } } } if (removals.isEmpty()) { return new SubscriberChangeEvent[0]; } // Adjust the roots of the subscriber List newRoots = new ArrayList(resources.length); newRoots.addAll(Arrays.asList(resources)); newRoots.removeAll(removals); resources = (IResource[]) newRoots.toArray(new IResource[newRoots.size()]); // Create the deltas for the removals SubscriberChangeEvent[] deltas = new SubscriberChangeEvent[removals.size()]; for (int i = 0; i < deltas.length; i++) { deltas[i] = new SubscriberChangeEvent( this, ISubscriberChangeEvent.ROOT_REMOVED, (IResource) removals.get(i)); } return deltas; }
/* (non-Javadoc) * @see org.eclipse.team.core.subscribers.TeamSubscriber#isSupervised(org.eclipse.core.resources.IResource) */ public boolean isSupervised(IResource resource) throws TeamException { if (super.isSupervised(resource)) { if (!resource.exists() && !getRemoteTree().hasResourceVariant(resource)) { // Exclude conflicting deletions return false; } if (this.resources != null) { for (int i = 0; i < resources.length; i++) { IResource root = resources[i]; if (root.getFullPath().isPrefixOf(resource.getFullPath())) { return true; } } } } return false; }