diff options
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java index 9cada75b6..92a65d4a2 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/CheckedInChangeSet.java @@ -35,128 +35,128 @@ public abstract class CheckedInChangeSet extends ChangeSet { private final SyncInfoTree set = new SyncInfoTree(); - public abstract String getAuthor(); - - public abstract Date getDate(); - - /** - * Return the SyncInfoSet that contains the resources that belong to this change set. - * @return the SyncInfoSet that contains the resources that belong to this change set - */ - public SyncInfoTree getSyncInfoSet() { - return set; - } - - /** - * Return the resources that are contained in this set. - * @return the resources that are contained in this set - */ - @Override + public abstract String getAuthor(); + + public abstract Date getDate(); + + /** + * Return the SyncInfoSet that contains the resources that belong to this change set. + * @return the SyncInfoSet that contains the resources that belong to this change set + */ + public SyncInfoTree getSyncInfoSet() { + return set; + } + + /** + * Return the resources that are contained in this set. + * @return the resources that are contained in this set + */ + @Override public IResource[] getResources() { - return set.getResources(); - } - - /** - * Return whether the set contains any files. - * @return whether the set contains any files - */ - @Override + return set.getResources(); + } + + /** + * Return whether the set contains any files. + * @return whether the set contains any files + */ + @Override public boolean isEmpty() { - return set.isEmpty(); - } - - /** - * Return true if the given file is included in this set. - * @param local a local file - * @return true if the given file is included in this set - */ - @Override + return set.isEmpty(); + } + + /** + * Return true if the given file is included in this set. + * @param local a local file + * @return true if the given file is included in this set + */ + @Override public boolean contains(IResource local) { - return set.getSyncInfo(local) != null; - } - - /** - * Add the resource to this set if it is modified - * w.r.t. the subscriber. - * @param info - */ - public void add(SyncInfo info) { - if (isValidChange(info)) { - set.add(info); - } - } - - /** - * Return whether the given sync info is a valid change - * and can be included in this set. This method is used - * by the <code>add</code> method to filter set additions. - * @param info a sync info - * @return whether the sync info is a valid member of this set - */ - protected boolean isValidChange(SyncInfo info) { - return (info != null); - } - - /** - * Add the resources to this set if they are modified - * w.r.t. the subscriber. - * @param infos the resources to be added. - */ - public void add(SyncInfo[] infos) { - try { - set.beginInput(); - for (int i = 0; i < infos.length; i++) { - SyncInfo info = infos[i]; - add(info); - } - } finally { - set.endInput(null); - } - } - - /** - * Remove the resource from the set. - * @param resource the resource to be removed - */ - @Override + return set.getSyncInfo(local) != null; + } + + /** + * Add the resource to this set if it is modified + * w.r.t. the subscriber. + * @param info + */ + public void add(SyncInfo info) { + if (isValidChange(info)) { + set.add(info); + } + } + + /** + * Return whether the given sync info is a valid change + * and can be included in this set. This method is used + * by the <code>add</code> method to filter set additions. + * @param info a sync info + * @return whether the sync info is a valid member of this set + */ + protected boolean isValidChange(SyncInfo info) { + return (info != null); + } + + /** + * Add the resources to this set if they are modified + * w.r.t. the subscriber. + * @param infos the resources to be added. + */ + public void add(SyncInfo[] infos) { + try { + set.beginInput(); + for (int i = 0; i < infos.length; i++) { + SyncInfo info = infos[i]; + add(info); + } + } finally { + set.endInput(null); + } + } + + /** + * Remove the resource from the set. + * @param resource the resource to be removed + */ + @Override public void remove(IResource resource) { - if (contains(resource)) { - set.remove(resource); - } - } - - /** - * Remove the resources from the set. - * @param resources the resources to be removed - */ - @Override + if (contains(resource)) { + set.remove(resource); + } + } + + /** + * Remove the resources from the set. + * @param resources the resources to be removed + */ + @Override public void remove(IResource[] resources) { - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - remove(resource); - } - } - - /** - * Remove the resource and it's descendants to the given depth. - * @param resource the resource to be removed - * @param depth the depth of the removal (one of - * <code>IResource.DEPTH_ZERO, IResource.DEPTH_ONE, IResource.DEPTH_INFINITE)</code> - */ - @Override + for (int i = 0; i < resources.length; i++) { + IResource resource = resources[i]; + remove(resource); + } + } + + /** + * Remove the resource and it's descendants to the given depth. + * @param resource the resource to be removed + * @param depth the depth of the removal (one of + * <code>IResource.DEPTH_ZERO, IResource.DEPTH_ONE, IResource.DEPTH_INFINITE)</code> + */ + @Override public void rootRemoved(IResource resource, int depth) { - SyncInfo[] infos = set.getSyncInfos(resource, depth); - if (infos.length > 0) { - IResource[] resources = new IResource[infos.length]; - for (int i = 0; i < resources.length; i++) { - resources[i] = infos[i].getLocal(); - } - set.removeAll(resources); - } - } - - @Override + SyncInfo[] infos = set.getSyncInfos(resource, depth); + if (infos.length > 0) { + IResource[] resources = new IResource[infos.length]; + for (int i = 0; i < resources.length; i++) { + resources[i] = infos[i].getLocal(); + } + set.removeAll(resources); + } + } + + @Override public boolean containsChildren(IResource resource, int depth) { - return set.getSyncInfos(resource, depth).length > 0; - } + return set.getSyncInfos(resource, depth).length > 0; + } } |