Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-01-26 17:32:35 -0500
committerMichael Valenta2004-01-26 17:32:35 -0500
commit39bd9566b212ef7a455ce2f73e41aa9a1a404b93 (patch)
tree171cf2c77a934a4ff0293250dcb358d1c184ae5d
parenta6147c7745dcc53917f36951568245c8c48fd3c0 (diff)
downloadeclipse.platform.team-39bd9566b212ef7a455ce2f73e41aa9a1a404b93.tar.gz
eclipse.platform.team-39bd9566b212ef7a455ce2f73e41aa9a1a404b93.tar.xz
eclipse.platform.team-39bd9566b212ef7a455ce2f73e41aa9a1a404b93.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoDecoratingLabelProvider.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java9
2 files changed, 22 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoDecoratingLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoDecoratingLabelProvider.java
index 5b8effe6d..f881d4faf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoDecoratingLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoDecoratingLabelProvider.java
@@ -99,7 +99,7 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
public String getText(Object element) {
String name = syncInfoLabelProvider.getText(element);
if (TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_SYNCINFO_IN_LABEL)) {
- SyncInfo info = SyncInfoSetContentProvider.getSyncInfo(element);
+ SyncInfo info = syncInfoLabelProvider.getSyncInfo(element);
if (info != null && info.getKind() != SyncInfo.IN_SYNC) {
String syncKindString = SyncInfo.kindToString(info.getKind());
name = Policy.bind("TeamSubscriberSyncPage.labelWithSyncKind", name, syncKindString); //$NON-NLS-1$
@@ -116,7 +116,7 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
*/
public Image getImage(Object element) {
Image decoratedImage = null;
- IResource resource = SyncInfoSetContentProvider.getResource(element);
+ IResource resource = syncInfoLabelProvider.getResource(element);
Image image = syncInfoLabelProvider.getImage(element);
decoratedImage = getCompareImage(image, element);
decoratedImage = propagateConflicts(decoratedImage, element, resource);
@@ -124,7 +124,7 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
}
private Image getCompareImage(Image base, Object element) {
- int kind = SyncInfoSetContentProvider.getSyncKind(element);
+ int kind = getSyncKind(element);
switch (kind & SyncInfo.DIRECTION_MASK) {
case SyncInfo.OUTGOING:
kind = (kind &~ SyncInfo.OUTGOING) | SyncInfo.INCOMING;
@@ -139,7 +139,7 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
private Image propagateConflicts(Image base, Object element, IResource resource) {
if(element instanceof SyncInfoDiffNode && resource.getType() != IResource.FILE) {
// if the folder is already conflicting then don't bother propagating the conflict
- int kind = SyncInfoSetContentProvider.getSyncKind(element);
+ int kind = getSyncKind(element);
if((kind & SyncInfo.DIRECTION_MASK) != SyncInfo.CONFLICTING) {
if(((SyncInfoDiffNode)element).hasDecendantConflicts()) {
ImageDescriptor overlay = new OverlayIcon(
@@ -162,6 +162,14 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
}
return base;
}
+
+ private int getSyncKind(Object element) {
+ SyncInfo info = syncInfoLabelProvider.getSyncInfo(element);
+ if (info != null) {
+ return info.getKind();
+ }
+ return SyncInfo.IN_SYNC;
+ }
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
@@ -186,7 +194,6 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
if (columnIndex == COL_RESOURCE) {
return getImage(element);
} else if (columnIndex == COL_PARENT) {
- IResource resource = SyncInfoSetContentProvider.getResource(element);
return null;
}
return null;
@@ -199,7 +206,7 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
if (columnIndex == COL_RESOURCE) {
return getText(element);
} else if (columnIndex == COL_PARENT) {
- IResource resource = SyncInfoSetContentProvider.getResource(element);
+ IResource resource = syncInfoLabelProvider.getResource(element);
return resource.getParent().getFullPath().toString();
}
return null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java
index 33f689fda..d9f0bedc8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java
@@ -13,6 +13,7 @@ package org.eclipse.team.ui.synchronize.content;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
@@ -52,4 +53,12 @@ public class SyncInfoLabelProvider extends LabelProvider {
}
return super.getText(element);
}
+
+ public SyncInfo getSyncInfo(Object element) {
+ return SyncInfoSetContentProvider.getSyncInfo(element);
+ }
+
+ public IResource getResource(Object element) {
+ return SyncInfoSetContentProvider.getResource(element);
+ }
}

Back to the top