Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-01-26 22:03:52 -0500
committerMichael Valenta2004-01-26 22:03:52 -0500
commitf7b4187742f130b1b4d4275eb714ed86c320729d (patch)
treedac6a5986a19a6af2c2df29e558cd8c3f45b60be
parent39bd9566b212ef7a455ce2f73e41aa9a1a404b93 (diff)
downloadeclipse.platform.team-f7b4187742f130b1b4d4275eb714ed86c320729d.tar.gz
eclipse.platform.team-f7b4187742f130b1b4d4275eb714ed86c320729d.tar.xz
eclipse.platform.team-f7b4187742f130b1b4d4275eb714ed86c320729d.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java37
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/TeamOperationInput.java58
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java4
3 files changed, 97 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java
index 977581a21..31992fbf1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.content;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.ui.views.navigator.ResourceSorter;
/**
@@ -17,8 +20,18 @@ import org.eclipse.ui.views.navigator.ResourceSorter;
*/
public abstract class LogicalViewProvider {
+ /**
+ * Return a content provider that can be used in a <code>TreeViewer</code>
+ * to show the hiearchical structure appropriate for this provider.
+ * @return a <code>SyncInfoSetTreeContentProvider</code>
+ */
public abstract SyncInfoSetTreeContentProvider getContentProvider();
+ /**
+ * Return a label provider that provides the text and image labels for
+ * the logical elements associated with this provider.
+ * @return
+ */
public abstract SyncInfoLabelProvider getLabelProvider();
/**
@@ -29,4 +42,28 @@ public abstract class LogicalViewProvider {
public SyncViewerSorter getSorter() {
return new SyncViewerSorter(ResourceSorter.NAME);
}
+
+ /**
+ * Return an array of <code>TeamOperationInput</code> objects that describe the resources
+ * that are contained by or make up the given logical elements. The size of the
+ * returned array of <code>TeamOperationInput</code> need not corrolate to the
+ * size of the array of logical elements. An array is returned to give the logical view
+ * provider flexibility in describing what resources make up a logical element. It
+ * is up to the client of this interface to translate the <code>TeamOperationInput</code>
+ * array into an appropriate operation input.
+ * <p>
+ * The implementor of this method is encouraged to use the provided subscriber to determine
+ * which resources are included. The <code>TeamSubscriber#members(IResource)</code> method
+ * will return resources that exists locally and also those that do not exist locally but do
+ * have a remote counterpart. This method will also exclude resources that are not supervised
+ * by the subscriber (e.g. ignored from version contgrol). The significance of this is that the
+ * logical view provider can prepare a team operation input that includes resources that need to
+ * be created locally or deleted remotely and excludes unnecessay resources.
+ *
+ * @param elements the logical elements
+ * @param subscriber the team subscriber for which the input is being prepared
+ * @param monitor a progress monitor
+ * @return the input to a team operation
+ */
+ public abstract TeamOperationInput[] getTeamOperationInput(Object[] elements, TeamSubscriber subscriber, IProgressMonitor monitor) throws CoreException;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/TeamOperationInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/TeamOperationInput.java
new file mode 100644
index 000000000..16e4837bc
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/TeamOperationInput.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.ui.synchronize.content;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * A container for the <code>IResource</code> based input to a team operation.
+ * It is used by a logical view to communicate to a team operation what
+ * resources make up a logical view element.
+ *
+ * @see LogicalViewProvider
+ */
+public class TeamOperationInput {
+
+ private IResource[] resources;
+ private int depth;
+
+ /**
+ * Create a team operation input that consists of the given resources,
+ * all of which should be traversed to the given depth.
+ * @param resources the resources to be operated on
+ * @param depth the depth to traverse the resources
+ */
+ public TeamOperationInput(IResource[] resources, int depth) {
+ this.resources = resources;
+ this.depth = depth;
+ }
+
+ /**
+ * Return the depth that the team operation should traverse the resource.
+ * The depth values are those provided by the <code>IResource</code> interface,
+ * namely <code>IResource.DEPTH_ZERO</code>, <code>IResource.DEPTH_ONE</code>
+ * or <code>IResource.DEPTH_INFINITE</code>.
+ * @return Returns the depth
+ */
+ public int getDepth() {
+ return depth;
+ }
+
+ /**
+ * Return the resources to be included in the team operation. These resources should be traversed
+ * to the depth provided by this operation input.
+ * @return Returns the resources.
+ */
+ public IResource[] getResources() {
+ return resources;
+ }
+
+}
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 58f7970bc..d34ea2fa6 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
@@ -18,7 +18,7 @@ import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.views.CompressedFolderContentProvider;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
-import org.eclipse.team.ui.synchronize.TeamSubscriberParticipantLabelProvider;
+import org.eclipse.team.ui.synchronize.content.SyncInfoDecoratingLabelProvider;
import org.eclipse.ui.*;
import org.eclipse.ui.part.ViewPart;
@@ -49,7 +49,7 @@ 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.setLabelProvider(new TeamSubscriberParticipantLabelProvider());
+ viewer.setLabelProvider(new SyncInfoDecoratingLabelProvider());
setInput(new SyncInfoSet(new SyncInfo[0]));
}

Back to the top