Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-02-01 03:18:23 +0000
committerJean Michel-Lemieux2004-02-01 03:18:23 +0000
commita0ccdec6424fc2df162fff928da3e35e742a6939 (patch)
treebd48e06b5c07321f1d639f19432bebd09a6d79ee
parentf2bad65e8e786531e97cd103afb7c8fe2801f72c (diff)
downloadeclipse.platform.team-a0ccdec6424fc2df162fff928da3e35e742a6939.tar.gz
eclipse.platform.team-a0ccdec6424fc2df162fff928da3e35e742a6939.tar.xz
eclipse.platform.team-a0ccdec6424fc2df162fff928da3e35e742a6939.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java)23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/ShowSynchronizeParticipantAction.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java)2
8 files changed, 45 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
index 9753feaf5..3700ff388 100644
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -87,19 +87,29 @@ x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
- actions in sync view all assume that selection will have a resource (e.g refresh action).
- how would a refresh know what to select if a change comment node was selected, for example
- could first attempt to obtain resource and, if that fails, visit children to obtain resources
+ [jm] I think that actions will have to know about DiffNodes and we need the helper to
+ get the list of children nodes.
- sorter is related to input so may need to change when input does
- there does not appear to be a clean way to change the sorter and input without causing two refreshes
- SyncInfoSet##getOutOfSyncDescendants(IResource) is speced to include the resource itself if it is out-of-sync
- this is a bit confusing as the name implies otherwise
- should either consider a name change or a soec change
+ [jm] I never understood why is was spec'd like that :) You can decide...
- compare input requires root node to have children or diff viewer is not added
- this is problematic when creating a wizard page that is dynamically populated
- not sure if there's problems caused by returning true when there are no children
+ [jm] I think this it's fine to have root nodes return true to hasChildren. I don't like
+ compares subtle way of determining is the diff viewer should be shown, but in our case a
+ root node can safely always have children.
- several places require a resource
- e.g. conflict propogation requires a resource but shouldn't (modified to work without a resource)
- conflicts do not propogate in comment view
+ [jm] we have to change this assumption everywhere! Actions, label decorators... and such.
+- there are times when the sync set changes but the input hasn't yet and the given input
+ doesn't handle outgoing changes. For example, when changing from incoming to outgoing with
+ the change log root, the change log root gets a reset from the sync set then the input
+ is changed. this can cause an NPE. Must look into the ordering here.
- the test cases starve the subscriber event handler such that an event has additions and removals for the same resources
- this causes failures in the diff tree builders
- although less likely in UI, can still happen
- - need tests for these scenarios to ensure generated event is correct after addition and removal
- \ No newline at end of file
+ - need tests for these scenarios to ensure generated event is correct after addition and removal \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
index f3c3c8585..b573ec953 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
@@ -19,7 +19,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.actions.TeamAction;
-import org.eclipse.team.internal.ui.synchronize.compare.SyncInfoCompareInput;
+import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.ui.*;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java
index 875eae831..c772d53da 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SynchronizePageDropDownAction.java
@@ -25,6 +25,7 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.actions.*;
import org.eclipse.ui.texteditor.IUpdate;
public class SynchronizePageDropDownAction extends Action implements IMenuCreator, ISynchronizeParticipantListener, IUpdate {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
index 57070800a..1450f0a3d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
@@ -17,8 +17,7 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.*;
@@ -292,4 +291,11 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
private boolean getShowCompressedFolders() {
return TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS);
}
+
+ protected void aSyncExec(Runnable r) {
+ final Control ctrl = viewer.getControl();
+ if (ctrl != null && !ctrl.isDisposed()) {
+ ctrl.getDisplay().asyncExec(r);
+ }
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java
index c374bc350..f88ce1963 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoCompareInput.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize.compare;
+package org.eclipse.team.ui.synchronize;
import java.lang.reflect.InvocationTargetException;
@@ -21,9 +21,25 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.synchronize.compare.LocalResourceTypedElement;
import org.eclipse.team.ui.ISharedImages;
-import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
+/**
+ * A {@link SyncInfo} editor input used as input to a two-way or three-way
+ * compare viewer. It defines methods for accessing the three sides for the
+ * compare, and a name and image which is used when displaying the three way input
+ * in an editor. This input can alternatly be used to show compare results in
+ * a dialog by calling {@link CompareUI#openCompareDialog()}.
+ * <p>
+ * Supports saving the local resource if changed in the editor.
+ * </p>
+ * <p>
+ * Use {@link SyncInfoCompareInput} to display more than one <code>SyncInfo</code>
+ * in an compare viewer.
+ * </p>
+ * @see SyncInfoDiffNode
+ * @since 3.0
+ */
public class SyncInfoCompareInput extends CompareEditorInput {
private SyncInfo sync;
@@ -141,9 +157,6 @@ public class SyncInfoCompareInput extends CompareEditorInput {
}
}
- /*
- * Recursively walks the diff tree and commits all changes.
- */
private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
ITypedElement left = node.getLeft();
if (left instanceof LocalResourceTypedElement)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
index 6befd009c..87818e5ea 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNode.java
@@ -27,7 +27,7 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbenchAdapter {
private IResource resource;
- private SyncInfoSet input;
+ private SyncInfoSet syncSet;
private SyncInfo info;
/**
@@ -111,7 +111,7 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbench
*/
public SyncInfoDiffNode(IDiffContainer parent, SyncInfoSet set, IResource resource) {
this(parent, createBaseTypeElement(set, resource), createLocalTypeElement(set, resource), createRemoteTypeElement(set, resource), getSyncKind(set, resource));
- this.input = set;
+ this.syncSet = set;
this.resource = resource;
this.info = null;
}
@@ -125,7 +125,7 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbench
public SyncInfoDiffNode(SyncInfo info) {
this(null, createBaseTypeElement(info), createLocalTypeElement(info), createRemoteTypeElement(info), info.getKind());
this.info = info;
- this.input = null;
+ this.syncSet = null;
this.resource = info.getLocal();
}
@@ -229,7 +229,7 @@ public class SyncInfoDiffNode extends DiffNode implements IAdaptable, IWorkbench
* @return a <code>SyncInfoSet</code>
*/
public SyncInfoSet getSyncInfoSet() {
- return input;
+ return syncSet;
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
index d119e3a2a..0a743abb5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffNodeRoot.java
@@ -16,12 +16,6 @@ import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder;
import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeSorter;
-/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
public class SyncInfoDiffNodeRoot extends SyncInfoDiffNode {
SyncInfoDiffNodeBuilder builder;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
index e0d21abd6..0db3424b5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize.actions;
+package org.eclipse.team.ui.synchronize.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.team.ui.synchronize.ISynchronizeView;

Back to the top