Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-29 20:50:47 +0000
committerMichael Valenta2004-09-29 20:50:47 +0000
commitdf1442ac0fab1ceec0f2e1c7d9ea57f2b3ce89f2 (patch)
treeba33dade8d46afe17833f1c83cfd45e300777b65
parent7bc47be35fc7b148198e252db4baf4dba3570e48 (diff)
downloadeclipse.platform.team-df1442ac0fab1ceec0f2e1c7d9ea57f2b3ce89f2.tar.gz
eclipse.platform.team-df1442ac0fab1ceec0f2e1c7d9ea57f2b3ce89f2.tar.xz
eclipse.platform.team-df1442ac0fab1ceec0f2e1c7d9ea57f2b3ce89f2.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java170
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java82
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeSetModelSorter.java113
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java85
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetActionGroup.java83
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java (renamed from bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java)27
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider.java240
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelSorter.java67
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ChangeSetCapability.java75
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetChangeSetCollector.java13
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs18
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSChangeSetTests.java18
20 files changed, 637 insertions, 409 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java
index edf7e1de1..dc59a4f03 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java
@@ -24,24 +24,9 @@ import java.util.Date;
* the state before and after the resources were checked-in.
* @since 3.1
*/
-public class CheckedInChangeSet extends ChangeSet {
-
- private String comment;
- private String author;
- private Date date;
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ChangeSet#getComment()
- */
- public String getComment() {
- return comment;
- }
+public abstract class CheckedInChangeSet extends ChangeSet {
- public String getAuthor() {
- return author;
- }
+ public abstract String getAuthor();
- public Date getDate() {
- return date;
- }
+ public abstract Date getDate();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
index a813b3abf..05bb0c15d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
@@ -10,52 +10,32 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.text.DateFormat;
+import java.util.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.variants.IResourceVariant;
-import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteResource;
+import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.resources.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation.LogEntryCache;
-import org.eclipse.team.internal.ccvs.ui.subscriber.ChangeLogModelProvider.CVSUpdatableSyncInfo;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.SyncInfoSetChangeSetCollector;
+import org.eclipse.team.ui.synchronize.*;
/**
* Collector that fetches the log for incoming CVS change sets
@@ -70,6 +50,23 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
private boolean shutdown = false;
private FetchLogEntriesJob fetchLogEntriesJob;
+ private DefaultCheckedInChangeSet defaultSet;
+
+ /* *****************************************************************************
+ * Special sync info that has its kind already calculated.
+ */
+ public class CVSUpdatableSyncInfo extends CVSSyncInfo {
+ public int kind;
+ public CVSUpdatableSyncInfo(int kind, IResource local, IResourceVariant base, IResourceVariant remote, Subscriber s) {
+ super(local, base, remote, s);
+ this.kind = kind;
+ }
+
+ protected int calculateKind() throws TeamException {
+ return kind;
+ }
+ }
+
/* *****************************************************************************
* Background job to fetch commit comments and update view
*/
@@ -109,6 +106,69 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
}
};
+ private class DefaultCheckedInChangeSet extends CheckedInChangeSet {
+
+ private Date date = new Date();
+
+ public DefaultCheckedInChangeSet() {
+ setName("[Unassigned]");
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.CheckedInChangeSet#getAuthor()
+ */
+ public String getAuthor() {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.CheckedInChangeSet#getDate()
+ */
+ public Date getDate() {
+ return date;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.ChangeSet#getComment()
+ */
+ public String getComment() {
+ return "Unassigned";
+ }
+
+ }
+
+ private class CVSCheckedInChangeSet extends CheckedInChangeSet {
+
+ private final ILogEntry entry;
+
+ public CVSCheckedInChangeSet(ILogEntry entry) {
+ this.entry = entry;
+ String date = DateFormat.getDateTimeInstance().format(entry.getDate());
+ String comment = HistoryView.flattenText(entry.getComment());
+ setName("["+entry.getAuthor()+ "] (" + date +") " + comment); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.CheckedInChangeSet#getAuthor()
+ */
+ public String getAuthor() {
+ return entry.getAuthor();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.CheckedInChangeSet#getDate()
+ */
+ public Date getDate() {
+ return entry.getDate();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.ChangeSet#getComment()
+ */
+ public String getComment() {
+ return getComment();
+ }
+ }
+
public CVSChangeSetCollector(ISynchronizePageConfiguration configuration) {
super(configuration);
}
@@ -120,6 +180,21 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
startUpdateJob(new SyncInfoSet(infos));
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoSetChangeSetCollector#reset(org.eclipse.team.core.synchronize.SyncInfoSet)
+ */
+ public void reset(SyncInfoSet seedSet) {
+ // Cancel any currently running job
+ if (fetchLogEntriesJob != null) {
+ try {
+ fetchLogEntriesJob.cancel();
+ fetchLogEntriesJob.join();
+ } catch (InterruptedException e) {
+ }
+ }
+ super.reset(seedSet);
+ }
+
private synchronized void startUpdateJob(SyncInfoSet set) {
if(fetchLogEntriesJob == null) {
fetchLogEntriesJob = new FetchLogEntriesJob();
@@ -485,10 +560,37 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
// The info was not retrieved for the remote change for some reason.
// Add the node to the root
ChangeSet set = getDefaultChangeSet();
+ if (set == null) {
+ set = createDefaultChangeSet();
+ add(set);
+ }
set.add(info);
}
}
+ private ChangeSet getDefaultChangeSet() {
+ return defaultSet;
+ }
+
+ private ChangeSet createDefaultChangeSet() {
+ return new DefaultCheckedInChangeSet();
+ }
+
+ private ChangeSet createChangeSetFor(ILogEntry logEntry) {
+ return new CVSCheckedInChangeSet(logEntry);
+ }
+
+ private ChangeSet getChangeSetFor(ILogEntry logEntry) {
+ ChangeSet[] sets = getSets();
+ for (int i = 0; i < sets.length; i++) {
+ ChangeSet set = sets[i];
+ if (set.getComment() == logEntry.getComment()) {
+ return set;
+ }
+ }
+ return null;
+ }
+
private boolean requiresCustomSyncInfo(SyncInfo info, ICVSRemoteResource remoteResource, ILogEntry logEntry) {
// Only interested in non-deletions
if (logEntry.isDeletion() || !(info instanceof CVSSyncInfo)) return false;
@@ -498,4 +600,14 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
if (remote == null) return true;
return !remote.equals(remoteResource);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.ChangeSetCollector#remove(org.eclipse.team.core.subscribers.ChangeSet)
+ */
+ public void remove(ChangeSet set) {
+ super.remove(set);
+ if (set == defaultSet) {
+ defaultSet = null;
+ }
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
index 354a09202..266799ce5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
@@ -37,7 +37,6 @@ public class CVSParticipant extends SubscriberParticipant {
// The decorator adds itself to the configuration
ILabelDecorator labelDecorator = new CVSParticipantLabelDecorator(configuration);
configuration.addLabelDecorator(labelDecorator);
- configuration.setProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER, CVSUIPlugin.getPlugin().getChangeSetManager());
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java
deleted file mode 100644
index 73b80a785..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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.ccvs.ui.subscriber;
-
-import java.text.DateFormat;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ccvs.ui.*;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ui.synchronize.SynchronizeModelElement;
-import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
-
-/**
- * A model element corresponding to a "commit set". It displays a CVS
- * log entry using a currently fixed format. A commit doesn't have an
- * associated resource.
- *
- * @since 3.0
- */
-public class ChangeLogDiffNode extends SynchronizeModelElement {
-
- private ILogEntry logEntry;
-
- public ChangeLogDiffNode(ISynchronizeModelElement parent, ILogEntry logEntry) {
- super(parent);
- this.logEntry = logEntry;
- }
-
- public ILogEntry getComment() {
- return logEntry;
- }
-
- public boolean equals(Object obj) {
- return (obj == this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CHANGELOG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.compare.structuremergeviewer.DiffNode#getName()
- */
- public String getName() {
- String date = DateFormat.getDateTimeInstance().format(logEntry.getDate());
- String comment = HistoryView.flattenText(logEntry.getComment());
- return "["+logEntry.getAuthor()+ "] (" + date +") " + comment; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoModelElement#toString()
- */
- public String toString() {
- return getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement#getResource()
- */
- public IResource getResource() {
- return null;
- }
-
- public String getShortName() {
- String date = DateFormat.getDateTimeInstance().format(logEntry.getDate());
- return "["+logEntry.getAuthor()+ "] (" + date +")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeSetModelSorter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeSetModelSorter.java
deleted file mode 100644
index ebd77282b..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeSetModelSorter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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.ccvs.ui.subscriber;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.team.core.subscribers.ActiveChangeSet;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
-import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
-
-/**
- * Sorter for the change log model provider.
- *
- * @since 3.0
- */
-public class ChangeSetModelSorter extends ViewerSorter {
-
- private int commentCriteria;
- private ChangeLogModelProvider provider;
-
- // Comment sorting options
- public final static int DATE = 1;
- public final static int COMMENT = 2;
- public final static int USER = 3;
-
- public ChangeSetModelSorter(ChangeLogModelProvider provider, int commentCriteria) {
- this.provider = provider;
- this.commentCriteria = commentCriteria;
- }
-
- protected int classComparison(Object element) {
- if (element instanceof ChangeSetDiffNode) {
- return 0;
- }
- if (element instanceof ChangeLogDiffNode) {
- return 1;
- }
- return 2;
- }
-
- protected int compareClass(Object element1, Object element2) {
- return classComparison(element1) - classComparison(element2);
- }
-
- protected int compareNames(String s1, String s2) {
- return collator.compare(s1, s2);
- }
-
- /* (non-Javadoc)
- * Method declared on ViewerSorter.
- */
- public int compare(Viewer viewer, Object o1, Object o2) {
- //have to deal with non-resources in navigator
- //if one or both objects are not resources, returned a comparison
- //based on class.
- if (o1 instanceof ChangeSetDiffNode && o2 instanceof ChangeSetDiffNode) {
- ActiveChangeSet s1 = (ActiveChangeSet)((ChangeSetDiffNode) o1).getSet();
- ActiveChangeSet s2 = (ActiveChangeSet)((ChangeSetDiffNode) o2).getSet();
- return compareNames(s1.getTitle(), s2.getTitle());
- }
-
- if (o1 instanceof ChangeLogDiffNode && o2 instanceof ChangeLogDiffNode) {
- ILogEntry r1 = ((ChangeLogDiffNode) o1).getComment();
- ILogEntry r2 = ((ChangeLogDiffNode) o2).getComment();
-
- if (commentCriteria == DATE)
- return r1.getDate().compareTo(r2.getDate());
- else if (commentCriteria == COMMENT)
- return compareNames(r1.getComment(), r2.getComment());
- else if (commentCriteria == USER)
- return compareNames(r1.getAuthor(), r2.getAuthor());
- else
- return 0;
- }
-
- if (o1 instanceof ChangeSetDiffNode)
- return 1;
- else if (o2 instanceof ChangeSetDiffNode)
- return -1;
-
- if (o1 instanceof ChangeLogDiffNode)
- return 1;
- else if (o2 instanceof ChangeLogDiffNode)
- return -1;
-
- if (o1 instanceof ISynchronizeModelElement && o2 instanceof ISynchronizeModelElement) {
- ViewerSorter embeddedSorter = provider.getEmbeddedSorter();
- if (embeddedSorter != null) {
- return embeddedSorter.compare(viewer, o1, o2);
- } else {
- compareNames(((ISynchronizeModelElement)o1).getName(), ((ISynchronizeModelElement)o2).getName());
- }
- } else if (o1 instanceof ISynchronizeModelElement)
- return 1;
- else if (o2 instanceof ISynchronizeModelElement)
- return -1;
-
- return 0;
- }
-
- public int getCommentCriteria() {
- return commentCriteria;
- }
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index c51045b65..97c42107f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -160,7 +160,6 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
ISynchronizePageConfiguration.P_CONTEXT_MENU,
NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP);
configuration.addActionContribution(new CompareParticipantActionContribution());
- new ChangeLogModelManager(configuration);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index 4c6e0dfe1..16ce5a9af 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -262,9 +262,6 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
configuration.setSupportedModes(ISynchronizePageConfiguration.INCOMING_MODE | ISynchronizePageConfiguration.CONFLICTING_MODE);
configuration.setMode(ISynchronizePageConfiguration.INCOMING_MODE);
configuration.addActionContribution(new MergeParticipantActionContribution());
-
- // The manager adds itself to the configuration in it's constructor
- new ChangeLogModelManager(configuration);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index b52bf3338..1e7d0415b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -11,10 +11,15 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
+import org.eclipse.team.core.subscribers.SubscriberChangeSetCollector;
+import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -40,6 +45,8 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_3 = "context_group_3"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_4 = "context_group_4"; //$NON-NLS-1$
+ private WorkspaceChangeSetCapability capability;
+
/**
* CVS workspace action contribution
*/
@@ -118,6 +125,70 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
}
}
+ public class WorkspaceChangeSetCapability extends ChangeSetCapability {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#supportsCheckedInChangeSets()
+ */
+ public boolean supportsCheckedInChangeSets() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#supportsActiveChangeSets()
+ */
+ public boolean supportsActiveChangeSets() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#createChangeSet(org.eclipse.team.core.synchronize.SyncInfo[])
+ */
+ public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, SyncInfo[] infos) {
+ ActiveChangeSet set = getActiveChangeSetManager().createSet(Policy.bind("ChangeLogModelProvider.1"), new SyncInfo[0]); //$NON-NLS-1$
+ CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, getResources(infos),
+ Policy.bind("ChangeLogModelProvider.2"), Policy.bind("ChangeLogModelProvider.3")); //$NON-NLS-1$ //$NON-NLS-2$
+ dialog.open();
+ if (dialog.getReturnCode() != InputDialog.OK) return null;
+ set.add(infos);
+ return set;
+ }
+
+ private IResource[] getResources(SyncInfo[] infos) {
+ IResource[] resources = new IResource[infos.length];
+ for (int i = 0; i < resources.length; i++) {
+ resources[i] = infos[i].getLocal();
+ }
+ return resources;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#editChangeSet(org.eclipse.team.core.subscribers.ActiveChangeSet)
+ */
+ public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {
+ CommitSetDialog dialog = new CommitSetDialog(configuration.getSite().getShell(), set, set.getResources(),
+ Policy.bind("ChangeLogModelProvider.7"), Policy.bind("ChangeLogModelProvider.8")); //$NON-NLS-1$ //$NON-NLS-2$
+ dialog.open();
+ if (dialog.getReturnCode() != InputDialog.OK) return;
+ // Nothing to do here as the set was updated by the dialog
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#createCheckedInChangeSetCollector(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration)
+ */
+ public SyncInfoSetChangeSetCollector createCheckedInChangeSetCollector(ISynchronizePageConfiguration configuration) {
+ return new CVSChangeSetCollector(configuration);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ChangeSetCapability#getActiveChangeSetManager()
+ */
+ public SubscriberChangeSetCollector getActiveChangeSetManager() {
+ return CVSUIPlugin.getPlugin().getChangeSetManager();
+ }
+
+ }
+
/**
* No arg contructor used for
* creation of persisted participant after startup
@@ -150,10 +221,6 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
configuration.setSupportedModes(ISynchronizePageConfiguration.ALL_MODES);
configuration.setMode(ISynchronizePageConfiguration.BOTH_MODE);
- // The manager adds itself to the configuration in it's constructor
- new ChangeLogModelManager(configuration);
- configuration.setProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER, CVSUIPlugin.getPlugin().getChangeSetManager());
-
// Add context menu groups here to give the client displaying the
// page a chance to remove the context menu
configuration.addMenuGroup(
@@ -191,4 +258,14 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
public PreferencePage[] getPreferencePages() {
return CVSParticipant.addCVSPreferencePages(super.getPreferencePages());
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#getChangeSetCapability()
+ */
+ public ChangeSetCapability getChangeSetCapability() {
+ if (capability == null) {
+ capability = new WorkspaceChangeSetCapability();
+ }
+ return capability;
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetActionGroup.java
index 8c9d08b78..1b29033fb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetActionGroup.java
@@ -34,7 +34,7 @@ import org.eclipse.ui.actions.BaseSelectionListenerAction;
* This action group contributes actions that support the management
* of Change sets to a synchronize page.
*/
-public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
+public final class ChangeSetActionGroup extends SynchronizePageActionGroup {
/**
* Menu group that can be added to the context menu
@@ -82,8 +82,8 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
syncExec(new Runnable() {
public void run() {
SyncInfo[] infos = getSyncInfoSet().getSyncInfos();
- ActiveChangeSet set = createChangeSet(getChangeSetManager(), infos);
- getChangeSetManager().add(set);
+ ActiveChangeSet set = createChangeSet(infos);
+ getActiveChangeSetManager().add(set);
}
});
}
@@ -136,7 +136,7 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
public void run() {
ActiveChangeSet set = getSelectedSet();
if (set == null) return;
- getChangeSetManager().makeDefault(set);
+ getActiveChangeSetManager().makeDefault(set);
}
}
@@ -223,30 +223,31 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
private MakeDefaultChangeSetAction makeDefault;
/*
- * Flag indicating whether the active change sets are included
- */
- private boolean includesActive = false;
-
- /*
* The currently chosen sort criteria
*/
private int sortCriteria = ChangeSetModelSorter.DATE;
+ public ChangeSetActionGroup(ChangeSetModelProvider provider) {
+ this.provider = provider;
+ }
+
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
- sortByComment = new MenuManager(Policy.bind("ChangeLogModelProvider.0a")); //$NON-NLS-1$
- appendToGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
- ISynchronizePageConfiguration.SORT_GROUP,
- sortByComment);
- initializeSortCriteria(configuration);
- sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.1a"), ChangeSetModelSorter.COMMENT)); //$NON-NLS-1$
- sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.2a"), ChangeSetModelSorter.DATE)); //$NON-NLS-1$
- sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.3a"), ChangeSetModelSorter.USER)); //$NON-NLS-1$
+ if (getChangeSetCapability().supportsCheckedInChangeSets()) {
+ sortByComment = new MenuManager(Policy.bind("ChangeLogModelProvider.0a")); //$NON-NLS-1$
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ ISynchronizePageConfiguration.SORT_GROUP,
+ sortByComment);
+ initializeSortCriteria(configuration);
- if (getChangeSetManager() != null) {
- includesActive = true;
+ sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.1a"), ChangeSetModelSorter.COMMENT)); //$NON-NLS-1$
+ sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.2a"), ChangeSetModelSorter.DATE)); //$NON-NLS-1$
+ sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.3a"), ChangeSetModelSorter.USER)); //$NON-NLS-1$
+ }
+
+ if (getChangeSetCapability().supportsActiveChangeSets()) {
addToChangeSet = new MenuManager(Policy.bind("ChangeLogModelProvider.12")); //$NON-NLS-1$
addToChangeSet.setRemoveAllWhenShown(true);
addToChangeSet.addMenuListener(new IMenuListener() {
@@ -296,7 +297,7 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
}
protected void addChangeSets(IMenuManager manager) {
- ChangeSet[] sets = getChangeSetManager().getSets();
+ ChangeSet[] sets = getActiveChangeSetManager().getSets();
ISelection selection = getContext().getSelection();
createChangeSet.selectionChanged(selection);
addToChangeSet.add(createChangeSet);
@@ -312,29 +313,31 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
* Return the change set manager for the current page.
* @return the change set manager for the current page
*/
- protected SubscriberChangeSetCollector getChangeSetManager() {
- return (SubscriberChangeSetCollector)getConfiguration().getProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER);
+ protected SubscriberChangeSetCollector getActiveChangeSetManager() {
+ return getChangeSetCapability().getActiveChangeSetManager();
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizePageActionGroup#dispose()
*/
public void dispose() {
- if (includesActive) {
+ if (addToChangeSet != null) {
addToChangeSet.dispose();
addToChangeSet.removeAll();
}
- sortByComment.dispose();
- sortByComment.removeAll();
+ if (sortByComment != null) {
+ sortByComment.dispose();
+ sortByComment.removeAll();
+ }
super.dispose();
}
public void updateActionBars() {
- if (includesActive) {
+ if (editChangeSet != null)
editChangeSet.selectionChanged((IStructuredSelection)getContext().getSelection());
+ if (makeDefault != null)
makeDefault.selectionChanged((IStructuredSelection)getContext().getSelection());
- }
super.updateActionBars();
}
@@ -359,19 +362,15 @@ public abstract class ChangeSetActionGroup extends SynchronizePageActionGroup {
return new ChangeSetModelSorter(provider, sortCriteria);
}
- /**
- * Create a change set from the given manager that contains the given sync info.
- * This method is invoked from the UI thread.
- * @param manager a change set manager
- * @param infos the sync info to be added to the change set
- * @return the created set.
- */
- protected abstract ActiveChangeSet createChangeSet(SubscriberChangeSetCollector manager, SyncInfo[] infos);
+ private ActiveChangeSet createChangeSet(SyncInfo[] infos) {
+ return getChangeSetCapability().createChangeSet(null, infos);
+ }
- /**
- * Edit the title and comment of the given change set.
- * This method is invoked from the UI thread.
- * @param set the set to be edited
- */
- protected abstract void editChangeSet(ActiveChangeSet set);
+ private void editChangeSet(ActiveChangeSet set) {
+ getChangeSetCapability().editChangeSet(null, set);
+ }
+
+ private ChangeSetCapability getChangeSetCapability() {
+ return provider.getChangeSetCapability();
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
index 4a5bfe6e7..e8f560991 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
@@ -8,22 +8,24 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ccvs.ui.subscriber;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.team.internal.ccvs.ui.*;
-import org.eclipse.team.internal.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
/**
* Manager for hierarchical models
*/
-public class ChangeLogModelManager extends HierarchicalModelManager implements IPropertyChangeListener {
+public class ChangeSetModelManager extends HierarchicalModelManager implements IPropertyChangeListener {
- private static final String P_COMMIT_SET_ENABLED = CVSUIPlugin.ID + ".P_COMMIT_SET_ENABLED"; //$NON-NLS-1$
+ private static final String P_COMMIT_SET_ENABLED = TeamUIPlugin.ID + ".P_COMMIT_SET_ENABLED"; //$NON-NLS-1$
public static final String COMMIT_SET_GROUP = "CommitSet"; //$NON-NLS-1$
@@ -31,7 +33,7 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
private class ToggleCommitSetAction extends Action {
public ToggleCommitSetAction() {
- super(Policy.bind("ChangeLogModelManager.0"), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CHANGELOG)); //$NON-NLS-1$
+ super(Policy.bind("ChangeLogModelManager.0"), TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_CHANGE_SET)); //$NON-NLS-1$
setToolTipText(Policy.bind("ChangeLogModelManager.0")); //$NON-NLS-1$
update();
}
@@ -55,10 +57,9 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
}
}
- public ChangeLogModelManager(ISynchronizePageConfiguration configuration) {
+ public ChangeSetModelManager(ISynchronizePageConfiguration configuration) {
super(configuration);
configuration.addPropertyChangeListener(this);
- configuration.setProperty(SynchronizePageConfiguration.P_MODEL_MANAGER, this);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, COMMIT_SET_GROUP);
configuration.addActionContribution(new CommitSetActionContribution());
}
@@ -76,7 +77,7 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
*/
protected ISynchronizeModelProvider createModelProvider(String id) {
if (enabled) {
- return new ChangeLogModelProvider(getConfiguration(), getSyncInfoSet(), id);
+ return new ChangeSetModelProvider(getConfiguration(), getSyncInfoSet(), id);
} else {
return super.createModelProvider(id);
}
@@ -87,8 +88,8 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
*/
protected String getSelectedProviderId() {
String id = super.getSelectedProviderId();
- if (id.equals(ChangeLogModelProvider.ChangeLogModelProviderDescriptor.ID)) {
- return ((ChangeLogModelProvider)getActiveModelProvider()).getSubproviderId();
+ if (id.equals(ChangeSetModelProvider.ChangeSetModelProviderDescriptor.ID)) {
+ return ((ChangeSetModelProvider)getActiveModelProvider()).getSubproviderId();
} else {
return id;
}
@@ -118,7 +119,7 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
// Load our setting before invoking super since the inherited
// initialize will create the provider
IDialogSettings pageSettings = getConfiguration().getSite().getPageSettings();
- enabled = CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_COMMIT_SET_DEFAULT_ENABLEMENT);
+ // TODO enabled = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_COMMIT_SET_DEFAULT_ENABLEMENT);
if(pageSettings != null && pageSettings.get(P_COMMIT_SET_ENABLED) != null) {
enabled = pageSettings.getBoolean(P_COMMIT_SET_ENABLED);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider.java
index 16c207dd0..a50e40c92 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider.java
@@ -10,26 +10,90 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
+import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.IChangeSetChangeListener;
+import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
-import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.*;
/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
+ * Model provider for showing change sets in a sync page.
*/
public class ChangeSetModelProvider extends CompositeModelProvider {
- private ViewerSorter viewerSorter;
+ private ViewerSorter viewerSorter = new ChangeSetModelSorter(this, ChangeSetModelSorter.COMMENT);
+
+ // The id of the sub-provider
+ private final String subProvierId;
+
+ private Map rootToProvider = new HashMap(); // Maps ISynchronizeModelElement -> AbstractSynchronizeModelProvider
+
+ private ViewerSorter embeddedSorter;
+
+ SyncInfoSetChangeSetCollector collector;
+
+ IChangeSetChangeListener collectorListener = new IChangeSetChangeListener() {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.IChangeSetChangeListener#setAdded(org.eclipse.team.core.subscribers.ChangeSet)
+ */
+ public void setAdded(ChangeSet set) {
+ ISynchronizeModelElement node = getModelElement(set);
+ ISynchronizeModelProvider provider = null;
+ if (node != null) {
+ provider = getProviderRootedAt(node);
+ }
+ if (provider == null) {
+ provider = createProvider(set);
+ }
+ provider.prepareInput(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.IChangeSetChangeListener#defaultSetChanged(org.eclipse.team.core.subscribers.ChangeSet, org.eclipse.team.core.subscribers.ChangeSet)
+ */
+ public void defaultSetChanged(ChangeSet previousDefault, ChangeSet set) {
+ // There is no default set for checked-in change sets
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.IChangeSetChangeListener#setRemoved(org.eclipse.team.core.subscribers.ChangeSet)
+ */
+ public void setRemoved(ChangeSet set) {
+ ISynchronizeModelElement node = getModelElement(set);
+ if (node != null) {
+ ISynchronizeModelProvider provider = getProviderRootedAt(node);
+ clearModelObjects(node);
+ removeProvider(provider);
+ }
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.IChangeSetChangeListener#nameChanged(org.eclipse.team.core.subscribers.ChangeSet)
+ */
+ public void nameChanged(ChangeSet set) {
+ // The name of checked-in change sets should not change
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.IChangeSetChangeListener#resourcesChanged(org.eclipse.team.core.subscribers.ChangeSet, org.eclipse.core.resources.IResource[])
+ */
+ public void resourcesChanged(ChangeSet set, IResource[] resources) {
+ // The sub-providers listen directly to the sets for changes
+ // There is no global action to be taken for such changes
+ }
+ };
+
/* *****************************************************************************
* Descriptor for this model provider
*/
@@ -47,44 +111,38 @@ public class ChangeSetModelProvider extends CompositeModelProvider {
};
private static final ChangeSetModelProviderDescriptor descriptor = new ChangeSetModelProviderDescriptor();
- protected ChangeSetModelProvider(ISynchronizePageConfiguration configuration, SyncInfoSet set) {
+ protected ChangeSetModelProvider(ISynchronizePageConfiguration configuration, SyncInfoSet set, String subProvierId) {
super(configuration, set);
+ this.subProvierId = subProvierId;
+ collector = getChangeSetCapability().createCheckedInChangeSetCollector(configuration);
+ collector.setProvider(this);
}
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#handleAddition(org.eclipse.team.core.synchronize.SyncInfo)
+ * @see org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider#handleChanges(org.eclipse.team.core.synchronize.ISyncInfoTreeChangeEvent, org.eclipse.core.runtime.IProgressMonitor)
*/
- protected void handleAddition(SyncInfo info) {
- if (isLocalChange(info)) {
- handleLocalChange(info);
- }
- if (isRemoteChange(info)) {
- handleRemoteChange(info);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#handleChange(org.eclipse.team.core.synchronize.SyncInfo)
- */
- protected void handleChange(SyncInfo info) {
- // TODO Auto-generated method stub
- super.handleChange(info);
+ protected void handleChanges(ISyncInfoTreeChangeEvent event, IProgressMonitor monitor) {
+ collector.handleChange(event);
+ // super.handleChanges(event, monitor); TODO Handle outgoing changes
}
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#handleRemoval(org.eclipse.core.resources.IResource)
+ * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#handleAddition(org.eclipse.team.core.synchronize.SyncInfo)
*/
- protected void handleRemoval(IResource resource) {
- // TODO Auto-generated method stub
- super.handleRemoval(resource);
+ protected void handleAddition(SyncInfo info) {
+ // TODO: Nothing to do since change handling was bypassed
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider#buildModelObjects(org.eclipse.team.ui.synchronize.ISynchronizeModelElement)
*/
protected IDiffElement[] buildModelObjects(ISynchronizeModelElement node) {
- // TODO Auto-generated method stub
- return null;
+ // This method is invoked on a reset after the provider state has been cleared.
+ // Reseting the collector will rebuild the model
+ if (node == getModelRoot()) {
+ collector.reset(getSyncInfoSet());
+ }
+ return new IDiffElement[0];
}
/* (non-Javadoc)
@@ -104,7 +162,7 @@ public class ChangeSetModelProvider extends CompositeModelProvider {
/*
* Method to allow ChangeSetActionGroup to set the viewer sorter of this provider.
*/
- /* package */ void setViewerSorter(ViewerSorter viewerSorter) {
+ public void setViewerSorter(ViewerSorter viewerSorter) {
this.viewerSorter = viewerSorter;
firePropertyChange(ISynchronizeModelProvider.P_VIEWER_SORTER, null, null);
}
@@ -116,4 +174,120 @@ public class ChangeSetModelProvider extends CompositeModelProvider {
super.runViewUpdate(runnable);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider#createActionGroup()
+ */
+ protected SynchronizePageActionGroup createActionGroup() {
+ return new ChangeSetActionGroup(this);
+ }
+
+ private ISynchronizeModelProvider createProviderRootedAt(ISynchronizeModelElement parent, SyncInfoTree set) {
+ ISynchronizeModelProvider provider = createModelProvider(parent, getSubproviderId(), set);
+ addProvider(provider);
+ rootToProvider.put(parent, provider);
+ return provider;
+ }
+
+ private ISynchronizeModelProvider getProviderRootedAt(ISynchronizeModelElement parent) {
+ return (ISynchronizeModelProvider)rootToProvider.get(parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#removeProvider(org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider)
+ */
+ protected void removeProvider(ISynchronizeModelProvider provider) {
+ rootToProvider.remove(provider.getModelRoot());
+ super.removeProvider(provider);
+ }
+
+ /**
+ * Return the id of the sub-provider used by the commit set provider.
+ * @return the id of the sub-provider used by the commit set provider
+ */
+ public String getSubproviderId() {
+ return subProvierId;
+ }
+
+ /**
+ * Return the sorter associated with the sub-provider being used.
+ * @return the sorter associated with the sub-provider being used
+ */
+ public ViewerSorter getEmbeddedSorter() {
+ return embeddedSorter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#clearModelObjects(org.eclipse.team.ui.synchronize.ISynchronizeModelElement)
+ */
+ protected void clearModelObjects(ISynchronizeModelElement node) {
+ super.clearModelObjects(node);
+ if (node == getModelRoot()) {
+ rootToProvider.clear();
+ // Throw away the embedded sorter
+ embeddedSorter = null;
+ createRootProvider();
+ }
+ }
+
+ /*
+ * Create the root subprovider which is used to display resources
+ * that are not in a commit set. This provider is created even if
+ * it is empty so we can have access to the appropriate sorter
+ * and action group
+ */
+ private void createRootProvider() {
+ // Recreate the sub-provider at the root and use it's viewer sorter and action group
+ final ISynchronizeModelProvider provider = createProviderRootedAt(getModelRoot(), new SyncInfoTree());
+ embeddedSorter = provider.getViewerSorter();
+ if (provider instanceof AbstractSynchronizeModelProvider) {
+ SynchronizePageActionGroup actionGroup = ((AbstractSynchronizeModelProvider)provider).getActionGroup();
+ if (actionGroup != null) {
+ // This action group will be disposed when the provider is disposed
+ getConfiguration().addActionContribution(actionGroup);
+ provider.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(P_VIEWER_SORTER)) {
+ embeddedSorter = provider.getViewerSorter();
+ ChangeSetModelProvider.this.firePropertyChange(P_VIEWER_SORTER, null, null);
+ }
+ }
+ });
+ }
+ }
+ }
+
+ /*
+ * Create a provider and node for the given change set
+ */
+ private ISynchronizeModelProvider createProvider(ChangeSet set) {
+ ChangeSetDiffNode node = new ChangeSetDiffNode(getModelRoot(), set);
+ return createProviderRootedAt(node, set.getSyncInfoSet());
+ }
+
+ /*
+ * Find the root element for the given change set.
+ * A linear searhc is used,
+ */
+ protected ISynchronizeModelElement getModelElement(ChangeSet set) {
+ IDiffElement[] children = getModelRoot().getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IDiffElement element = children[i];
+ if (element instanceof ChangeSetDiffNode && ((ChangeSetDiffNode)element).getSet() == set) {
+ return (ISynchronizeModelElement)element;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * Return the change set capability
+ */
+ public ChangeSetCapability getChangeSetCapability() {
+ return getConfiguration().getParticipant().getChangeSetCapability();
+ }
+
+ public void dispose() {
+ collector.dispose();
+ super.dispose();
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelSorter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelSorter.java
index d16f8006b..7402fedf5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelSorter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelSorter.java
@@ -12,9 +12,9 @@ package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.subscribers.ActiveChangeSet;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
+import org.eclipse.team.core.subscribers.ChangeSet;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
/**
@@ -39,10 +39,11 @@ public class ChangeSetModelSorter extends ViewerSorter {
protected int classComparison(Object element) {
if (element instanceof ChangeSetDiffNode) {
- return 0;
- }
- if (element instanceof ChangeLogDiffNode) {
- return 1;
+ ChangeSet set = ((ChangeSetDiffNode)element).getSet();
+ if (set instanceof ActiveChangeSet) {
+ return 0;
+ }
+ return 1;
}
return 2;
}
@@ -63,34 +64,34 @@ public class ChangeSetModelSorter extends ViewerSorter {
//if one or both objects are not resources, returned a comparison
//based on class.
if (o1 instanceof ChangeSetDiffNode && o2 instanceof ChangeSetDiffNode) {
- ActiveChangeSet s1 = (ActiveChangeSet)((ChangeSetDiffNode) o1).getSet();
- ActiveChangeSet s2 = (ActiveChangeSet)((ChangeSetDiffNode) o2).getSet();
- return compareNames(s1.getTitle(), s2.getTitle());
+ ChangeSet s1 = ((ChangeSetDiffNode) o1).getSet();
+ ChangeSet s2 = ((ChangeSetDiffNode) o2).getSet();
+ if (s1 instanceof ActiveChangeSet && s2 instanceof ActiveChangeSet) {
+ return compareNames(((ActiveChangeSet)s1).getTitle(), ((ActiveChangeSet)s2).getTitle());
+ }
+ if (s1 instanceof CheckedInChangeSet && s2 instanceof CheckedInChangeSet) {
+ CheckedInChangeSet r1 = (CheckedInChangeSet)s1;
+ CheckedInChangeSet r2 = (CheckedInChangeSet)s2;
+ if (commentCriteria == DATE)
+ return r1.getDate().compareTo(r2.getDate());
+ else if (commentCriteria == COMMENT)
+ return compareNames(r1.getComment(), r2.getComment());
+ else if (commentCriteria == USER)
+ return compareNames(r1.getAuthor(), r2.getAuthor());
+ else
+ return 0;
+ }
+ if (s1 instanceof ActiveChangeSet) {
+ return -1;
+ } else if (s2 instanceof ActiveChangeSet) {
+ return 1;
+ }
+ if (s1 instanceof CheckedInChangeSet) {
+ return -1;
+ } else if (s2 instanceof CheckedInChangeSet) {
+ return 1;
+ }
}
-
- if (o1 instanceof ChangeLogDiffNode && o2 instanceof ChangeLogDiffNode) {
- ILogEntry r1 = ((ChangeLogDiffNode) o1).getComment();
- ILogEntry r2 = ((ChangeLogDiffNode) o2).getComment();
-
- if (commentCriteria == DATE)
- return r1.getDate().compareTo(r2.getDate());
- else if (commentCriteria == COMMENT)
- return compareNames(r1.getComment(), r2.getComment());
- else if (commentCriteria == USER)
- return compareNames(r1.getAuthor(), r2.getAuthor());
- else
- return 0;
- }
-
- if (o1 instanceof ChangeSetDiffNode)
- return 1;
- else if (o2 instanceof ChangeSetDiffNode)
- return -1;
-
- if (o1 instanceof ChangeLogDiffNode)
- return 1;
- else if (o2 instanceof ChangeLogDiffNode)
- return -1;
if (o1 instanceof ISynchronizeModelElement && o2 instanceof ISynchronizeModelElement) {
ViewerSorter embeddedSorter = provider.getEmbeddedSorter();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
index 522427422..367adf2b8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
@@ -34,6 +34,7 @@ import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.team.internal.ui.synchronize.actions.NavigateAction;
+import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
@@ -194,6 +195,12 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor {
* @param configuration
*/
protected SynchronizeModelManager createModelManager(ISynchronizePageConfiguration configuration) {
+ ChangeSetCapability changeSetCapability = configuration.getParticipant().getChangeSetCapability();
+ if (changeSetCapability != null) {
+ if (changeSetCapability.supportsActiveChangeSets() || changeSetCapability.supportsCheckedInChangeSets()) {
+ return new ChangeSetModelManager(configuration);
+ }
+ }
return new HierarchicalModelManager(configuration);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
index bde43602d..1de5d4578 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
@@ -375,4 +375,11 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
public PreferencePage[] getPreferencePages() {
return new PreferencePage[] { new SyncViewerPreferencePage() };
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#getChangeSetCapability()
+ */
+ public ChangeSetCapability getChangeSetCapability() {
+ return null;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ChangeSetCapability.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ChangeSetCapability.java
new file mode 100644
index 000000000..62cdf1901
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ChangeSetCapability.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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;
+
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
+import org.eclipse.team.core.subscribers.SubscriberChangeSetCollector;
+import org.eclipse.team.core.synchronize.SyncInfo;
+
+/**
+ * A change set capability is used by a SubscriberSynchronizePage
+ * to determine what, if any change set capabilities should be enabled
+ * for the pags of the particpant.
+ * @since 3.1
+ */
+public abstract class ChangeSetCapability {
+
+ /**
+ * Return whether the associated participant supports
+ * the display of checked-in change sets.
+ * @return whether the associated participant supports
+ * the display of checked-in change sets
+ */
+ public abstract boolean supportsCheckedInChangeSets();
+
+ /**
+ * Return whether the associated participant supports
+ * the use of active change sets.
+ * @return whether the associated participant supports
+ * the use of active change sets
+ */
+ public abstract boolean supportsActiveChangeSets();
+
+ /**
+ * Return the change set collector that manages the active change
+ * set for the particpant associated with this capability.
+ * @return the change set collector that manages the active change
+ * set for the particpant associated with this capability
+ */
+ public abstract SubscriberChangeSetCollector getActiveChangeSetManager();
+
+ /**
+ * Create a change set from the given manager that contains the given sync info.
+ * This method is invoked from the UI thread.
+ * @param configuration TODO
+ * @param infos the sync info to be added to the change set
+ * @param manager a change set manager
+ * @return the created set.
+ */
+ public abstract ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, SyncInfo[] infos);
+
+ /**
+ * Edit the title and comment of the given change set.
+ * This method is invoked from the UI thread.
+ * @param configuration TODO
+ * @param set the set to be edited
+ */
+ public abstract void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set);
+
+ /**
+ * Return a collector that can be used to group a set of checked-in changes
+ * into a set of checked-in change sets.
+ * @param configuration the configuration for the page that will be displaying the change sets
+ * @return a change set collector
+ */
+ public abstract SyncInfoSetChangeSetCollector createCheckedInChangeSetCollector(ISynchronizePageConfiguration configuration);
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
index 67de83bd6..7e52b7984 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
@@ -98,13 +98,6 @@ public interface ISynchronizePageConfiguration {
public static final String P_SUPPORTED_MODES = TeamUIPlugin.ID + ".P_SUPPORTED_MODES"; //$NON-NLS-1$
/**
- * Property constant which indicates the change set manager.
- * The value is to be an instance of <code>SubscriberChangeSetManager</code>.
- * A value of <code>null</code> indicates that there is no change set manager.
- */
- public static final String P_CHANGE_SET_MANAGER = TeamUIPlugin.ID + ".P_CHANGE_SET_MANAGER"; //$NON-NLS-1$
-
- /**
* The id of the synchronize group the determines where the synchronize
* actions appear.
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
index 9a328910f..f1b80a378 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
@@ -246,4 +246,12 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* @since 3.1
*/
public PreferencePage[] getPreferencePages();
+
+ /**
+ * Return the change set capability for this participant or <code>null</code>
+ * if change sets are not supported.
+ * @return the change set capability for this participant
+ * @since 3.1
+ */
+ public ChangeSetCapability getChangeSetCapability();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetChangeSetCollector.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetChangeSetCollector.java
index 720843b32..a34aa6054 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetChangeSetCollector.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetChangeSetCollector.java
@@ -10,20 +10,13 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ITeamStatus;
-import org.eclipse.team.core.subscribers.ChangeSet;
-import org.eclipse.team.core.subscribers.ChangeSetCollector;
-import org.eclipse.team.core.subscribers.CheckedInChangeSet;
-import org.eclipse.team.core.synchronize.ISyncInfoSetChangeEvent;
-import org.eclipse.team.core.synchronize.ISyncInfoSetChangeListener;
-import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
+import org.eclipse.team.core.subscribers.*;
+import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.ChangeSetModelProvider;
/**
diff --git a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
index a1b8cb5a1..23c1d38ad 100644
--- a/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.team.tests.cvs.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Sep 28 13:57:33 EDT 2004
+#Wed Sep 29 15:59:27 EDT 2004
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
@@ -32,25 +32,25 @@ org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
eclipse.preferences.version=1
org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
@@ -58,7 +58,7 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.incompleteClasspath=error
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSChangeSetTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSChangeSetTests.java
index bcdb87872..215deb038 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSChangeSetTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSChangeSetTests.java
@@ -19,16 +19,12 @@ import junit.framework.Test;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.subscriber.ChangeLogDiffNode;
-import org.eclipse.team.internal.ccvs.ui.subscriber.ChangeLogModelManager;
import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.tests.ccvs.ui.SynchronizeViewTestAdapter;
import org.eclipse.team.ui.synchronize.*;
@@ -59,7 +55,7 @@ public class CVSChangeSetTests extends CVSSyncSubscriberTest {
ISynchronizeModelElement root = getModelRoot(workspaceSubscriber);
for (int i = 0; i < messages.length; i++) {
String message = messages[i];
- ChangeLogDiffNode node = getCommitSetFor(root, message);
+ ChangeSetDiffNode node = getCommitSetFor(root, message);
assertNotNull("The commit set for '" + message + "' is not in the sync view", node);
List filesInSet = new ArrayList();
getFileChildren(node, filesInSet);
@@ -87,13 +83,13 @@ public class CVSChangeSetTests extends CVSSyncSubscriberTest {
return;
}
- private ChangeLogDiffNode getCommitSetFor(ISynchronizeModelElement root, String message) {
+ private ChangeSetDiffNode getCommitSetFor(ISynchronizeModelElement root, String message) {
IDiffElement[] children = root.getChildren();
for (int i = 0; i < children.length; i++) {
IDiffElement element = children[i];
- if (element instanceof ChangeLogDiffNode) {
- ChangeLogDiffNode node = (ChangeLogDiffNode)element;
- if (node.getComment().getComment().equals(message)) {
+ if (element instanceof ChangeSetDiffNode) {
+ ChangeSetDiffNode node = (ChangeSetDiffNode)element;
+ if (node.getSet().getComment().equals(message)) {
return node;
}
}
@@ -108,7 +104,7 @@ public class CVSChangeSetTests extends CVSSyncSubscriberTest {
private void enableChangeSets(Subscriber workspaceSubscriber) throws PartInitException {
ISynchronizeParticipant participant = SynchronizeViewTestAdapter.getParticipant(workspaceSubscriber);
SubscriberParticipantPage page = (SubscriberParticipantPage)SynchronizeViewTestAdapter.getSyncViewPage(participant);
- ChangeLogModelManager manager = (ChangeLogModelManager)page.getConfiguration().getProperty(SynchronizePageConfiguration.P_MODEL_MANAGER);
+ ChangeSetModelManager manager = (ChangeSetModelManager)page.getConfiguration().getProperty(SynchronizePageConfiguration.P_MODEL_MANAGER);
manager.setCommitSetsEnabled(true);
page.getConfiguration().setMode(ISynchronizePageConfiguration.BOTH_MODE);
}
@@ -120,7 +116,7 @@ public class CVSChangeSetTests extends CVSSyncSubscriberTest {
SynchronizeViewTestAdapter.getCollector(workspaceSubscriber);
ISynchronizeParticipant participant = SynchronizeViewTestAdapter.getParticipant(workspaceSubscriber);
SubscriberParticipantPage page = (SubscriberParticipantPage)SynchronizeViewTestAdapter.getSyncViewPage(participant);
- ChangeLogModelManager manager = (ChangeLogModelManager)page.getConfiguration().getProperty(SynchronizePageConfiguration.P_MODEL_MANAGER);
+ ChangeSetModelManager manager = (ChangeSetModelManager)page.getConfiguration().getProperty(SynchronizePageConfiguration.P_MODEL_MANAGER);
AbstractSynchronizeModelProvider provider = (AbstractSynchronizeModelProvider)manager.getActiveModelProvider();
provider.waitForUpdateHandler(new IProgressMonitor() {
public void beginTask(String name, int totalWork) {

Back to the top