Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-13 14:17:44 -0400
committerMichael Valenta2004-09-13 14:17:44 -0400
commit00739eede93e47876cb379ff94320f3a5ae3dd95 (patch)
treed526cfa64e8c6cefd69932ed2df2f4bb44c6f922
parentc1a68582c4f4a23a11c360f968b2cadf36aeac1b (diff)
downloadeclipse.platform.team-branch_20040903_OutgoingCommitSets.tar.gz
eclipse.platform.team-branch_20040903_OutgoingCommitSets.tar.xz
eclipse.platform.team-branch_20040903_OutgoingCommitSets.zip
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ComparePreferencePage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties20
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java20
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java3
-rw-r--r--bundles/org.eclipse.team.ui/.options7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java39
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java45
14 files changed, 158 insertions, 51 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ComparePreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ComparePreferencePage.java
index ceb4f3683..febf88671 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ComparePreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ComparePreferencePage.java
@@ -31,7 +31,7 @@ public class ComparePreferencePage extends CVSFieldEditorPreferencePage {
* @see org.eclipse.team.internal.ccvs.ui.CVSFieldEditorPreferencePage#getPageDescription()
*/
protected String getPageDescription() {
- return "Options for CVS comparisons:";
+ return Policy.bind("ComparePreferencePage.0"); //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -56,7 +56,7 @@ public class ComparePreferencePage extends CVSFieldEditorPreferencePage {
getFieldEditorParent()));
addField(new BooleanFieldEditor(
ICVSUIConstants.PREF_SHOW_AUTHOR_IN_EDITOR,
- "Show the file author in compare editors",
+ Policy.bind("ComparePreferencePage.1"), //$NON-NLS-1$
BooleanFieldEditor.DEFAULT,
getFieldEditorParent()));
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index dd8b4acf0..ffd1c7b77 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -1022,11 +1022,25 @@ CheckoutIntoWizard.projectSelectionPageTitle=Select local folder
CheckoutIntoWizard.projectSelectionPageDescription=Select the local folder that is the target of the checkout operation.
CheckoutIntoWizard.error=Checkout Error
ChangeLogModelProvider.0=Sort &Comments By
+ChangeLogModelProvider.0=&New Commit Set...
ChangeLogModelProvider.1=&Comment
+ChangeLogModelProvider.1=New Set
+ChangeLogModelProvider.10=Could not add files
+ChangeLogModelProvider.11=A problem occurred while rying to add the files to the commit set
+ChangeLogModelProvider.12=Add &To
ChangeLogModelProvider.2=&Date
+ChangeLogModelProvider.2=New Commit Set
ChangeLogModelProvider.3=&User
+ChangeLogModelProvider.3=Enter the name and comment for the new commit set
ChangeLogModelProvider.4=Retrieving revision histories
+ChangeLogModelProvider.4=Could not create set
ChangeLogModelProvider.5=Commit &Sets
+ChangeLogModelProvider.5=A problem occurred while trying to create the commit set
+ChangeLogModelProvider.6=Ed&it Comment...
+ChangeLogModelProvider.7=Edit Commit Set Comment
+ChangeLogModelProvider.8=Edit the name and comment for the new commit set
+ChangeLogModelProvider.9=Make De&fault
+ChangeLogModelManager.0=Show Commit Sets
CheckoutIntoWizard.thisResourceExists=The resource ''{0}'' already exists in the workspace. Overwrite?
CheckoutIntoWizard.confirmOverwrite=Confirm Overwrite
@@ -1187,6 +1201,8 @@ CVSRepositoryPropertiesPage.0=Confirm Host or Path Change
CVSRepositoryPropertiesPage.1=You have chosen to change the host name or repository root path for this location. You should ensure that this new information still identifies the same repository.
CompareRevertAction.0=Reverting {0} resources
CompareParticipant.0={0} ({1})
+ComparePreferencePage.0=Options for CVS comparisons:
+ComparePreferencePage.1=Show the file author in compare editors
FileModificationValidator.3=Perform Edit?
FileModificationValidator.4=A CVS edit notification is required to be sent to the server in order to allow editing of one or more selected files. Continue?
CVSSynchronizeViewPage.0=Show incoming grouped by comment
@@ -1246,6 +1262,10 @@ AddOperation.0=Adding {0}
BranchOperation.0=Branching
BranchOperation.1=Branching {0}
CommitOperation.0=Committing {0}
+CommitSetDialog.0=&Name:
+CommitSetDialog.2=Use the &title as the commit comment
+CommitSetDialog.3=Enter a commit &comment
+CommitSetDiffNode.0={0} (default)
UpdateOperation.0=Updating {0}
ReplaceOperation.0=Replacing {0}
TagOperation.0=Tagging {0}
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
index 0f77290a4..e80472e3e 100644
--- 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
@@ -42,12 +42,7 @@ public class ChangeLogDiffNode extends SynchronizeModelElement {
}
public boolean equals(Object obj) {
- if(obj == this) return true;
- if(! (obj instanceof ChangeLogDiffNode)) return false;
- ChangeLogDiffNode other = (ChangeLogDiffNode)obj;
- ILogEntry otherLog = other.getComment();
- ILogEntry thisLog = getComment();
- return thisLog.getComment().equals(otherLog.getComment()) && thisLog.getAuthor().equals(otherLog.getAuthor());
+ return (obj == this);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java
index 686a8e8c9..1a22ec62e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelManager.java
@@ -15,6 +15,7 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.team.internal.ccvs.core.CVSTag;
+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.*;
@@ -38,7 +39,7 @@ public class ChangeLogModelManager extends HierarchicalModelManager implements I
private class ToggleCommitSetAction extends Action {
public ToggleCommitSetAction() {
- super("Show Commit Sets", CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CHANGELOG));
+ super(Policy.bind("ChangeLogModelManager.0"), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CHANGELOG)); //$NON-NLS-1$
update();
}
public void run() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
index c69f7b697..ef6047676 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
@@ -133,7 +133,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private class CreateCommitSetAction extends SynchronizeModelAction {
public CreateCommitSetAction(ISynchronizePageConfiguration configuration) {
- super("&New Commit Set...", configuration);
+ super(Policy.bind("ChangeLogModelProvider.0"), configuration); //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -153,16 +153,16 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
public void run() {
try {
IResource[] resources = Utils.getResources(getSelectedDiffElements());
- CommitSet set = CommitSetManager.getInstance().createCommitSet("New Set", null);
+ CommitSet set = CommitSetManager.getInstance().createCommitSet(Policy.bind("ChangeLogModelProvider.1"), null); //$NON-NLS-1$
CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, resources,
- "New Commit Set", "Enter the name and comment for the new commit set");
+ Policy.bind("ChangeLogModelProvider.2"), Policy.bind("ChangeLogModelProvider.3")); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
set.addFiles(resources);
CommitSetManager.getInstance().add(set);
} catch (CVSException e) {
CVSUIPlugin.openError(getConfiguration().getSite().getShell(),
- "Could not create set", "A problem occurred while trying to create the commit set", e);
+ Policy.bind("ChangeLogModelProvider.4"), Policy.bind("ChangeLogModelProvider.5"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
});
@@ -201,14 +201,14 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private class EditCommitSetAction extends CommitSetAction {
public EditCommitSetAction(ISynchronizePageConfiguration configuration) {
- super("Ed&it Comment...", configuration);
+ super(Policy.bind("ChangeLogModelProvider.6"), configuration); //$NON-NLS-1$
}
public void run() {
CommitSet set = getSelectedSet();
if (set == null) return;
CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, set.getFiles(),
- "Edit Commit Set Comment", "Edit the name and comment for the new commit set");
+ 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
@@ -219,7 +219,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private class MakeDefaultCommitSetAction extends CommitSetAction {
public MakeDefaultCommitSetAction(ISynchronizePageConfiguration configuration) {
- super("Make De&fault", configuration);
+ super(Policy.bind("ChangeLogModelProvider.9"), configuration); //$NON-NLS-1$
}
public void run() {
@@ -258,7 +258,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
set.addFiles(Utils.getResources(getSelectedDiffElements()));
} catch (CVSException e) {
CVSUIPlugin.openError(getConfiguration().getSite().getShell(),
- "Could not add files", "A problem occurred while rying to add the files to the commit set", e);
+ Policy.bind("ChangeLogModelProvider.10"), Policy.bind("ChangeLogModelProvider.11"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
};
@@ -277,7 +277,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
sortByComment = new MenuManager(Policy.bind("ChangeLogModelProvider.0")); //$NON-NLS-1$
- addToCommitSet = new MenuManager("Add &To");
+ addToCommitSet = new MenuManager(Policy.bind("ChangeLogModelProvider.12")); //$NON-NLS-1$
addToCommitSet.setRemoveAllWhenShown(true);
addToCommitSet.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
@@ -938,7 +938,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
protected void nodeRemoved(ISynchronizeModelElement node, AbstractSynchronizeModelProvider provider) {
super.nodeRemoved(node, provider);
// TODO: This should be done using the proper API
- if (node instanceof SynchronizeModelElement) {
+ if (node instanceof SyncInfoModelElement) {
CVSSyncInfo info = (CVSSyncInfo) ((SyncInfoModelElement) node).getSyncInfo();
if (info != null) {
ICVSRemoteResource remote = getRemoteResource(info);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
index e4570a771..3043f6354 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
@@ -117,7 +117,7 @@ public class CommitSetDialog extends Dialog {
composite.setFont(parent.getFont());
Label label = new Label(composite, SWT.NONE);
- label.setText("&Name:");
+ label.setText(Policy.bind("CommitSetDialog.0")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.BEGINNING));
nameText = new Text(composite, SWT.BORDER);
@@ -131,7 +131,7 @@ public class CommitSetDialog extends Dialog {
private void initializeValues() {
String initialText = set.getTitle();
- if (initialText == null) initialText = "";
+ if (initialText == null) initialText = ""; //$NON-NLS-1$
nameText.setText(initialText);
if (useTitleButton != null) {
@@ -141,8 +141,8 @@ public class CommitSetDialog extends Dialog {
}
private void createOptionsArea(Composite composite) {
- useTitleButton = createRadioButton(composite, "Use the &title as the commit comment");
- enterCommentButton = createRadioButton(composite, "Enter a commit &comment");
+ useTitleButton = createRadioButton(composite, Policy.bind("CommitSetDialog.2")); //$NON-NLS-1$
+ enterCommentButton = createRadioButton(composite, Policy.bind("CommitSetDialog.3")); //$NON-NLS-1$
SelectionAdapter listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
updateEnablements();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
index 70a9c5d03..2844188f9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
@@ -12,6 +12,7 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
+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;
@@ -54,7 +55,7 @@ public class CommitSetDiffNode extends SynchronizeModelElement {
public String getName() {
String name = set.getTitle();
if (CommitSetManager.getInstance().isDefault(set)) {
- name = name + " (default)";
+ name = Policy.bind("CommitSetDiffNode.0", name); //$NON-NLS-1$
}
return name;
}
diff --git a/bundles/org.eclipse.team.ui/.options b/bundles/org.eclipse.team.ui/.options
new file mode 100644
index 000000000..1665a8f95
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/.options
@@ -0,0 +1,7 @@
+# Debugging options for the org.eclipse.team.ui plugin.
+
+# Turn on debugging for the plugin.
+org.eclipse.team.ui/debug=false
+
+# Shows stream debugging information
+org.eclipse.team.ui/syncmodels=false \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
index 9f85e5911..94e8b1b3b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
@@ -16,8 +16,7 @@ import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.*;
-import org.eclipse.team.internal.core.InfiniteSubProgressMonitor;
-import org.eclipse.team.internal.core.NullSubProgressMonitor;
+import org.eclipse.team.internal.core.*;
/**
* Policy implements NLS convenience methods for the plugin and
@@ -27,6 +26,16 @@ public class Policy {
// The resource bundle to get strings from
protected static ResourceBundle bundle = null;
+ //debug constants
+ public static boolean DEBUG_SYNC_MODELS = false;
+
+ static {
+ //init debug options
+ if (TeamUIPlugin.getPlugin().isDebugging()) {
+ DEBUG_SYNC_MODELS = "true".equalsIgnoreCase(Platform.getDebugOption(TeamUIPlugin.ID + "/syncmodels"));//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
/**
* Creates a NLS catalog for the given locale.
*
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 5c33f0bc9..1ed2d6f35 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -429,6 +429,7 @@ GlobalSynchronizeWizard.11=Synchronize
SynchronizeManager.19=Could not create synchronization: {0}
SynchronizeManager.20=Not allowed to create multiple synchronize instances of this type: {0}
SynchronizeModelProvider.0=Synchronize View: Processing label changes
+SynchronizeModelUpdateHandler.0=Errors occurred while updating problem markers
WorkspaceScope.0=Workspace
WorkingSetScope.0=Workspace
SubscriberParticipant.namePattern={0} ({1})
@@ -466,3 +467,4 @@ FlatModelProvider.6=Sort &Resources By
FlatModelProvider.7=&Name
FlatModelProvider.8=&Path
FlatModelProvider.9=&Parent Name
+FlatModelProvider.0=Flat
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
index 479cf0391..ce10a6d4f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
@@ -27,7 +27,6 @@ import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.ui.synchronize.*;
-
/**
* This class is reponsible for creating and maintaining a presentation model of
* {@link SynchronizeModelElement} elements that can be shown in a viewer. The model
@@ -552,7 +551,6 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
}
protected void addToViewer(ISynchronizeModelElement node) {
- updateHandler.nodeAdded(node, this);
propogateConflictState(node, false);
// Set the marker property on this node.
// There is no need to propogate this to the parents
@@ -564,6 +562,7 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
if (Utils.canUpdateViewer(getViewer())) {
doAdd((SynchronizeModelElement)node.getParent(), node);
}
+ updateHandler.nodeAdded(node, this);
}
/**
@@ -589,6 +588,7 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
* @param node the root node
*/
protected void clearModelObjects(ISynchronizeModelElement node) {
+ // Clear all the children of the node
IDiffElement[] children = node.getChildren();
for (int i = 0; i < children.length; i++) {
IDiffElement element = children[i];
@@ -602,10 +602,13 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
}
}
}
+ // Remove the node from the tree
IDiffContainer parent = node.getParent();
if (parent != null) {
parent.removeToRoot(node);
}
+ // Notify the update handler that the node has been cleared
+ updateHandler.modelObjectCleared(node);
}
/**
@@ -652,13 +655,26 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
/**
* This is a callback from the model update handler that gets invoked
* when a node is removed from the viewer. It is only invoked for the
- * root level model provider.
+ * root level model provider. A removed node may have children for
+ * which a <code>nodeRemoved</code> callback is not recieved (see
+ * <code>modelObjectCleared</code>).
* @param node
*/
protected void nodeRemoved(ISynchronizeModelElement node, AbstractSynchronizeModelProvider provider) {
// Default is to do nothing
}
+ /**
+ * This is a callback from the model update handler that gets invoked
+ * when a node is cleared from the model. It is only invoked for the
+ * root level model provider. This calbakc is deep in the sense that
+ * a callbakc is sent for each node that is cleared.
+ * @param node the node that was removed.
+ */
+ public void modelObjectCleared(ISynchronizeModelElement node) {
+ // Default is to do nothing
+ }
+
public void addPropertyChangeListener(IPropertyChangeListener listener) {
synchronized (this) {
if (listeners == null) {
@@ -719,4 +735,21 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
protected void runViewUpdate(final Runnable runnable) {
updateHandler.runViewUpdate(runnable);
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ ISynchronizeModelElement element = getModelRoot();
+ String name = getClass().getName();
+ int index = name.lastIndexOf("."); //$NON-NLS-1$
+ if (index != -1) {
+ name = name.substring(index + 1);
+ }
+ String name2 = element.getName();
+ if (name2.length() == 0) {
+ name2 = "/"; //$NON-NLS-1$
+ }
+ return name + ": " + name2; //$NON-NLS-1$
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
index 0ce441603..acf3dfe01 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
@@ -131,10 +131,10 @@ public abstract class CompositeModelProvider extends AbstractSynchronizeModelPro
*/
protected ISynchronizeModelProvider[] beginInput() {
ISynchronizeModelProvider[] providers = getProviders();
- for (int i = 0; i < providers.length; i++) {
- ISynchronizeModelProvider provider = providers[i];
- provider.getSyncInfoSet().beginInput();
- }
+// for (int i = 0; i < providers.length; i++) {
+// ISynchronizeModelProvider provider = providers[i];
+// provider.getSyncInfoSet().beginInput();
+// }
return providers;
}
@@ -143,15 +143,15 @@ public abstract class CompositeModelProvider extends AbstractSynchronizeModelPro
*/
protected void endInput(ISynchronizeModelProvider[] providers, IProgressMonitor monitor) {
RuntimeException exception = null;
- for (int i = 0; i < providers.length; i++) {
- ISynchronizeModelProvider provider = providers[i];
- try {
- provider.getSyncInfoSet().endInput(monitor);
- } catch (RuntimeException e) {
- // Remember the exception but continue so all locks are freed
- exception = e;
- }
- }
+// for (int i = 0; i < providers.length; i++) {
+// ISynchronizeModelProvider provider = providers[i];
+// try {
+// provider.getSyncInfoSet().endInput(monitor);
+// } catch (RuntimeException e) {
+// // Remember the exception but continue so all locks are freed
+// exception = e;
+// }
+// }
if (exception != null) {
throw exception;
}
@@ -262,6 +262,15 @@ public abstract class CompositeModelProvider extends AbstractSynchronizeModelPro
*/
protected void nodeRemoved(ISynchronizeModelElement node, AbstractSynchronizeModelProvider provider) {
// Update the resource-to-element map and the element-to-provider map
+ modelObjectCleared(node);
+ super.nodeRemoved(node, provider);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider#modelObjectCleared(org.eclipse.team.ui.synchronize.ISynchronizeModelElement)
+ */
+ public void modelObjectCleared(ISynchronizeModelElement node) {
+ super.modelObjectCleared(node);
IResource r = node.getResource();
if(r != null) {
List elements = (List)resourceToElements.get(r);
@@ -273,7 +282,6 @@ public abstract class CompositeModelProvider extends AbstractSynchronizeModelPro
}
}
elementToProvider.remove(node);
- super.nodeRemoved(node, provider);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
index bd4399265..3c6a11b43 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
@@ -37,7 +37,7 @@ public class FlatModelProvider extends SynchronizeModelProvider {
return ID;
}
public String getName() {
- return "Flat";
+ return Policy.bind("FlatModelProvider.0"); //$NON-NLS-1$
}
public ImageDescriptor getImageDescriptor() {
return TeamImages.getImageDescriptor(ITeamUIImages.IMG_FLAT);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
index afa385510..e2d2d9190 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler.java
@@ -36,7 +36,7 @@ import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
*/
public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implements IResourceChangeListener, ISyncInfoSetChangeListener {
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = Policy.DEBUG_SYNC_MODELS;
private static final IWorkspaceRoot ROOT = ResourcesPlugin.getWorkspace().getRoot();
@@ -118,7 +118,7 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
* Create the marker update handler.
*/
public SynchronizeModelUpdateHandler(AbstractSynchronizeModelProvider provider) {
- super(Policy.bind("SynchronizeModelProvider.0"), "Errors occurred while updating problem markers"); //$NON-NLS-1$
+ super(Policy.bind("SynchronizeModelProvider.0"), Policy.bind("SynchronizeModelUpdateHandler.0")); //$NON-NLS-1$ //$NON-NLS-2$
this.provider = provider;
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
provider.getSyncInfoSet().addSyncSetChangedListener(this);
@@ -403,19 +403,53 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
public void nodeAdded(ISynchronizeModelElement element, AbstractSynchronizeModelProvider provider) {
element.addPropertyChangeListener(listener);
this.provider.nodeAdded(element, provider);
+ if (DEBUG) {
+ System.out.println("Node added: " + getDebugDisplayLabel(element) + " -> " + getDebugDisplayLabel((ISynchronizeModelElement)element.getParent()) + " : " + getDebugDisplayLabel(provider)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
}
/**
* This method is invoked whenever a node is removed the viewer
* by the provider or a sub-provider. The handler removes any
* listener and notifies the root provider that
- * a node was removed.
+ * a node was removed. The node removed may have children for which
+ * a nodeRemoved callback was not invoked (see modelObjectCleared).
* @param element the removed element
* @param provider the provider that added the element
*/
public void nodeRemoved(ISynchronizeModelElement element, AbstractSynchronizeModelProvider provider) {
element.removePropertyChangeListener(listener);
- provider.nodeRemoved(element, provider);
+ this.provider.nodeRemoved(element, provider);
+ if (DEBUG) {
+ System.out.println("Node removed: " + getDebugDisplayLabel(element) + " -> " + getDebugDisplayLabel((ISynchronizeModelElement)element.getParent()) + " : " + getDebugDisplayLabel(provider)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+
+ /**
+ * This method is invoked whenever a model object (i.e. node)
+ * is cleared from the model. This is similar to node removal but
+ * is deep.
+ * @param node the node that was cleared
+ */
+ public void modelObjectCleared(ISynchronizeModelElement node) {
+ this.provider.modelObjectCleared(node);
+ if (DEBUG) {
+ System.out.println("Node cleared: " + getDebugDisplayLabel(node)); //$NON-NLS-1$
+ }
+ }
+
+ private String getDebugDisplayLabel(ISynchronizeModelElement node) {
+ if (node == null) {
+ return "ROOT"; //$NON-NLS-1$
+ }
+ if (node.getResource() != null) {
+ return node.getResource().getFullPath().toString();
+ }
+ return node.getName();
+ }
+
+ private String getDebugDisplayLabel(AbstractSynchronizeModelProvider provider2) {
+ return provider2.toString();
}
/* (non-Javadoc)
@@ -464,9 +498,6 @@ public class SynchronizeModelUpdateHandler extends BackgroundEventHandler implem
return provider;
}
- /**
- * @param monitor
- */
public void connect(IProgressMonitor monitor) {
getProvider().getSyncInfoSet().connect(this, monitor);
}

Back to the top