Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2006-01-27 02:35:35 +0000
committerMichael Valenta2006-01-27 02:35:35 +0000
commit4462e8c8fb7f6aac8af37411a6899fb84f33c9ac (patch)
tree4041ce57deff5894deaf7eca73cac4550cbb74a2
parent41105427159ec6a9a5187ecb2772a2246670a98f (diff)
downloadeclipse.platform.team-4462e8c8fb7f6aac8af37411a6899fb84f33c9ac.tar.gz
eclipse.platform.team-4462e8c8fb7f6aac8af37411a6899fb84f33c9ac.tar.xz
eclipse.platform.team-4462e8c8fb7f6aac8af37411a6899fb84f33c9ac.zip
Fix for empty model sync on startop
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java
index 235366420..4945308ca 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java
@@ -47,6 +47,7 @@ public abstract class SynchronizationContentProvider implements ICommonContentPr
private ISynchronizationContext context;
private Viewer viewer;
private IExtensionStateModel stateModel;
+ private boolean empty;
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
@@ -55,15 +56,20 @@ public abstract class SynchronizationContentProvider implements ICommonContentPr
if (parent instanceof IResourceMappingScope) {
IResourceMappingScope rms = (IResourceMappingScope) parent;
if (rms.getMappings(getModelProviderId()).length > 0) {
+ empty = false;
return new Object[] { getModelProvider() };
}
+ empty = true;
return new Object[0];
} else if (parent instanceof ISynchronizationContext) {
ISynchronizationContext sc = (ISynchronizationContext) parent;
if (sc.getScope().getMappings(getModelProviderId()).length > 0) {
- if (filter(parent, getDelegateContentProvider().getChildren(getModelRoot())).length > 0)
+ if (filter(parent, getDelegateContentProvider().getChildren(getModelRoot())).length > 0) {
+ empty = false;
return new Object[] { getModelProvider() };
+ }
}
+ empty = true;
return new Object[0];
}
if (parent == getModelProvider()) {
@@ -126,15 +132,20 @@ public abstract class SynchronizationContentProvider implements ICommonContentPr
if (inputElement instanceof IResourceMappingScope) {
IResourceMappingScope rms = (IResourceMappingScope) inputElement;
if (rms.getMappings(getModelProviderId()).length > 0) {
+ empty = false;
return new Object[] { getModelProvider() };
}
+ empty = true;
return new Object[0];
} else if (inputElement instanceof ISynchronizationContext) {
ISynchronizationContext sc = (ISynchronizationContext) inputElement;
if (sc.getScope().getMappings(getModelProviderId()).length > 0) {
- if (filter(getModelRoot(), getDelegateContentProvider().getChildren(getModelRoot())).length > 0)
+ if (filter(getModelRoot(), getDelegateContentProvider().getChildren(getModelRoot())).length > 0) {
+ empty = false;
return new Object[] { getModelProvider() };
+ }
}
+ empty = true;
return new Object[0];
}
if (inputElement == getModelProvider()) {
@@ -281,7 +292,11 @@ public abstract class SynchronizationContentProvider implements ICommonContentPr
Utils.syncExec(new Runnable() {
public void run() {
TreeViewer treeViewer = ((TreeViewer)getViewer());
- treeViewer.refresh(getModelProvider());
+ // TODO: Need to know if the model root is present in order to refresh properly
+ if (empty)
+ treeViewer.refresh();
+ else
+ treeViewer.refresh(getModelProvider());
}
}, getViewer().getControl());

Back to the top