Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-01-25 22:14:42 -0500
committerMichael Valenta2004-01-25 22:14:42 -0500
commitfe85d584801c6d53df102b459b7044f982ae8e9b (patch)
treeda811efb3d96d17e76d7196550f1ace22c9de8b4
parent681eb6a7768cb260370bb29712452d280e47ccf3 (diff)
downloadeclipse.platform.team-fe85d584801c6d53df102b459b7044f982ae8e9b.tar.gz
eclipse.platform.team-fe85d584801c6d53df102b459b7044f982ae8e9b.tar.xz
eclipse.platform.team-fe85d584801c6d53df102b459b7044f982ae8e9b.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogContentProvider.java24
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.classpath28
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.project30
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.template4
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/build.properties4
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.properties14
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.xml41
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java36
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoDiffNode.java125
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoLabelProvider.java60
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java187
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/TeamPlugin.java63
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties4
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java93
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java52
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java42
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java96
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolder.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderContentProvider.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderLabelProvider.java64
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncSetContentProvider.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerSorter.java46
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ITeamUIConstants.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java89
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java109
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java55
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/CompressFolderView.java36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/ILogicalView.java38
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java34
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java56
35 files changed, 1338 insertions, 151 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
index 565bc4229..bf4abcc47 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
@@ -60,7 +60,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
*/
protected Image decorateImage(Image base, Object element) {
if(element instanceof ChangeLogDiffNode) {
- return getCompressedFolderImage();
+ //TODO: return getCompressedFolderImage();
}
return super.decorateImage(base, element);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogContentProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogContentProvider.java
index f0f490f49..df517d657 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogContentProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogContentProvider.java
@@ -48,7 +48,7 @@ public class ChangeLogContentProvider extends SyncSetTreeContentProvider {
* @return
*/
private Object[] calculateRoots() {
- SyncInfoSet set = getSyncSet();
+ SyncInfoSet set = getSyncInfoSet();
SyncInfo[] infos = set.members();
commentRoots.clear();
for (int i = 0; i < infos.length; i++) {
@@ -64,28 +64,6 @@ public class ChangeLogContentProvider extends SyncSetTreeContentProvider {
}
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.synchronize.views.SyncSetTreeContentProvider#getModelParent(org.eclipse.core.resources.IResource)
- */
- protected Object getModelParent(IResource resource) {
- // TODO Auto-generated method stub
- return super.getModelParent(resource);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- return super.getParent(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- // TODO Auto-generated method stub
- return super.hasChildren(element);
- }
- /* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider#handleResourceAdditions(org.eclipse.team.ui.synchronize.ISyncInfoSetChangeEvent)
*/
protected void handleResourceAdditions(ISyncInfoSetChangeEvent event) {
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.classpath b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.classpath
new file mode 100644
index 000000000..c1075d6d5
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.classpath
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui_3.0.0/uisrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui_3.0.0/ui.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_WIN32_WIN32_X86_SRC/org.eclipse.swt.win32_3.0.0/ws/win32/swtsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.swt.win32_3.0.0/ws/win32/swt.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface_3.0.0/jfacesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jface_3.0.0/jface.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench_3.0.0/workbenchsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench_3.0.0/workbench.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.resources_3.0.0/resourcessrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.resources_3.0.0/resources.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.runtime.compatibility_3.0.0/compatibilitysrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime.compatibility_3.0.0/compatibility.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.runtime_3.0.0/runtimesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime_3.0.0/runtime.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi.util_3.0.0/utilsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi.util_3.0.0/util.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi_3.0.0/osgisrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi_3.0.0/osgi.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi_3.0.0/coresrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi_3.0.0/core.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi_3.0.0/resolversrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi_3.0.0/resolver.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi_3.0.0/defaultAdaptorsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi_3.0.0/defaultAdaptor.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.osgi_3.0.0/eclipseAdaptorsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.osgi_3.0.0/eclipseAdaptor.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.update.configurator_3.0.0/configuratorsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.update.configurator_3.0.0/configurator.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_JDT_SOURCE_SRC/org.eclipse.jdt.ui_3.0.0/jdtsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jdt.ui_3.0.0/jdt.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_JDT_SOURCE_SRC/org.eclipse.jdt.core_3.0.0/jdtcoresrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jdt.core_3.0.0/jdtcore.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench.texteditor_3.0.0/texteditorsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench.texteditor_3.0.0/texteditor.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.views_3.0.0/viewssrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.views_3.0.0/views.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.ide_3.0.0/idesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.ide_3.0.0/ide.jar"/>
+ <classpathentry kind="src" path="/org.eclipse.team.core"/>
+ <classpathentry kind="src" path="/org.eclipse.team.ui"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.compare_3.0.0/comparesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.compare_3.0.0/compare.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.project b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.project
new file mode 100644
index 000000000..1ec823061
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.project
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jdt.ui.team</name>
+ <comment></comment>
+ <projects>
+ <project>org.eclipse.team.core</project>
+ <project>org.eclipse.team.ui</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.template b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.template
new file mode 100644
index 000000000..f3bcd418c
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/.template
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form>
+ <p/><p><b>Tips on working with this plug-in project</b></p><li>For the view of the new plug-in at a glance, go to the <img href="pageImage"/><a href="OverviewPage">Overview</a>.</li><li>You can test the contributions of this plug-in by launching another instance of the workbench. On the <b>Run</b> menu, click <b>Run As</b> and choose <img href="runTimeWorkbenchImage"/><a href="action.run">Run-time Workbench</a> from the available choices.</li><li>You can add more functionality to this plug-in by adding extensions using the <a href="action.newExtension">New Extension Wizard</a>.</li><li>The plug-in project contains Java code that you can debug. Place breakpoints in Java classes. On the <b>Run</b> menu, select <b>Debug As</b> and choose <img href="runTimeWorkbenchImage"/><a href="action.debug">Run-time Workbench</a> from the available choices.</li>
+</form>
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/build.properties b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/build.properties
new file mode 100644
index 000000000..0e5fa22b8
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/build.properties
@@ -0,0 +1,4 @@
+source.jdtteam.jar = src/
+bin.includes = plugin.xml,\
+ *.jar,\
+ jdtteam.jar
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.properties b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.properties
new file mode 100644
index 000000000..47eb2e8cc
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# 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
+###############################################################################
+pluginName=Team Support Core
+providerName=Eclipse.org
+JavaLogicalView.name=Java
+JavaLogicalView.description=View the projects using the Java structure \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.xml b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.xml
new file mode 100644
index 000000000..67117ae18
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/plugin.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin
+ id="org.eclipse.jdt.ui.team"
+ name="%pluginName"
+ version="1.0.0"
+ provider-name="%providerName"
+ class="org.eclipse.jdt.ui.team.TeamPlugin">
+
+ <runtime>
+ <library name="jdtteam.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.core.runtime.compatibility"/>
+ <import plugin="org.eclipse.jdt.ui"/>
+ <import plugin="org.eclipse.jdt.core"/>
+ <import plugin="org.eclipse.ui.workbench.texteditor"/>
+ <import plugin="org.eclipse.ui.workbench"/>
+ <import plugin="org.eclipse.ui.views"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.team.core"/>
+ <import plugin="org.eclipse.team.ui"/>
+ <import plugin="org.eclipse.compare"/>
+ </requires>
+
+<!-- ***************** Logical views ********************** -->
+<extension
+ point="org.eclipse.team.ui.logicalViews">
+ <logicalView
+ name="%JavaLogicalView.name"
+ description="%JavaLogicalView.description"
+ class="org.eclipse.jdt.ui.team.JavaLogicalViewProvider"
+ id="org.eclipse.jdt.ui.team.java-logical-view">
+ </logicalView>
+</extension>
+
+</plugin>
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java
new file mode 100644
index 000000000..76f4baa9f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.jdt.ui.team;
+
+import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
+import org.eclipse.team.ui.synchronize.content.LogicalViewProvider;
+import org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider;
+
+/**
+ * The Java logical view provider
+ */
+public class JavaLogicalViewProvider extends LogicalViewProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.LogicalViewProvider#getContentProvider()
+ */
+ public SyncSetContentProvider getContentProvider() {
+ return new JavaSyncInfoSetContentProvider();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.LogicalViewProvider#getLabelProvider()
+ */
+ public SyncInfoLabelProvider getLabelProvider() {
+ return new JavaSyncInfoLabelProvider();
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoDiffNode.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoDiffNode.java
new file mode 100644
index 000000000..f86a89317
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoDiffNode.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * 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.jdt.ui.team;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.*;
+import org.eclipse.team.core.subscribers.SyncInfo;
+import org.eclipse.team.core.subscribers.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
+
+/**
+ * A <code>SyncInfoDiffNode</code> that also contains a java model element.
+ */
+public class JavaSyncInfoDiffNode extends SyncInfoDiffNode {
+
+ private IJavaElement element;
+
+ /**
+ * @param input
+ * @param resource
+ */
+ public JavaSyncInfoDiffNode(SyncInfoSet input, IResource resource, IJavaElement element) {
+ super(input, resource);
+ this.element = element;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoDiffNode#getChildSyncInfos()
+ */
+ public SyncInfo[] getDescendantSyncInfos() {
+ if (element == null) {
+ return super.getDescendantSyncInfos();
+ }
+ switch (element.getElementType()) {
+ case IJavaElement.COMPILATION_UNIT :
+ case IJavaElement.CLASS_FILE:
+ return new SyncInfo[0];
+ case IJavaElement.JAVA_PROJECT :
+ return getVisibleChildren((IJavaProject)element);
+ case IJavaElement.PACKAGE_FRAGMENT_ROOT :
+ return getVisibleChildren((IPackageFragmentRoot)element);
+ case IJavaElement.PACKAGE_FRAGMENT :
+ return getVisibleChildren((IPackageFragment)element);
+ default :
+ return super.getDescendantSyncInfos();
+ }
+ }
+
+ /*
+ * Return the out-of-sync files contained in the package.
+ */
+ private SyncInfo[] getVisibleChildren(IPackageFragment fragment) {
+ try {
+ // Packages are shallow so only look for out-of-sync files
+ // that are direct children of the folder
+ IResource resource = fragment.getCorrespondingResource();
+ if (resource == null || resource.getType() == IResource.FILE) {
+ return new SyncInfo[0];
+ }
+ IResource[] members = getSyncInfoSet().members(resource);
+ List result = new ArrayList();
+ for (int i = 0; i < members.length; i++) {
+ IResource member = members[i];
+ if (member.getType() == IResource.FILE) {
+ SyncInfo syncInfo = getSyncInfoSet().getSyncInfo(member);
+ if (syncInfo != null) {
+ result.add(syncInfo);
+ }
+ }
+ }
+ return (SyncInfo[]) result.toArray(new SyncInfo[result.size()]);
+ } catch (JavaModelException e) {
+ //TODO: log the exception?
+ return new SyncInfo[0];
+ }
+ }
+
+ /*
+ * Return the children of the IPackageFragmentRoot that should be visible.
+ * In other words, packages that contain files that are out-of-sync or
+ * packages mapped to folders taht are out-of-sync
+ */
+ private SyncInfo[] getVisibleChildren(IPackageFragmentRoot root) {
+ if (root.isArchive()) {
+ // Archives do not have resource children
+ return new SyncInfo[0];
+ }
+ IResource resource = root.getResource();
+ return getSyncInfoSet().getOutOfSyncDescendants(resource);
+ }
+
+ /*
+ * Return all the out-of-sync descendants of the project
+ */
+ private SyncInfo[] getVisibleChildren(IJavaProject project) {
+ return getSyncInfoSet().getOutOfSyncDescendants(project.getResource());
+ }
+
+ /**
+ * Return the java element associated with this diff node.
+ * @return a java element
+ */
+ public IJavaElement getElement() {
+ return element;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoDiffNode#isResourcePath()
+ */
+ public boolean isResourcePath() {
+ return element instanceof IPackageFragment;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoLabelProvider.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoLabelProvider.java
new file mode 100644
index 000000000..d37aa435e
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoLabelProvider.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.jdt.ui.team;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider;
+
+/**
+ * This delegates to the Java element label provider.
+ * TODO: What listeners need to be set up?
+ */
+public class JavaSyncInfoLabelProvider extends SyncInfoLabelProvider {
+
+ JavaElementLabelProvider javaProvider = new JavaElementLabelProvider();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ javaProvider.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object element) {
+ if (element instanceof JavaSyncInfoDiffNode) {
+ IJavaElement javaElement = ((JavaSyncInfoDiffNode)element).getElement();
+ if (javaElement != null) {
+ return javaProvider.getImage(javaElement);
+ }
+ }
+ return super.getImage(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ if (element instanceof JavaSyncInfoDiffNode) {
+ IJavaElement javaElement = ((JavaSyncInfoDiffNode)element).getElement();
+ if (javaElement != null) {
+ return javaProvider.getText(javaElement);
+ }
+ }
+ return super.getText(element);
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java
new file mode 100644
index 000000000..193193260
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * 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.jdt.ui.team;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.*;
+import org.eclipse.team.core.subscribers.SyncInfoSet;
+import org.eclipse.team.internal.ui.synchronize.views.SyncSetTreeContentProvider;
+
+/**
+ * Extend the SyncSetTreeContentProvider to show a Java model elements in the view.
+ *
+ * TODO: Refresh behavior needs to be added
+ */
+public class JavaSyncInfoSetContentProvider extends SyncSetTreeContentProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider#getModelObject(org.eclipse.core.resources.IResource)
+ */
+ public Object getModelObject(IResource resource) {
+ IJavaElement element = JavaCore.create(resource);
+ if (element != null) {
+ return new JavaSyncInfoDiffNode(getSyncInfoSet(), resource, element);
+ }
+ return super.getModelObject(resource);
+ }
+
+ private Object getModelObject(IJavaElement element) {
+ return new JavaSyncInfoDiffNode(getSyncInfoSet(), element.getResource(), element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object object) {
+ IJavaElement element = getJavaElement(object);
+ if (element == null) {
+ return getChildrenOfNonJavaElement(object);
+ }
+ return internalGetChildren(element);
+ }
+
+ private Object[] internalGetChildren(IJavaElement element) {
+ switch (element.getElementType()) {
+ case IJavaElement.JAVA_PROJECT :
+ return internalGetChildren((IJavaProject)element);
+ case IJavaElement.PACKAGE_FRAGMENT_ROOT :
+ return internalGetChildren((IPackageFragmentRoot)element);
+ case IJavaElement.PACKAGE_FRAGMENT :
+ return internalGetChildren((IPackageFragment)element);
+ default :
+ return new Object[0];
+ }
+ }
+
+ private IJavaElement getJavaElement(Object object) {
+ if (object instanceof JavaSyncInfoDiffNode) {
+ return ((JavaSyncInfoDiffNode)object).getElement();
+ }
+ return null;
+ }
+
+ /*
+ * Return the children of a non-java element
+ */
+ private Object[] getChildrenOfNonJavaElement(Object object) {
+ return super.getChildren(object);
+ }
+
+ /*
+ * Return the children of the IPackageFragmentRoot that should be visible.
+ * In other words, packages that contain files that are out-of-sync or
+ * packages mapped to folders taht are out-of-sync
+ */
+ private Object[] internalGetChildren(IPackageFragmentRoot root) {
+ if (root.isArchive()) {
+ // Archives do not have resource children
+ return new Object[0];
+ }
+ try {
+ SyncInfoSet syncInfoSet = getSyncInfoSet();
+ List result = new ArrayList();
+ IJavaElement[] javaChildren = root.getChildren();
+ for (int i = 0; i < javaChildren.length; i++) {
+ IJavaElement element = javaChildren[i];
+ if (syncInfoSet.getSyncInfo(element.getResource()) != null
+ || internalGetChildren(element).length > 0) {
+ result.add(getModelObject(element));
+ }
+ }
+ Object[] nonJavaChildren = root.getNonJavaResources();
+ for (int i = 0; i < nonJavaChildren.length; i++) {
+ Object object = nonJavaChildren[i];
+ if (object instanceof IResource) {
+ IResource resource = (IResource)object;
+ if (syncInfoSet.getSyncInfo(resource) != null || syncInfoSet.hasMembers(resource)) {
+ result.add(getModelObject(resource));
+ }
+ }
+ }
+ return result.toArray(new Object[result.size()]);
+ } catch (JavaModelException e) {
+ //TODO: log the exception?
+ return new Object[0];
+ }
+ }
+
+ private Object[] internalGetChildren(IPackageFragment fragment) {
+ try {
+ // Packages are shallow so only look for out-of-sync files
+ // that are direct children of the folder
+ IResource resource = fragment.getCorrespondingResource();
+ if (resource == null || resource.getType() == IResource.FILE) {
+ return new Object[0];
+ }
+ SyncInfoSet syncInfoSet = getSyncInfoSet();
+ IResource[] members = syncInfoSet.members(resource);
+ List result = new ArrayList();
+ for (int i = 0; i < members.length; i++) {
+ IResource member = members[i];
+ if (member.getType() == IResource.FILE) {
+ if (syncInfoSet.getSyncInfo(member) != null) {
+ result.add(getModelObject(member));
+ }
+ }
+ }
+ return result.toArray(new Object[result.size()]);
+ } catch (JavaModelException e) {
+ //TODO: log the exception?
+ return new Object[0];
+ }
+ }
+
+ private Object[] internalGetChildren(IJavaProject project) {
+ try {
+ SyncInfoSet syncInfoSet = getSyncInfoSet();
+ List result = new ArrayList();
+ IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();
+ // filter out package fragments that correspond to projects and
+ // replace them with the package fragments directly
+ for (int i= 0; i < roots.length; i++) {
+ IPackageFragmentRoot root= roots[i];
+ if (isProjectPackageFragmentRoot(root)) {
+ IJavaElement[] children= root.getChildren();
+ for (int k= 0; k < children.length; k++)
+ result.add(getModelObject(children[k]));
+ } else if (!root.isArchive() && syncInfoSet.getSyncInfo(root.getResource()) != null
+ || internalGetChildren(root).length > 0) {
+ result.add(getModelObject(root));
+ }
+ }
+
+ Object[] nonJavaChildren = project.getNonJavaResources();
+ for (int i = 0; i < nonJavaChildren.length; i++) {
+ Object object = nonJavaChildren[i];
+ if (object instanceof IResource) {
+ IResource resource = (IResource)object;
+ if (syncInfoSet.getSyncInfo(resource) != null || syncInfoSet.hasMembers(resource)) {
+ result.add(getModelObject(resource));
+ }
+ }
+ }
+ return result.toArray(new Object[result.size()]);
+ } catch (JavaModelException e) {
+ //TODO: log the exception?
+ return new Object[0];
+ }
+ }
+
+ private boolean isProjectPackageFragmentRoot(IPackageFragmentRoot root) {
+ IResource resource= root.getResource();
+ return (resource instanceof IProject);
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/TeamPlugin.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/TeamPlugin.java
new file mode 100644
index 000000000..7c96f0a14
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/TeamPlugin.java
@@ -0,0 +1,63 @@
+package org.eclipse.jdt.ui.team;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.*;
+import java.util.*;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class TeamPlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static TeamPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+
+ /**
+ * The constructor.
+ */
+ public TeamPlugin(IPluginDescriptor descriptor) {
+ super(descriptor);
+ plugin = this;
+ try {
+ resourceBundle= ResourceBundle.getBundle("org.eclipse.jdt.ui.team.TeamPluginResources");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static TeamPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle= TeamPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle!=null ? bundle.getString(key) : key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index 56c08c388..2575cafb7 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -15,6 +15,7 @@ Team=Team
configurationWizards=Configuration Wizards
targetWizards=Target Site Addition Wizards
synchronizeParticipants=Synchronize View Participants
+logicalViews=Logical Synchronize Views
TeamPreferencePage.name=Team
TextPreferencePage.name=File Content
@@ -57,3 +58,6 @@ Command.selectNextChange.description=Move to the next change
Command.selectNextChange.name=Next Change
Command.selectPreviousChange.description=Move to the previous change
Command.selectPreviousChange.name=Previous Change
+
+CompressFolderView.name=Compress Folders
+CompressFolderView.description=Compress in-sync folders paths
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 208ee373a..6f6f25553 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -30,6 +30,7 @@
<extension-point id="configurationWizards" name="%configurationWizards" schema="schema/configurationWizards.exsd"/>
<extension-point id="synchronizeParticipants" name="%synchronizeParticipants" schema="schema/synchronizeParticipants.exsd"/>
+ <extension-point id="logicalViews" name="%logicalViews" schema="schema/logicalViews.exsd"/>
<!-- **************** PREFERENCES ******************* -->
<extension
@@ -211,5 +212,14 @@
id="org.eclipse.team.ui.actionSet">
</actionSet>
</extension>
-
+<!-- ***************** Logical views ********************** -->
+<extension
+ point="org.eclipse.team.ui.logicalViews">
+ <logicalView
+ name="%CompressFolderView.name"
+ description="%CompressFolderView.description"
+ class="org.eclipse.team.ui.synchronize.content.CompressFolderView"
+ id="org.eclipse.team.ui.compressed-folder-view">
+ </logicalView>
+</extension>
</plugin>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java
new file mode 100644
index 000000000..6f405f1c1
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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.internal.ui.registry;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.team.ui.synchronize.content.ILogicalView;
+import org.eclipse.team.ui.synchronize.content.LogicalViewProvider;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+
+/**
+ *
+ * TODO: Should have an icon
+ */
+public class LogicalViewDescriptor implements ILogicalView {
+
+ public static final String ATT_ID = "id"; //$NON-NLS-1$
+ public static final String ATT_NAME = "name"; //$NON-NLS-1$
+ public static final String ATT_CLASS = "class"; //$NON-NLS-1$
+
+ private IConfigurationElement element;
+ private String label;
+ private String description;
+ private String className;
+ private String id;
+ private LogicalViewProvider provider;
+
+ public LogicalViewDescriptor(IConfigurationElement element, String descText) throws CoreException {
+ this.element = element;
+ this.description = descText;
+ loadFromExtension();
+ }
+
+ /**
+ * load a view descriptor from the registry.
+ */
+ private void loadFromExtension() throws CoreException {
+ String identifier = element.getAttribute(ATT_ID);
+ label = element.getAttribute(ATT_NAME);
+ className = element.getAttribute(ATT_CLASS);
+
+ // Sanity check.
+ if ((label == null) || (className == null) || (identifier == null)) {
+ throw new CoreException(new Status(IStatus.ERROR, element.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$
+ null));
+ }
+
+ id = identifier;
+ }
+
+ private LogicalViewProvider createProvider() throws CoreException {
+ Object obj = WorkbenchPlugin.createExtension(element, ATT_CLASS);
+ return (LogicalViewProvider) obj;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalView#getId()
+ */
+ public String getId() {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalView#getLabel()
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalView#getDescription()
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalView#getLogicalViewProvider()
+ */
+ public LogicalViewProvider getLogicalViewProvider() throws CoreException {
+ if (provider == null) {
+ provider = createProvider();
+ }
+ return provider;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java
new file mode 100644
index 000000000..e20d11024
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.internal.ui.registry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.content.ILogicalView;
+
+public class LogicalViewRegistry extends RegistryReader {
+
+ private static final String TAG_LOGICAL_VIEW = "logicalView";
+ private Map views = new HashMap();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.registry.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ protected boolean readElement(IConfigurationElement element) {
+ if (element.getName().equals(TAG_LOGICAL_VIEW)) {
+ String descText = getDescription(element);
+ LogicalViewDescriptor desc;
+ try {
+ desc = new LogicalViewDescriptor(element, descText);
+ views.put(desc.getId(), desc);
+ } catch (CoreException e) {
+ TeamUIPlugin.log(e);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public ILogicalView[] getLogicalViews() {
+ return (ILogicalView[])views.values().toArray(new ILogicalView[views.size()]);
+ }
+
+ public ILogicalView getLogicalView(String id) {
+ return (ILogicalView)views.get(id);
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
index c52c42e59..f1675c65d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
@@ -102,7 +102,7 @@ public class SynchronizeParticipantDescriptor implements ISynchronizeParticipant
// Sanity check.
if ((label == null) || (className == null) || (identifier == null)) {
- throw new CoreException(new Status(IStatus.ERROR, configElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, configElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$
null));
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java
index 11e496c7b..9a0135709 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java
@@ -56,6 +56,8 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
refactorActions.fillContextMenu(manager);
manager.add(refreshSelectionAction);
manager.add(new Separator());
+ addLogicalViewSelection(viewer, manager);
+ manager.add(new Separator());
getNavigator().fillContextMenu(viewer, manager);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java
new file mode 100644
index 000000000..668a93cd4
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.internal.ui.synchronize.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.team.ui.synchronize.content.ILogicalView;
+
+/**
+ * Action that selects an <code>ILogicalView</code>.
+ */
+public class LogicalViewAction extends Action {
+
+ private ILogicalView view;
+ private LogicalViewActionGroup group;
+
+ public LogicalViewAction(ILogicalView view, LogicalViewActionGroup group) {
+ this.view = view;
+ this.group = group;
+ setText(view.getLabel());
+ setDescription(view.getDescription());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ group.selectView(view);
+ }
+
+ public ILogicalView getView() {
+ return view;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java
new file mode 100644
index 000000000..4e791ef10
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.internal.ui.synchronize.actions;
+
+import java.util.*;
+
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration;
+import org.eclipse.team.ui.synchronize.content.ILogicalView;
+import org.eclipse.ui.actions.ActionGroup;
+
+/**
+ * Action group that populates a context menu with the available logical views.
+ */
+public class LogicalViewActionGroup extends ActionGroup {
+
+ public static final String SELECTED_VIEW = "selected-view";
+
+ Action noLogicalView;
+ List actions = new ArrayList();
+ ILogicalView selectedView;
+ IPropertyChangeListener listener;
+
+ public LogicalViewActionGroup() {
+ makeActions();
+ }
+
+ private void makeActions() {
+ noLogicalView = new Action() {
+ public void run() {
+ selectView(null);
+ }
+ };
+ Utils.initAction(noLogicalView, "action.noLogicalView.", Policy.getBundle());
+ ILogicalView[] views = SyncInfoSetCompareConfiguration.getLogicalViews();
+ for (int i = 0; i < views.length; i++) {
+ ILogicalView view = views[i];
+ actions.add(new LogicalViewAction(view, this));
+ }
+ }
+
+ public void fillContextMenu(IMenuManager parentMenu) {
+ MenuManager menu =
+ new MenuManager("Logical View"); //$NON-NLS-1$
+ menu.add(noLogicalView);
+ menu.add(new Separator());
+ boolean hasSelection = false;
+ for (Iterator iter = actions.iterator(); iter.hasNext();) {
+ LogicalViewAction element = (LogicalViewAction) iter.next();
+ menu.add(element);
+ boolean selected = isSelected(element.getView().getId());
+ hasSelection |= selected;
+ element.setChecked(selected);
+ }
+ noLogicalView.setChecked(!hasSelection);
+ parentMenu.add(menu);
+ }
+
+ private boolean isSelected(String id) {
+ if (selectedView == null || id == null) return false;
+ return selectedView.getId().equals(id);
+ }
+
+
+ /* package */ void selectView(ILogicalView view) {
+ ILogicalView oldView = selectedView;
+ selectedView = view;
+ firePropertyChangeEvent(SELECTED_VIEW, oldView, view);
+ }
+
+ public void setPropertyChangeListener(IPropertyChangeListener listener) {
+ this.listener = listener;
+ }
+
+ private void firePropertyChangeEvent(String property, Object oldValue, Object newValue) {
+ if (listener == null)
+ return;
+ listener.propertyChange(new PropertyChangeEvent(this, property, oldValue, newValue));
+ }
+
+ public void setSelectedView(ILogicalView view) {
+ selectedView = view;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolder.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolder.java
index 3744b2551..cb18aefb9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolder.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolder.java
@@ -29,7 +29,7 @@ public class CompressedFolder extends SyncInfoDiffNode {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SyncInfoDiffNode#getChildSyncInfos()
*/
- public SyncInfo[] getChildSyncInfos() {
+ public SyncInfo[] getDescendantSyncInfos() {
IResource[] children = getSyncInfoSet().members(getResource());
List result = new ArrayList();
for (int i = 0; i < children.length; i++) {
@@ -48,4 +48,12 @@ public class CompressedFolder extends SyncInfoDiffNode {
}
return (SyncInfo[]) result.toArray(new SyncInfo[result.size()]);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoDiffNode#isResourcePath()
+ */
+ public boolean isResourcePath() {
+ return true;
+ }
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderContentProvider.java
index 07d9fdcf0..502614d30 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderContentProvider.java
@@ -182,11 +182,11 @@ public class CompressedFolderContentProvider extends SyncSetTreeContentProvider
private Object[] getFolderChildren(IResource resource) {
// Folders will only contain out-of-sync children
- IResource[] children = getSyncSet().members(resource);
+ IResource[] children = getSyncInfoSet().members(resource);
List result = new ArrayList();
for (int i = 0; i < children.length; i++) {
IResource child = children[i];
- SyncInfo info = getSyncSet().getSyncInfo(child);
+ SyncInfo info = getSyncInfoSet().getSyncInfo(child);
if (info != null) {
result.add(getModelObject(info.getLocal()));
}
@@ -195,7 +195,7 @@ public class CompressedFolderContentProvider extends SyncSetTreeContentProvider
}
private Object[] getProjectChildren(IProject project) {
- SyncInfo[] outOfSync = getSyncSet().getOutOfSyncDescendants(project);
+ SyncInfo[] outOfSync = getSyncInfoSet().getOutOfSyncDescendants(project);
Set result = new HashSet();
for (int i = 0; i < outOfSync.length; i++) {
SyncInfo info = outOfSync[i];
@@ -220,8 +220,8 @@ public class CompressedFolderContentProvider extends SyncSetTreeContentProvider
* are not visible in the view).
*/
public Object getModelObject(IResource resource) {
- if (resource.getType() == IResource.FOLDER && getSyncSet().getSyncInfo(resource) == null) {
- return new CompressedFolder(getSyncSet(), resource);
+ if (resource.getType() == IResource.FOLDER && getSyncInfoSet().getSyncInfo(resource) == null) {
+ return new CompressedFolder(getSyncInfoSet(), resource);
}
return super.getModelObject(resource);
}
@@ -229,7 +229,7 @@ public class CompressedFolderContentProvider extends SyncSetTreeContentProvider
private IContainer getLowestInSyncParent(IResource resource) {
if (resource.getType() == IResource.ROOT) return (IContainer)resource;
IContainer parent = resource.getParent();
- if (getSyncSet().getSyncInfo(parent) == null) {
+ if (getSyncInfoSet().getSyncInfo(parent) == null) {
return parent;
}
return getLowestInSyncParent(parent);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderLabelProvider.java
new file mode 100644
index 000000000..4891e128a
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressedFolderLabelProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.internal.ui.synchronize.views;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider;
+
+/**
+ * Label provider for compressed folders
+ */
+public class CompressedFolderLabelProvider extends SyncInfoLabelProvider {
+
+ private Image compressedFolderImage;
+
+ public Image getCompressedFolderImage() {
+ if (compressedFolderImage == null) {
+ compressedFolderImage = TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_COMPRESSED_FOLDER).createImage();
+ }
+ return compressedFolderImage;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ if (compressedFolderImage != null) {
+ compressedFolderImage.dispose();
+ }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object element) {
+ if (element instanceof CompressedFolder) {
+ return getCompressedFolderImage();
+ }
+ return super.getImage(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ if (element instanceof CompressedFolder) {
+ IResource resource = SyncSetContentProvider.getResource(element);
+ return resource.getProjectRelativePath().toString();
+ }
+ return super.getText(element);
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncSetContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncSetContentProvider.java
index f036a0f92..67a33a05b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncSetContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncSetContentProvider.java
@@ -32,7 +32,7 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
// parents who need a label update accumulated while handling sync set changes
private Set parentsToUpdate = new HashSet();
- protected SyncInfoSet getSyncSet(Object input) {
+ protected SyncInfoSet getSyncInfoSet(Object input) {
if (input == null) {
return null;
}
@@ -45,11 +45,11 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
return null;
}
- protected SyncInfoSet getSyncSet() {
+ protected SyncInfoSet getSyncInfoSet() {
if(viewer == null || viewer.getControl().isDisposed()) {
return null;
}
- return getSyncSet(viewer.getInput());
+ return getSyncInfoSet(viewer.getInput());
}
/* (non-Javadoc)
@@ -58,8 +58,8 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
this.viewer = v;
- SyncInfoSet oldSyncSet = getSyncSet(oldInput);
- SyncInfoSet newSyncSet = getSyncSet(newInput);
+ SyncInfoSet oldSyncSet = getSyncInfoSet(oldInput);
+ SyncInfoSet newSyncSet = getSyncInfoSet(newInput);
if (oldSyncSet != newSyncSet) {
if (oldSyncSet != null) {
@@ -80,7 +80,7 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
- SyncInfoSet input = getSyncSet();
+ SyncInfoSet input = getSyncInfoSet();
if (input != null) {
input.removeSyncSetChangedListener(this);
}
@@ -183,7 +183,7 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
* out-of-sync resources.
*/
public Object[] members(IResource resource) {
- IResource[] resources = getSyncSet().members(resource);
+ IResource[] resources = getSyncInfoSet().members(resource);
Object[] result = new Object[resources.length];
for (int i = 0; i < resources.length; i++) {
IResource child = resources[i];
@@ -263,7 +263,7 @@ public abstract class SyncSetContentProvider implements IStructuredContentProvid
* @param resource
*/
public Object getModelObject(IResource resource) {
- return new SyncInfoDiffNode(getSyncSet(), resource);
+ return new SyncInfoDiffNode(getSyncInfoSet(), resource);
}
protected Object[] getModelObjects(IResource[] resources) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerSorter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerSorter.java
index 4a517183a..8a41e8042 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerSorter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerSorter.java
@@ -12,26 +12,17 @@ package org.eclipse.team.internal.ui.synchronize.views;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
import org.eclipse.ui.views.navigator.ResourceSorter;
/**
- * This class sorts the model elements that appear in the SynchronizeView
+ * 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 {
private boolean compareFullPaths = false;
- /* (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());
- }
- }
-
public SyncViewerSorter(int criteria) {
super(criteria);
}
@@ -40,14 +31,39 @@ public class SyncViewerSorter extends ResourceSorter {
* Method declared on ViewerSorter.
*/
public int compare(Viewer viewer, Object o1, Object o2) {
- if(o1 instanceof CompressedFolder || o2 instanceof CompressedFolder) {
- compareFullPaths = true;
+ if(o1 instanceof SyncInfoDiffNode || o2 instanceof SyncInfoDiffNode) {
+ compareFullPaths = isResourcePath(o1) || isResourcePath(o2);
+ }
+ IResource resource1 = getResource(o1);
+ IResource resource2 = getResource(o2);
+ int result;
+ if (resource1 != null && resource2 != null) {
+ result = super.compare(viewer, resource1, resource2);
+ } else {
+ result = super.compare(viewer, o1, o2);
}
- int result = super.compare(viewer, getResource(o1), getResource(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 SyncSetContentProvider.getResource(obj);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ITeamUIConstants.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ITeamUIConstants.java
index a582618b5..0aa50c41b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ITeamUIConstants.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ITeamUIConstants.java
@@ -16,4 +16,5 @@ public interface ITeamUIConstants {
public static final String PT_SYNCPARTICIPANTS = "synchronizeParticipants"; //$NON-NLS-1$
public static final String PT_CONFIGURATION ="configurationWizards"; //$NON-NLS-1$
public static final String PT_TARGETCONFIG ="targetConfigWizards"; //$NON-NLS-1$
+ public static final String PT_LOGICAL_VIEWS = "logicalViews"; //$NON-NLS-1$
}
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 8300aaa21..770e0c104 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
@@ -25,13 +25,14 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable {
private IResource resource;
private SyncInfoSet input;
+ // TODO: Create subclass for SyncInfoCompareInput
private SyncInfo info;
/**
* Create an ITypedElement for the given local resource. The returned ITypedElement
* will prevent editing of outgoing deletions.
*/
- public static ITypedElement createTypeElement(IResource resource, final int kind) {
+ private static ITypedElement createTypeElement(IResource resource, final int kind) {
if(resource != null && resource.exists()) {
return new LocalResourceTypedElement(resource) {
public boolean isEditable() {
@@ -49,41 +50,17 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable {
* Create an ITypedElement for the given remote resource. The contents for the remote resource
* will be retrieved from the given IStorage which is a local cache used to buffer the remote contents
*/
- public static ITypedElement createTypeElement(ISubscriberResource remoteResource) {
+ private static ITypedElement createTypeElement(ISubscriberResource remoteResource) {
return new RemoteResourceTypedElement(remoteResource);
}
/**
* Creates a new diff node.
*/
- public SyncInfoDiffNode(ITypedElement base, ITypedElement local, ITypedElement remote, int syncKind) {
+ private SyncInfoDiffNode(ITypedElement base, ITypedElement local, ITypedElement remote, int syncKind) {
super(syncKind, base, local, remote);
}
- /**
- * Construct a SynchromizeViewNode
- * @param input The SubscriberInput for the node.
- * @param resource The resource for the node
- */
- public SyncInfoDiffNode(SyncInfoSet input, IResource resource) {
- this(createBaseTypeElement(input, resource), createLocalTypeElement(input, resource), createRemoteTypeElement(input, resource), getSyncKind(input, resource));
- this.input = input;
- this.resource = resource;
- this.info = null;
- }
-
- /**
- * Construct a SynchromizeViewNode
- * @param input The SubscriberInput for the node.
- * @param resource The resource for the node
- */
- public SyncInfoDiffNode(SyncInfo info) {
- this(createBaseTypeElement(info), createLocalTypeElement(info), createRemoteTypeElement(info), info.getKind());
- this.info = info;
- this.input = null;
- this.resource = info.getLocal();
- }
-
private static ITypedElement createRemoteTypeElement(SyncInfoSet set, IResource resource) {
return createRemoteTypeElement(set.getSyncInfo(resource));
}
@@ -117,6 +94,39 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable {
return null;
}
+ private static int getSyncKind(SyncInfoSet set, IResource resource) {
+ SyncInfo info = set.getSyncInfo(resource);
+ if(info != null) {
+ return info.getKind();
+ }
+ return SyncInfo.IN_SYNC;
+ }
+
+ /**
+ * Construct a <code>SyncInfoDiffNode</code> for a resource for use in a diff tree viewer.
+ * @param set The set associated with the diff tree veiwer
+ * @param resource The resource for the node
+ */
+ public SyncInfoDiffNode(SyncInfoSet set, IResource resource) {
+ this(createBaseTypeElement(set, resource), createLocalTypeElement(set, resource), createRemoteTypeElement(set, resource), getSyncKind(set, resource));
+ this.input = set;
+ this.resource = resource;
+ this.info = null;
+ }
+
+ /**
+ * Construct a <code>SyncInfoDiffNode</code> for use in a compare input that does not
+ * make use of a diff tree viewer.
+ * TODO: Create subclass for SyncInfoCompareInput
+ * @param info The <code>SyncInfo</code> for a resource
+ */
+ public SyncInfoDiffNode(SyncInfo info) {
+ this(createBaseTypeElement(info), createLocalTypeElement(info), createRemoteTypeElement(info), info.getKind());
+ this.info = info;
+ this.input = null;
+ this.resource = info.getLocal();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@@ -139,18 +149,11 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable {
return null;
}
- protected static int getSyncKind(SyncInfoSet set, IResource resource) {
- SyncInfo info = set.getSyncInfo(resource);
- if(info != null) {
- return info.getKind();
- }
- return SyncInfo.IN_SYNC;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeViewNode#getChildSyncInfos()
+ /**
+ * Return the <code>SyncInfo</code> for all visible out-of-sync resources
+ * that are descendants of this node in the diff viewer.
*/
- public SyncInfo[] getChildSyncInfos() {
+ public SyncInfo[] getDescendantSyncInfos() {
if(input != null) {
return input.getOutOfSyncDescendants(resource);
} else if(info != null) {
@@ -230,4 +233,14 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable {
}
return false;
}
+
+ /**
+ * Indicates whether the diff node represents a resource path or a single level.
+ * This is used by the <code>SyncViewerSorter</code> to determine whether to compare
+ * the full path of two resources or justtheir names.
+ * @return whether the node represents a resource path
+ */
+ public boolean isResourcePath() {
+ return false;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
index ede2c42f0..5e29be513 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
@@ -16,7 +16,7 @@ import org.eclipse.compare.*;
import org.eclipse.compare.internal.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.action.*;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -29,9 +29,13 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.registry.LogicalViewRegistry;
+import org.eclipse.team.internal.ui.synchronize.actions.LogicalViewActionGroup;
import org.eclipse.team.internal.ui.synchronize.views.*;
+import org.eclipse.team.ui.ITeamUIConstants;
import org.eclipse.team.ui.synchronize.actions.INavigableTree;
import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
+import org.eclipse.team.ui.synchronize.content.*;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
@@ -46,6 +50,8 @@ import org.eclipse.ui.views.navigator.ResourceSorter;
*/
public class SyncInfoSetCompareConfiguration {
+ private static LogicalViewRegistry logicalViewRegistry;
+
private SyncInfoSet set;
private String menuId;
private boolean acceptParticipantMenuContributions = false;
@@ -54,6 +60,39 @@ public class SyncInfoSetCompareConfiguration {
private SyncInfoDiffTreeNavigator navigator;
private IPropertyChangeListener propertyListener;
+ private LogicalViewActionGroup logicalViews;
+
+ private static synchronized LogicalViewRegistry getLogicalViewRegistry() {
+ if (logicalViewRegistry == null) {
+ logicalViewRegistry = new LogicalViewRegistry();
+ logicalViewRegistry.readRegistry(Platform.getPluginRegistry(), TeamUIPlugin.ID, ITeamUIConstants.PT_LOGICAL_VIEWS);
+ }
+ return logicalViewRegistry;
+ }
+
+ /**
+ * Return all the logical views that have been registered with Team.
+ * The providers associated with the views will not be instantiated until
+ * they are accessed so this list can be retrieved without fear of loading
+ * client plugins.
+ * @return the regisitered logical views
+ */
+ public static ILogicalView[] getLogicalViews() {
+ return getLogicalViewRegistry().getLogicalViews();
+ }
+
+ /**
+ * Return the registered view with the given id or <code>null</code> if no view
+ * exists for the given id. The provider associated with the view will not be instantiated until
+ * it is accessed so the logical view can be retrieved without fear of loading
+ * client plugins.
+ * @param id the id of the logical view
+ * @return the logical view with the given id or <code>null</code>
+ */
+ public static ILogicalView getLogicalView(String id) {
+ return getLogicalViewRegistry().getLogicalView(id);
+ }
+
/**
* Create a <code>SyncInfoSetCompareConfiguration</code> for the given sync set
* and menuId. If the menuId is <code>null</code>, then no contributed menus will be shown
@@ -75,13 +114,15 @@ public class SyncInfoSetCompareConfiguration {
* @param viewer the viewer being initialized
*/
public void initializeViewer(Composite parent, final StructuredViewer viewer) {
- viewer.setSorter(getViewerSorter());
- viewer.setLabelProvider(getLabelProvider());
+ ILogicalView view = getDefaultLogicalView();
+ setLogicalViewProvider(viewer, view);
+ logicalViews = new LogicalViewActionGroup();
+ logicalViews.setSelectedView(view);
+
GridData data = new GridData(GridData.FILL_BOTH);
viewer.getControl().setLayoutData(data);
propertyListener = getPropertyListener(viewer);
getStore().addPropertyChangeListener(propertyListener);
- viewer.setContentProvider(getContentProvider());
initializeListeners(viewer);
@@ -107,22 +148,13 @@ public class SyncInfoSetCompareConfiguration {
}
/**
- * Get the viewer sorter that will be assigned to the viewer initialized by this configuration.
- * Subclass may override.
- * @return a viewer sorter
- */
- protected SyncViewerSorter getViewerSorter() {
- return new SyncViewerSorter(ResourceSorter.NAME);
- }
-
- /**
* Get the label provider that will be assigned to the viewer initialized by this configuration.
* Subclass may override but any created label provider should wrap the default one provided
* by this method.
* @return a label provider
*/
- protected ILabelProvider getLabelProvider() {
- return new TeamSubscriberParticipantLabelProvider();
+ protected ILabelProvider getLabelProvider(SyncInfoLabelProvider logicalProvider) {
+ return new TeamSubscriberParticipantLabelProvider(logicalProvider);
}
protected void initializeNavigation(Control tree, INavigableTree target) {
@@ -168,7 +200,8 @@ public class SyncInfoSetCompareConfiguration {
return new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
- viewer.setContentProvider(getContentProvider());
+ // TODO:
+ //viewer.setContentProvider(getContentProvider());
}
}
};
@@ -187,11 +220,11 @@ public class SyncInfoSetCompareConfiguration {
* Subclass may override but should return a subclass of <code>SyncSetContentProvider</code>.
* @return a content provider
*/
- protected IContentProvider getContentProvider() {
+ protected ILogicalView getDefaultLogicalView() {
if (getStore().getBoolean(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
- return new CompressedFolderContentProvider();
+ return getLogicalView(CompressFolderView.ID);
} else {
- return new SyncSetTreeContentProvider();
+ return null;
}
}
@@ -237,11 +270,47 @@ public class SyncInfoSetCompareConfiguration {
}
}
- protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
+ protected void fillContextMenu(final StructuredViewer viewer, IMenuManager manager) {
navigator.fillContextMenu(viewer, manager);
+ addLogicalViewSelection(viewer, manager);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
+ protected void addLogicalViewSelection(final StructuredViewer viewer, IMenuManager manager) {
+ logicalViews.fillContextMenu(manager);
+ logicalViews.setPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getProperty().equals(LogicalViewActionGroup.SELECTED_VIEW)) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ ILogicalView view = (ILogicalView)event.getNewValue();
+ setLogicalViewProvider(viewer, view);
+ }
+ });
+ }
+ }
+ });
+ }
+
+ protected void setLogicalViewProvider(StructuredViewer viewer, ILogicalView view) {
+ if (view != null) {
+ try {
+ LogicalViewProvider provider = view.getLogicalViewProvider();
+ viewer.setContentProvider(provider.getContentProvider());
+ viewer.setLabelProvider(getLabelProvider(provider.getLabelProvider()));
+ viewer.setSorter(provider.getSorter());
+ } catch (CoreException e) {
+ TeamUIPlugin.log(e);
+ view = null;
+ }
+ }
+ if (view == null) {
+ viewer.setContentProvider(new SyncSetTreeContentProvider());
+ viewer.setLabelProvider(getLabelProvider(new SyncInfoLabelProvider()));
+ viewer.setSorter(new SyncViewerSorter(ResourceSorter.NAME));
+ }
+ }
+
protected Object getTitle() {
return "Synchronization Changes";
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java
index 3f2e8ef64..5cb9a27ff 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java
@@ -21,13 +21,12 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
+import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.internal.ui.synchronize.views.CompressedFolder;
import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider;
import org.eclipse.ui.internal.WorkbenchColors;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* Provides basic labels for the subscriber participant synchronize view
@@ -45,24 +44,20 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
private static final int COL_PARENT = 1;
private boolean working = false;
- private Image compressedFolderImage;
-
// cache for folder images that have been overlayed with conflict icon
private Map fgImageCache;
- // Keep track of the compare and workbench image providers
+ // Keep track of the compare provider and sync info label provider
// so they can be properly disposed
CompareConfiguration compareConfig = new CompareConfiguration();
- WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
-
- public Image getCompressedFolderImage() {
- if (compressedFolderImage == null) {
- compressedFolderImage = TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_COMPRESSED_FOLDER).createImage();
- }
- return compressedFolderImage;
- }
+ SyncInfoLabelProvider syncInfoLabelProvider;
public TeamSubscriberParticipantLabelProvider() {
+ this(new SyncInfoLabelProvider());
+ }
+
+ public TeamSubscriberParticipantLabelProvider(SyncInfoLabelProvider syncInfoLabelProvider) {
+ Assert.isNotNull(syncInfoLabelProvider);
JobStatusHandler.addJobListener(new IJobListener() {
public void started(QualifiedName jobType) {
working = true;
@@ -89,8 +84,9 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
// The label provider may of been created after the subscriber job has been
// started.
this.working = JobStatusHandler.hasRunningJobs(TeamSubscriber.SUBSCRIBER_JOB_TYPE);
+ this.syncInfoLabelProvider = syncInfoLabelProvider;
}
-
+
protected String decorateText(String input, Object element) {
return input;
}
@@ -100,13 +96,7 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
}
public String getText(Object element) {
- String name;
- IResource resource = SyncSetContentProvider.getResource(element);
- if (element instanceof CompressedFolder) {
- name = resource.getProjectRelativePath().toString();
- } else {
- name = workbenchLabelProvider.getText(resource);
- }
+ String name = syncInfoLabelProvider.getText(element);
if (TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_SYNCINFO_IN_LABEL)) {
SyncInfo info = SyncSetContentProvider.getSyncInfo(element);
if (info != null && info.getKind() != SyncInfo.IN_SYNC) {
@@ -119,19 +109,15 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
/**
* An image is decorated by at most 3 different plugins.
- * 1. ask the workbench for the default icon for the resource
+ * 1. ask the sync info label decorator for the default icon for the resource
* 2. ask the compare plugin for the sync kind overlay
* 3. overlay the conflicting image on folders/projects containing conflicts
*/
public Image getImage(Object element) {
Image decoratedImage = null;
- IResource resource = SyncSetContentProvider.getResource(element);
- if (element instanceof CompressedFolder) {
- decoratedImage = compareConfig.getImage(getCompressedFolderImage(), IRemoteSyncElement.IN_SYNC);
- } else if(element instanceof SyncInfoDiffNode){
- Image image = workbenchLabelProvider.getImage(resource);
- decoratedImage = getCompareImage(image, element);
- }
+ IResource resource = SyncSetContentProvider.getResource(element);
+ Image image = syncInfoLabelProvider.getImage(element);
+ decoratedImage = getCompareImage(image, element);
decoratedImage = propagateConflicts(decoratedImage, element, resource);
return decorateImage(decoratedImage, element);
}
@@ -142,7 +128,7 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
case SyncInfo.OUTGOING:
kind = (kind &~ SyncInfo.OUTGOING) | SyncInfo.INCOMING;
break;
- case IRemoteSyncElement.INCOMING:
+ case SyncInfo.INCOMING:
kind = (kind &~ SyncInfo.INCOMING) | SyncInfo.OUTGOING;
break;
}
@@ -154,7 +140,7 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
// if the folder is already conflicting then don't bother propagating the conflict
int kind = SyncSetContentProvider.getSyncKind(element);
if((kind & SyncInfo.DIRECTION_MASK) != SyncInfo.CONFLICTING) {
- SyncInfo[] infos = ((SyncInfoDiffNode)element).getChildSyncInfos();
+ SyncInfo[] infos = ((SyncInfoDiffNode)element).getDescendantSyncInfos();
SyncInfoSet set = new SyncInfoSet(infos);
long count = set.countFor(SyncInfo.CONFLICTING, SyncInfo.DIRECTION_MASK);
if(count > 0) {
@@ -184,11 +170,8 @@ public class TeamSubscriberParticipantLabelProvider extends LabelProvider implem
*/
public void dispose() {
super.dispose();
- workbenchLabelProvider.dispose();
+ syncInfoLabelProvider.dispose();
compareConfig.dispose();
- if (compressedFolderImage != null) {
- compressedFolderImage.dispose();
- }
if(fgImageCache != null) {
Iterator it = fgImageCache.values().iterator();
while (it.hasNext()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java
index 204c76f8f..2b45bbd00 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SubscriberAction.java
@@ -48,7 +48,7 @@ public abstract class SubscriberAction extends TeamAction implements IViewAction
Object object = selected[i];
if (object instanceof SyncInfoDiffNode) {
SyncInfoDiffNode syncResource = (SyncInfoDiffNode) object;
- SyncInfo[] infos = syncResource.getChildSyncInfos();
+ SyncInfo[] infos = syncResource.getDescendantSyncInfos();
result.addAll(Arrays.asList(infos));
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/CompressFolderView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/CompressFolderView.java
new file mode 100644
index 000000000..e5a740dd0
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/CompressFolderView.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.team.internal.ui.synchronize.views.*;
+
+/**
+ * This implementation compresses folder paths that do not contain out-of-sync resource.
+ */
+public class CompressFolderView extends LogicalViewProvider {
+
+ public static final String ID = "org.eclipse.team.ui.compressed-folder-view";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalSyncInfoSetView#getContentProvider()
+ */
+ public SyncSetContentProvider getContentProvider() {
+ return new CompressedFolderContentProvider();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.content.ILogicalSyncInfoSetView#getLabelProvider()
+ */
+ public SyncInfoLabelProvider getLabelProvider() {
+ return new CompressedFolderLabelProvider();
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/ILogicalView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/ILogicalView.java
new file mode 100644
index 000000000..375735fe1
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/ILogicalView.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.runtime.CoreException;
+
+/**
+ * This interface provides access to the information about a logical view that
+ * can be used to display <code>SyncInfoDiffNode</code> instances in a
+ * tree viewer.
+ *
+ * <p>
+ * This interface is not intended to be implemented by clients. Clients who
+ * want to provide a logical view should implement a <code>LogicalViewProvider</code>.
+ *
+ * @see LogicalViewProvider
+ *
+ * @since 3.0
+ */
+public interface ILogicalView {
+
+ String getId();
+
+ String getLabel();
+
+ String getDescription();
+
+ LogicalViewProvider getLogicalViewProvider() throws CoreException;
+
+}
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
new file mode 100644
index 000000000..b4a04b2eb
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/LogicalViewProvider.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.team.internal.ui.synchronize.views.SyncSetContentProvider;
+import org.eclipse.team.internal.ui.synchronize.views.SyncViewerSorter;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+
+/**
+ * Implementations can be contributed via extension point and used by team participants.
+ */
+public abstract class LogicalViewProvider {
+
+ public abstract SyncSetContentProvider getContentProvider();
+
+ public abstract SyncInfoLabelProvider getLabelProvider();
+
+ /**
+ * Return the sorter to be used to sort elements from the logical view's
+ * content provider.
+ * @return a <code>SyncViewerSorter</code>
+ */
+ public SyncViewerSorter getSorter() {
+ return new SyncViewerSorter(ResourceSorter.NAME);
+ }
+}
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
new file mode 100644
index 000000000..6b87ebc45
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/content/SyncInfoLabelProvider.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+/**
+ * Provides text and image labels for <code>SyncInfo</code> and <code>SyncInfoDiffNode</code>
+ * instances by delegating to a <code>WorkbenchLabelProvider</code>.
+ */
+public class SyncInfoLabelProvider extends LabelProvider {
+
+ WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ workbenchLabelProvider.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object element) {
+ IResource resource = SyncSetContentProvider.getResource(element);
+ if (resource != null) {
+ return workbenchLabelProvider.getImage(resource);
+ }
+ return super.getImage(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ IResource resource = SyncSetContentProvider.getResource(element);
+ if (resource != null) {
+ return workbenchLabelProvider.getText(resource);
+ }
+ return super.getText(element);
+ }
+}

Back to the top