Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java2
-rw-r--r--bundles/org.eclipse.team.ui/DESIGN.TXT44
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java9
9 files changed, 72 insertions, 28 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
index 63ed935d7..db278ebce 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
@@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
import org.eclipse.team.ui.synchronize.actions.RefreshAction;
@@ -66,7 +67,7 @@ public class CVSLocalCompareConfiguration extends DiffTreeViewerConfiguration {
public SyncInfoDiffNode prepareInput(IProgressMonitor monitor) throws TeamException {
subscriber.refresh(subscriber.roots(), IResource.DEPTH_INFINITE, monitor);
collector.waitForCollector(monitor);
- return super.getInput();
+ return getInput();
}
/* (non-Javadoc)
@@ -79,6 +80,13 @@ public class CVSLocalCompareConfiguration extends DiffTreeViewerConfiguration {
}
/* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration#getInput()
+ */
+ protected SyncInfoDiffNodeRoot getInput() {
+ return new ChangeLogDiffNodeRoot(getSyncSet());
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
*/
public void contributeToToolBar(IToolBarManager tbm) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
index 776202a7e..d7d543efe 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
@@ -27,7 +27,7 @@ public class CVSSynchronizeViewCompareConfiguration extends TeamSubscriberPageDi
String text = input;
if (element instanceof SyncInfoDiffNode) {
IResource resource = ((SyncInfoDiffNode)element).getResource();
- if(resource != null) {
+ if(resource != null && resource.getType() != IResource.ROOT) {
CVSLightweightDecorator.Decoration decoration = new CVSLightweightDecorator.Decoration();
CVSLightweightDecorator.decorateTextLabel(resource, decoration, false, true);
StringBuffer output = new StringBuffer(25);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
index 13a3352b9..b8803605e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
@@ -85,7 +85,7 @@ public class ChangeLogDiffNodeBuilder extends SyncInfoDiffNodeBuilder {
}
return null;
} catch (CVSException e) {
- CVSUIPlugin.getPlugin().log(e);
+ CVSUIPlugin.log(e);
return null;
}
}
diff --git a/bundles/org.eclipse.team.ui/DESIGN.TXT b/bundles/org.eclipse.team.ui/DESIGN.TXT
index 383a0183f..6922b1537 100644
--- a/bundles/org.eclipse.team.ui/DESIGN.TXT
+++ b/bundles/org.eclipse.team.ui/DESIGN.TXT
@@ -10,6 +10,8 @@ TeamSubscriber
SyncInfoSet/MutableSyncInfoSet (optimized collection of sync infos - immutable)
+SyncInfoFilter (filtering of sync sets used by actions and creation of sync sets)
+
SyncInfoCollector (collects sync infos from subscriber, and optionally from workspace. Uses background thread to collect and calculate changes. Is updated automatically with changes)
FilteredSyncInfoSet (filters a provided sync info set with a given filter and possible roots)
@@ -18,16 +20,13 @@ FilteredSyncInfoSet (filters a provided sync info set with a given filter and po
ui
======================
+ISynchronizeManager (manages the lifesycle of synchronize participants)
+
ISynchronizeView
ISynchronizeParticipant (shows in the sync view, has a mode, working set, and creates a page with the UI pieces)
-
-
-
-Mode (DirectionFilterActionGroup)
-
-SyncInfoFilter
+Modes in sync view (DirectionFilterActionGroup)
SyncInfoSetCompareConfiguration (encapsulates navigation, menus, content, label providers)this
is used to configure a viewer in different ways based on it's use.
@@ -36,4 +35,35 @@ SyncInfoDiffTreeViewer/SyncInfoDiffCheckboxViewer (shows diff nodes)
SyncInfoDiffNode -> DiffNode
-SyncInfoSetCompareInput \ No newline at end of file
+SyncInfoSetCompareInput
+
+
+
+DiffNode
+SyncInfoDiffNode
+SyncInfoDiffNodeRoot
+
+Viewer
+ContentProvider
+Sorter
+LabelProvider
+
+1. sync set is created
+2. decide how to model the sync set (hierachy, compressed, change log...) sorter...
+3. hook up chagnen listener
+4. ensure model doesn't change while building it?
+5. update model dynamically
+6. dispose of listener when input changes
+
+SuperCharged MVC
+================
+
+View (viewers) -> view configurators (menus, content provider, label provider, controller)
+
+Model (diff nodes) logical structure of sync info
+
+Controller (creates model, keeps it up-to-date, sorter)
+
+Data (sync info)
+
+
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
index 3401359fb..54ec58d4f 100644
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -15,7 +15,7 @@
x P3 schedule support by participant.
this requires changing the refresh jobs to accept scheduling different jobs. Essentially being able to have an
- ordered queue of refreshes. Also, participant will need a schedule object to encapsulate the schedule logic.
+ ordered *queue of refreshes. Also, participant will need a schedule object to encapsulate the schedule logic.
x P3 status message could be more precise instead of simply "Working". But to do this we need access to the job progress monitor
and it isn't available API from the UI. (removed status in sync view, progress will be shown in the progress shell).
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
index 9aa1814ff..6499e77f3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
@@ -28,7 +28,7 @@ public class TreeViewerUtils {
* @param next if <code>true</code> the next node is selected, otherwise the previous node
* @return <code>true</code> if at end (or beginning)
*/
- public static boolean navigate(TreeViewer viewer, boolean next, boolean fireOpen) {
+ public static boolean navigate(TreeViewer viewer, boolean next, boolean fireOpen, boolean expandOnly) {
Tree tree = viewer.getTree();
if (tree == null) return false;
@@ -42,7 +42,7 @@ public class TreeViewerUtils {
if (children != null && children.length > 0) {
item= children[0];
if (item != null && item.getItemCount() <= 0) {
- setSelection(viewer, item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ setSelection(viewer, item, fireOpen, expandOnly); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
return false;
}
}
@@ -57,23 +57,27 @@ public class TreeViewerUtils {
}
if (item != null) {
- setSelection(viewer, item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ setSelection(viewer, item, fireOpen, expandOnly); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
return false;
}
return true;
}
- private static void setSelection(TreeViewer viewer, TreeItem ti, boolean fireOpen) {
+ private static void setSelection(TreeViewer viewer, TreeItem ti, boolean fireOpen, boolean expandOnly) {
if (ti != null) {
Object data= ti.getData();
if (data != null) {
// Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- ISelection selection= new StructuredSelection(data);
- viewer.setSelection(selection, true);
- ISelection currentSelection= viewer.getSelection();
- if (fireOpen && currentSelection != null && selection.equals(currentSelection)) {
- if(viewer instanceof ITreeViewerAccessor) {
- ((ITreeViewerAccessor)viewer).openSelection();
+ ISelection selection = new StructuredSelection(data);
+ if (expandOnly) {
+ viewer.expandToLevel(data, 0);
+ } else {
+ viewer.setSelection(selection, true);
+ ISelection currentSelection = viewer.getSelection();
+ if (fireOpen && currentSelection != null && selection.equals(currentSelection)) {
+ if (viewer instanceof ITreeViewerAccessor) {
+ ((ITreeViewerAccessor) viewer).openSelection();
+ }
}
}
}
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 1450f0a3d..c4aac8366 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
@@ -21,6 +21,7 @@ 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.*;
+import org.eclipse.team.internal.ui.synchronize.views.TreeViewerUtils;
import org.eclipse.team.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.team.ui.synchronize.views.*;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -251,12 +252,12 @@ public class DiffTreeViewerConfiguration implements IPropertyChangeListener {
protected void handleDoubleClick(StructuredViewer viewer, DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
Object element = selection.getFirstElement();
- if(viewer instanceof AbstractTreeViewer) {
+ if(viewer instanceof TreeViewer) {
AbstractTreeViewer treeViewer = ((AbstractTreeViewer)viewer);
if(treeViewer.getExpandedState(element)) {
treeViewer.collapseToLevel(element, AbstractTreeViewer.ALL_LEVELS);
} else {
- treeViewer.expandToLevel(element, AbstractTreeViewer.ALL_LEVELS);
+ TreeViewerUtils.navigate((TreeViewer)viewer, true /*next*/, false /*don't fire open*/, true /*only expand*/);
}
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
index 5d5ceec14..a7f4b2335 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
@@ -50,7 +50,7 @@ public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer i
* @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int)
*/
public boolean gotoDifference(boolean next) {
- return TreeViewerUtils.navigate(this, next, true);
+ return TreeViewerUtils.navigate(this, next, false /*don't fire open event*/, false /*set selection*/);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
index 5469dbb42..29f974855 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
@@ -11,7 +11,8 @@
package org.eclipse.team.ui.synchronize;
import org.eclipse.compare.internal.INavigatable;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.widgets.Composite;
@@ -40,15 +41,15 @@ public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigatable,
protected void inputChanged(Object in, Object oldInput) {
super.inputChanged(in, oldInput);
if (in != oldInput) {
- TreeViewerUtils.navigate(this, true /*next*/, false /*don't fire open event*/);
+ gotoDifference(true /*next*/);
}
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int)
*/
- public boolean gotoDifference(boolean direction) {
- return TreeViewerUtils.navigate(this, direction, false);
+ public boolean gotoDifference(boolean next) {
+ return TreeViewerUtils.navigate(this, next, false /*don't fire open event*/, false /*set selection*/);
}
/* (non-Javadoc)

Back to the top