diff options
author | Michael Valenta | 2004-10-01 18:36:50 +0000 |
---|---|---|
committer | Michael Valenta | 2004-10-01 18:36:50 +0000 |
commit | 427c71d774c19a8f191c7ca2dc7007d24c10a5b2 (patch) | |
tree | 3b21431705b7bf8f5da54b6cb4b628c258414164 | |
parent | b0da46c43dbaec14f440aa146220ecfaf7c5f470 (diff) | |
download | eclipse.platform.team-427c71d774c19a8f191c7ca2dc7007d24c10a5b2.tar.gz eclipse.platform.team-427c71d774c19a8f191c7ca2dc7007d24c10a5b2.tar.xz eclipse.platform.team-427c71d774c19a8f191c7ca2dc7007d24c10a5b2.zip |
*** empty log message ***
5 files changed, 34 insertions, 25 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java index c71ae7814..34681ce22 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java @@ -213,7 +213,7 @@ public class CompressedFoldersModelProvider extends HierarchicalModelProvider { } } - private void addResource(SyncInfo info) { + protected void addResource(SyncInfo info) { IResource local = info.getLocal(); ISynchronizeModelElement existingNode = getModelObject(local); if (existingNode == null) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java index 9d1de1185..1a1a2f5ff 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java @@ -272,18 +272,15 @@ public class FlatModelProvider extends SynchronizeModelProvider { return flatDescriptor; } - protected void addResources(SyncInfo[] added) { - for (int i = 0; i < added.length; i++) { - SyncInfo info = added[i]; - ISynchronizeModelElement node = getModelObject(info.getLocal()); - if (node != null) { - // Somehow the node exists. Remove it and read it to ensure - // what is shown matches the contents of the sync set - removeFromViewer(info.getLocal()); - } - // Add the node to the root - node = createModelObject(getModelRoot(), info); - } + protected void addResource(SyncInfo info) { + // Add the node to the root + ISynchronizeModelElement node = getModelObject(info.getLocal()); + if (node != null) { + // Somehow the node exists. Remove it and read it to ensure + // what is shown matches the contents of the sync set + removeFromViewer(info.getLocal()); + } + createModelObject(getModelRoot(), info); } protected ISynchronizeModelElement createModelObject(ISynchronizeModelElement parent, SyncInfo info) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java index ccd9bbc20..872af02ee 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java @@ -211,4 +211,11 @@ public class HierarchicalModelProvider extends SynchronizeModelProvider { protected ISynchronizeModelElement createModelObject(ISynchronizeModelElement parent, SyncInfo info) { return createModelObject(parent, info.getLocal()); } + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider#addResource(org.eclipse.team.core.synchronize.SyncInfo) + */ + protected void addResource(SyncInfo info) { + addResource(info.getLocal()); + } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java index bdcd34040..38cecdca3 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java @@ -214,30 +214,33 @@ public abstract class SynchronizeModelProvider extends AbstractSynchronizeModelP queueForLabelUpdate(diffNode); } else { removeFromViewer(local); - addResources(new SyncInfo[] {info}); + addResource(info); + ISynchronizeModelElement node = getModelObject(info.getLocal()); + buildModelObjects(node); + } } /** - * Add the give sync infos to the provider + * Add the give sync infos to the provider, creating + * any intermediate nodes a required. * @param infos the added infos */ protected void addResources(SyncInfo[] added) { for (int i = 0; i < added.length; i++) { SyncInfo info = added[i]; - ISynchronizeModelElement node = getModelObject(info.getLocal()); - if (node != null) { - // Somehow the node exists. Remove it and read it to ensure - // what is shown matches the contents of the sync set - removeFromViewer(info.getLocal()); - } - // Add the node to the root - node = createModelObject(getModelRoot(), info); - buildModelObjects(node); + addResource(info); } } /** + * Add the give sync info to the provider, creating + * any intermediate nodes a required and adding any children as well + * @param info the added infos + */ + protected abstract void addResource(SyncInfo info); + + /** * Create the model object for the given sync info as a child of the given parent node. * @param parent the parent * @param info the info to be used for the new node diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java index 91bee853f..d14c0fc70 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java @@ -77,7 +77,9 @@ public final class ChangeSetActionGroup extends SynchronizePageActionGroup { public void run() { SyncInfo[] infos = getSyncInfoSet().getSyncInfos(); ActiveChangeSet set = createChangeSet(infos); - getActiveChangeSetManager().add(set); + if (set != null) { + getActiveChangeSetManager().add(set); + } } }); } |