Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-01-30 23:19:29 -0500
committerMichael Valenta2004-01-30 23:19:29 -0500
commitbb8cec532ed91aad0c12381e4f8876b768a8286a (patch)
tree20f064e4f714280090fe20948f30d43aa6b8f5ce
parent4ec10ad5235c73fdaa44665d3a893759827d3e44 (diff)
downloadeclipse.platform.team-bb8cec532ed91aad0c12381e4f8876b768a8286a.tar.gz
eclipse.platform.team-bb8cec532ed91aad0c12381e4f8876b768a8286a.tar.xz
eclipse.platform.team-bb8cec532ed91aad0c12381e4f8876b768a8286a.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeRoot.java3
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java34
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNode.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeBuilder.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeRoot.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeBuilder.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeSorter.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncViewerSorter.java)31
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java11
14 files changed, 86 insertions, 71 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
index ccabf452c..d7dbf0537 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
@@ -76,7 +76,7 @@ public class CVSSynchronizeViewCompareConfiguration extends TeamSubscriberPageDi
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration#getInput()
*/
- protected SyncInfoDiffNode getInput() {
+ protected SyncInfoDiffNodeRoot getInput() {
if(isGroupIncomingByComment() && getParticipant().getMode() == TeamSubscriberParticipant.INCOMING_MODE) {
return new ChangeLogDiffNodeRoot(getSyncSet());
} else {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeRoot.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeRoot.java
index 9731cb5d8..d95450a31 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeRoot.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeRoot.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNodeRoot;
import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder;
@@ -18,7 +17,7 @@ import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder;
public class ChangeLogDiffNodeRoot extends SyncInfoDiffNodeRoot {
public ChangeLogDiffNodeRoot(SyncInfoSet set) {
- super(set, ResourcesPlugin.getWorkspace().getRoot());
+ super(set);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
index 412a7106f..bbcc780ee 100644
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -80,4 +80,12 @@ x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
- share reconciling with existing (e.g. using compare contents to resolve)
- comment grouping logical view
- target migration
+
+- actions in sync view all assume that selection will have a resource (e.g refresh action).
+ - how would a refresh know what to select if a change comment node was selected, for example
+- sorter is related to input so may need to change when input does
+ - there does not appear to be a clean way to change the sorter and input without causing two refreshes
+- SyncInfoSet##getOutOfSyncDescendants(IResource) is speced to include the resource itself if it is out-of-sync
+ - this is a bit confusing as the name implies otherwise
+ - should either consider a name change or a soec change
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
index e00abc34c..bed6d297f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.team.core.subscribers.SyncInfo;
+import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
public class TreeViewerUtils {
@@ -190,7 +191,11 @@ public class TreeViewerUtils {
public static IResource getResource(Object obj) {
SyncInfo info = getSyncInfo(obj);
- if (info != null) {
+ if (info == null) {
+ if (obj instanceof SyncInfoDiffNode) {
+ return ((SyncInfoDiffNode)obj).getResource();
+ }
+ } else {
return info.getLocal();
}
return null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
index 66f060804..57070800a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -28,7 +27,6 @@ import org.eclipse.team.ui.synchronize.views.*;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
-import org.eclipse.ui.views.navigator.ResourceSorter;
/**
* Configures the following behavior of a SyncInfoDiffTreeViewer:
@@ -77,8 +75,8 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
* @param parent the parent composite
* @param viewer the viewer being initialized
*/
- public void initializeViewer(Composite parent, final StructuredViewer viewer) {
- Assert.isTrue(this.viewer == null, "A SyncInfoSetCompareConfiguration can only be used with a single viewer."); //$NON-NLS-1$
+ public void initializeViewer(Composite parent, StructuredViewer viewer) {
+ Assert.isTrue(this.viewer == null, "A DiffTreeViewerConfiguration can only be used with a single viewer."); //$NON-NLS-1$
this.viewer = viewer;
GridData data = new GridData(GridData.FILL_BOTH);
@@ -89,22 +87,34 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
initializeActions(viewer);
viewer.setLabelProvider(getLabelProvider());
- viewer.setSorter(getViewSorter());
viewer.setContentProvider(getContentProvider());
- viewer.setInput(getInput());
+ setInput(viewer);
}
/**
+ * Set the input of the viewer to a <code>SyncInfoDiffNodeRoot</code>. This will also set the
+ * sorter of the viewer to the one provided by the input.
+ * @param viewer the viewer
+ */
+ protected void setInput(StructuredViewer viewer) {
+ SyncInfoDiffNodeRoot input = getInput();
+ // TODO: must prevent sorter change from causing a refresh
+ // viewer.setInput(null); /* prevent a refresh when the sorter changes */
+ viewer.setSorter(input.getSorter());
+ viewer.setInput(input);
+ }
+
+ /**
* Get the input that will be assigned to the viewer initialized by this configuration.
* Subclass may override.
* @return the viewer input
*/
- protected SyncInfoDiffNode getInput() {
+ protected SyncInfoDiffNodeRoot getInput() {
if (getShowCompressedFolders()) {
- return new CompressedFolderDiffNodeRoot(getSyncSet(), ResourcesPlugin.getWorkspace().getRoot());
+ return new CompressedFolderDiffNodeRoot(getSyncSet());
}
- return new SyncInfoDiffNodeRoot(getSyncSet(), ResourcesPlugin.getWorkspace().getRoot());
+ return new SyncInfoDiffNodeRoot(getSyncSet());
}
/**
@@ -125,10 +135,6 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
return new SyncInfoSetContentProvider();
}
- protected ViewerSorter getViewSorter() {
- return new SyncViewerSorter(ResourceSorter.NAME);
- }
-
/**
* Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
* to initialize any listeners for the viewer.
@@ -279,7 +285,7 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
*/
public void propertyChange(PropertyChangeEvent event) {
if (viewer != null && event.getProperty().equals(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
- viewer.setInput(getInput());
+ setInput(viewer);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
index 07d44fb79..adb2fcdf6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
@@ -291,11 +291,7 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbench
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
public String getLabel(Object o) {
- IResource resource = getResource();
- if (resource == null) {
- return toString();
- }
- return resource.getName();
+ return getName();
}
/* (non-Javadoc)
@@ -304,4 +300,14 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbench
public Object getParent(Object o) {
return getParent();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DiffNode#getName()
+ */
+ public String getName() {
+ if (getResource() != null) {
+ return resource.getName();
+ }
+ return super.getName();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
index b64a574e7..ff70feb39 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
@@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder;
+import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeSorter;
/**
* @author Administrator
@@ -29,8 +30,8 @@ public class SyncInfoDiffNodeRoot extends SyncInfoDiffNode {
* @param set
* @param resource
*/
- public SyncInfoDiffNodeRoot(SyncInfoSet set, IResource resource) {
- super(null, set, resource);
+ public SyncInfoDiffNodeRoot(SyncInfoSet set) {
+ super(null, set, ResourcesPlugin.getWorkspace().getRoot());
builder = createBuilder();
builder.buildTree();
}
@@ -55,4 +56,8 @@ public class SyncInfoDiffNodeRoot extends SyncInfoDiffNode {
public void setViewer(AbstractTreeViewer viewer) {
builder.setViewer(viewer);
}
+
+ public SyncInfoDiffNodeSorter getSorter() {
+ return new SyncInfoDiffNodeSorter();
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNode.java
index a7e1ff2a9..dde05ee04 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNode.java
@@ -40,12 +40,7 @@ public class CompressedFolderDiffNode extends SyncInfoDiffNode {
IResource child = children[i];
SyncInfo info = getSyncInfoSet().getSyncInfo(child);
if (info != null) {
- if (child.getType() == IResource.FOLDER) {
- // for folders, add all out-of-sync children
- // NOTE: the method getOutOfSyncDescendants includes the out-of-sync parent
- result.addAll(Arrays.asList(getSyncInfoSet().getOutOfSyncDescendants(child)));
- } else {
- // for files, just add the info
+ if (child.getType() == IResource.FILE) {
result.add(info);
}
}
@@ -63,7 +58,7 @@ public class CompressedFolderDiffNode extends SyncInfoDiffNode {
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffNode#getName()
*/
- public String getLabel(Object o) {
+ public String getName() {
IResource resource = getResource();
return resource.getProjectRelativePath().toString();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeBuilder.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeBuilder.java
index 828691443..0f7b7feac 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeBuilder.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeBuilder.java
@@ -57,6 +57,8 @@ public class CompressedFolderDiffNodeBuilder extends SyncInfoDiffNodeBuilder {
}
private IDiffElement[] getProjectChildren(DiffNode parent, IProject project) {
+ // The out-of-sync elements could possibly include the project so the code
+ // below is written to ignore the project
SyncInfo[] outOfSync = getRoot().getSyncInfoSet().getOutOfSyncDescendants(project);
Set result = new HashSet();
Set resourcesToShow = new HashSet();
@@ -68,7 +70,7 @@ public class CompressedFolderDiffNodeBuilder extends SyncInfoDiffNodeBuilder {
} else {
if (local.getType() == IResource.FILE) {
resourcesToShow.add(local.getParent());
- } else {
+ } else if (local.getType() == IResource.FOLDER){
resourcesToShow.add(local);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeRoot.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeRoot.java
index c1e19e95f..d1b77f751 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeRoot.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/CompressedFolderDiffNodeRoot.java
@@ -16,8 +16,8 @@ import org.eclipse.team.ui.synchronize.SyncInfoDiffNodeRoot;
public class CompressedFolderDiffNodeRoot extends SyncInfoDiffNodeRoot {
- public CompressedFolderDiffNodeRoot(SyncInfoSet set, IResource resource) {
- super(set, resource);
+ public CompressedFolderDiffNodeRoot(SyncInfoSet set) {
+ super(set);
}
/* (non-Javadoc)
@@ -26,4 +26,18 @@ public class CompressedFolderDiffNodeRoot extends SyncInfoDiffNodeRoot {
protected SyncInfoDiffNodeBuilder createBuilder() {
return new CompressedFolderDiffNodeBuilder(this);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoDiffNodeRoot#getSorter()
+ */
+ public SyncInfoDiffNodeSorter getSorter() {
+ return new SyncInfoDiffNodeSorter() {
+ protected int compareNames(IResource resource1, IResource resource2) {
+ if (resource1.getType() == IResource.FOLDER && resource2.getType() == IResource.FOLDER) {
+ return collator.compare(resource1.getParent().toString(), resource2.getProjectRelativePath().toString());
+ }
+ return super.compareNames(resource1, resource2);
+ }
+ };
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeBuilder.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeBuilder.java
index a74c4d88f..c27776584 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeBuilder.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeBuilder.java
@@ -97,6 +97,7 @@ public class SyncInfoDiffNodeBuilder implements ISyncSetChangedListener {
* @see org.eclipse.team.ccvs.syncviews.views.ISyncSetChangedListener#syncSetChanged(org.eclipse.team.ccvs.syncviews.views.SyncSetChangedEvent)
*/
public void syncSetChanged(final ISyncInfoSetChangeEvent event, IProgressMonitor monitor) {
+ if (viewer == null) return;
final Control ctrl = viewer.getControl();
if (ctrl != null && !ctrl.isDisposed()) {
ctrl.getDisplay().asyncExec(new Runnable() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncViewerSorter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeSorter.java
index 3af53ff8c..c22018391 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncViewerSorter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDiffNodeSorter.java
@@ -13,28 +13,22 @@ package org.eclipse.team.ui.synchronize.views;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.team.internal.ui.synchronize.views.TreeViewerUtils;
-import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
import org.eclipse.ui.views.navigator.ResourceSorter;
/**
* This class sorts <code>SyncInfoDiffNode</code> instances.
* It is not thread safe so it should not be reused between views.
*/
-public class SyncViewerSorter extends ResourceSorter {
+public class SyncInfoDiffNodeSorter extends ResourceSorter {
- private boolean compareFullPaths = false;
-
- public SyncViewerSorter(int criteria) {
- super(criteria);
+ public SyncInfoDiffNodeSorter() {
+ super(ResourceSorter.NAME);
}
/* (non-Javadoc)
* Method declared on ViewerSorter.
*/
public int compare(Viewer viewer, Object o1, Object o2) {
- if(o1 instanceof SyncInfoDiffNode || o2 instanceof SyncInfoDiffNode) {
- compareFullPaths = isResourcePath(o1) || isResourcePath(o2);
- }
IResource resource1 = getResource(o1);
IResource resource2 = getResource(o2);
int result;
@@ -43,27 +37,8 @@ public class SyncViewerSorter extends ResourceSorter {
} else {
result = super.compare(viewer, o1, o2);
}
- compareFullPaths = false;
return result;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.views.navigator.ResourceSorter#compareNames(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IResource)
- */
- protected int compareNames(IResource resource1, IResource resource2) {
- if(compareFullPaths) {
- return collator.compare(resource1.getFullPath().toString(), resource2.getFullPath().toString());
- } else {
- return collator.compare(resource1.getName(), resource2.getName());
- }
- }
-
- protected boolean isResourcePath(Object o1) {
- if (o1 instanceof SyncInfoDiffNode) {
- return ((SyncInfoDiffNode)o1).isResourcePath();
- }
- return false;
- }
protected IResource getResource(Object obj) {
return TreeViewerUtils.getResource(obj);
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
index 4e777f9e0..ea25cdccb 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
@@ -133,7 +133,7 @@ public class SyncInfoSetContentProviderTest extends TeamTest {
SyncInfoDiffNode node = new SyncInfoDiffNode(set, resource);
assertTrue(
"Item for " + resource.getFullPath() + " is missing",
- viewer.hasItemFor(new SyncInfoDiffNode(set, resource)));
+ viewer.hasItemFor(node));
if (resource.getType() == IResource.PROJECT) continue;
IContainer parent = resource.getParent();
if (parent.getType() == IResource.PROJECT) continue;
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java
index 498ed162a..a7a7a332a 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java
@@ -10,15 +10,12 @@
*******************************************************************************/
package org.eclipse.team.tests.ui.views;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
-import org.eclipse.team.ui.synchronize.views.CompressedFolderContentProvider;
-import org.eclipse.team.ui.synchronize.views.SyncInfoLabelProvider;
+import org.eclipse.team.ui.synchronize.views.*;
import org.eclipse.ui.*;
import org.eclipse.ui.part.ViewPart;
@@ -48,13 +45,15 @@ public class ContentProviderTestView extends ViewPart {
public void createPartControl(Composite parent) {
viewer = new TestTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new CompressedFolderContentProvider());
+ viewer.setContentProvider(new SyncInfoSetContentProvider());
viewer.setLabelProvider(new SyncInfoLabelProvider());
setInput(new SyncInfoSet(new SyncInfo[0]));
}
public void setInput(SyncInfoSet set) {
- viewer.setInput(new SyncInfoDiffNode(set, ResourcesPlugin.getWorkspace().getRoot()));
+ CompressedFolderDiffNodeRoot root = new CompressedFolderDiffNodeRoot(set);
+ viewer.setSorter(root.getSorter());
+ viewer.setInput(root);
}
public void setFocus() {

Back to the top