Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-02-27 02:52:55 +0000
committerJean Michel-Lemieux2004-02-27 02:52:55 +0000
commit187260d7e2acb649036192cca0d87252ae082c41 (patch)
tree183022370d47d157813b03c159cfce4c4b2ee743
parent6366302e5c3738a42d4e84e9287c7e0535aa1fc3 (diff)
downloadeclipse.platform.team-187260d7e2acb649036192cca0d87252ae082c41.tar.gz
eclipse.platform.team-187260d7e2acb649036192cca0d87252ae082c41.tar.xz
eclipse.platform.team-187260d7e2acb649036192cca0d87252ae082c41.zip
Renamed configurations and method names.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewerAdvisor.java (renamed from bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java)16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberPageDiffTreeViewerConfiguration.java)4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java245
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java2
9 files changed, 170 insertions, 142 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
index 46f72e43f..5d62ed9dd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
@@ -29,7 +29,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
public class CVSSynchronizeViewPage extends SubscriberParticipantPage implements ISynchronizeModelChangeListener {
private List delegates = new ArrayList(2);
- private CVSSynchronizeViewCompareConfiguration config;
+ private CVSSynchronizeViewerAdvisor config;
private Action groupByComment;
protected class CVSActionDelegate extends Action {
@@ -133,12 +133,14 @@ public class CVSSynchronizeViewPage extends SubscriberParticipantPage implements
return getParticipant().getSubscriberSyncInfoCollector().getSyncInfoTree();
}
+
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SubscriberParticipantPage#createSyncInfoSetCompareConfiguration()
*/
- protected SubscriberPageDiffTreeViewerConfiguration createSyncInfoSetCompareConfiguration() {
+ protected SynchronizeViewerAdvisor createSynchronizeViewerAdvisor() {
if(config == null) {
- config = new CVSSynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
+ config = new CVSSynchronizeViewerAdvisor(getSynchronizeView(), getParticipant());
}
return config;
}
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/CVSSynchronizeViewerAdvisor.java
index 2a26c00c0..9fb8a13fc 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/CVSSynchronizeViewerAdvisor.java
@@ -12,24 +12,26 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberPageDiffTreeViewerConfiguration;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
+import org.eclipse.team.ui.synchronize.subscriber.SynchronizeViewerAdvisor;
+import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElementLabelProvider;
-public class CVSSynchronizeViewCompareConfiguration extends SubscriberPageDiffTreeViewerConfiguration {
+public class CVSSynchronizeViewerAdvisor extends SynchronizeViewerAdvisor {
private boolean isGroupIncomingByComment = false;
private static class CVSLabelDecorator extends LabelProvider implements ILabelDecorator {
public String decorateText(String input, Object element) {
String text = input;
- if (element instanceof SyncInfoModelElement) {
- IResource resource = ((SyncInfoModelElement)element).getResource();
+ if (element instanceof SynchronizeModelElement) {
+ IResource resource = ((SynchronizeModelElement)element).getResource();
if(resource != null && resource.getType() != IResource.ROOT) {
CVSLightweightDecorator.Decoration decoration = new CVSLightweightDecorator.Decoration();
CVSLightweightDecorator.decorateTextLabel(resource, decoration, false, true);
@@ -51,7 +53,7 @@ public class CVSSynchronizeViewCompareConfiguration extends SubscriberPageDiffTr
}
}
- public CVSSynchronizeViewCompareConfiguration(ISynchronizeView view, SubscriberParticipant participant) {
+ public CVSSynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(view, participant);
participant.addPropertyChangeListener(this);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
index c8193c2af..712c82176 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
@@ -62,7 +62,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
private Action collapseAll;
private WorkingSetFilterActionGroup workingSetGroup;
private StatusLineContributionGroup statusLine;
- private SubscriberPageDiffTreeViewerConfiguration configuration;
+ private SynchronizeViewerAdvisor viewerAdvisor;
/**
* Constructs a new SynchronizeView.
@@ -96,7 +96,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
// toolbar
INavigatable nav = new INavigatable() {
public boolean gotoDifference(boolean next) {
- return configuration.navigate(next);
+ return viewerAdvisor.navigate(next);
}
};
gotoNext = new NavigateAction(view, nav, true /*next*/);
@@ -157,7 +157,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
public void dispose() {
statusLine.dispose();
changesSection.dispose();
- configuration.dispose();
+ viewerAdvisor.dispose();
TeamUIPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(this);
participant.removePropertyChangeListener(this);
}
@@ -289,24 +289,24 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
}
private Viewer createChangesViewer(Composite parent) {
- configuration = createSyncInfoSetCompareConfiguration();
+ viewerAdvisor = createSynchronizeViewerAdvisor();
TreeViewer viewer = new TreeViewerAdvisor.NavigableTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
GridData data = new GridData(GridData.FILL_BOTH);
viewer.getControl().setLayoutData(data);
- configuration.initializeViewer(viewer);
+ viewerAdvisor.initializeViewer(viewer);
getSite().setSelectionProvider(viewer);
return viewer;
}
public TreeViewerAdvisor getViewerConfiguration() {
- return configuration;
+ return viewerAdvisor;
}
public Viewer getViewer() {
return changesViewer;
}
- protected SubscriberPageDiffTreeViewerConfiguration createSyncInfoSetCompareConfiguration() {
- return new SubscriberPageDiffTreeViewerConfiguration(getSynchronizeView(), getParticipant());
+ protected SynchronizeViewerAdvisor createSynchronizeViewerAdvisor() {
+ return new SynchronizeViewerAdvisor(getSynchronizeView(), getParticipant());
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberPageDiffTreeViewerConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
index 35475e700..364a98827 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberPageDiffTreeViewerConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
@@ -24,7 +24,7 @@ import org.eclipse.team.ui.synchronize.viewers.*;
* Overrides the SyncInfoDiffViewerConfiguration to configure the diff viewer
* for the synchroniza view
*/
-public class SubscriberPageDiffTreeViewerConfiguration extends TreeViewerAdvisor {
+public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
private ISynchronizeView view;
private SubscriberParticipant participant;
@@ -32,7 +32,7 @@ public class SubscriberPageDiffTreeViewerConfiguration extends TreeViewerAdvisor
private RefactorActionGroup refactorActions;
private TeamParticipantRefreshAction refreshSelectionAction;
- public SubscriberPageDiffTreeViewerConfiguration(ISynchronizeView view, SubscriberParticipant participant) {
+ public SynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(participant.getId(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
this.view = view;
this.participant = participant;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
index c23fbfaa6..12511b87a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
@@ -10,11 +10,20 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
-import org.eclipse.compare.structuremergeviewer.*;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.widgets.Control;
@@ -28,12 +37,11 @@ import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
/**
- * A <code>TreeViewerAdvisor</code> object controls various UI
- * aspects of sync info viewers like the context menu, toolbar, content
- * provider, and label provider. A configuration is created to display
- * {@link SyncInfo} objects contained in the provided {@link SyncInfoSet}.
+ * A <code>StructuredViewerAdvisor</code> object controls various UI
+ * aspects of viewers that show {@link SyncInfoSet} like the context menu, toolbar, content
+ * provider, label provider, and model provider.
* <p>
- * This configuration allows viewer contributions made in a plug-in manifest to
+ * This advisor allows viewer contributions made in a plug-in manifest to
* be scoped to a particular unique id. As a result the context menu for the
* viewer can be configured to show object contributions for random id schemes.
* To enable declarative action contributions for a configuration there are two
@@ -60,22 +68,22 @@ import org.eclipse.ui.model.BaseWorkbenchContentProvider;
* @since 3.0
*/
public abstract class StructuredViewerAdvisor {
+ private SynchronizeModelProvider modelProvider;
+ private ListenerList listeners;
+ private String menuId;
private SyncInfoSet set;
- private String menuId;
private StructuredViewer viewer;
- private SynchronizeModelProvider diffNodeController;
- private ListenerList listeners;
-
- public StructuredViewerAdvisor(SyncInfoSet set) {
- this(null, set);
- }
public StructuredViewerAdvisor(String menuId, SyncInfoSet set) {
this.set = set;
this.menuId = menuId;
}
-
+
+ public StructuredViewerAdvisor(SyncInfoSet set) {
+ this(null, set);
+ }
+
/**
* Initialize the viewer with the elements of this configuration, including
* content and label providers, sorter, input and menus. This method is
@@ -97,35 +105,47 @@ public abstract class StructuredViewerAdvisor {
// The input may of been set already. In that case, don't change it and
// simply assign it to the view.
- if(diffNodeController == null) {
- diffNodeController = getDiffNodeController();
- diffNodeController.prepareInput(null);
+ if(modelProvider == null) {
+ modelProvider = getModelProvider();
+ modelProvider.prepareInput(null);
}
setInput(viewer);
}
-
+
public void addInputChangedListener(ISynchronizeModelChangeListener listener) {
if (listeners == null)
listeners= new ListenerList();
listeners.add(listener);
}
- public void removeInputChangedListener(ISynchronizeModelChangeListener listener) {
- if (listeners != null) {
- listeners.remove(listener);
- if (listeners.isEmpty())
- listeners= null;
+ /**
+ * Cleanup listeners
+ */
+ public void dispose() {
+ if(modelProvider != null) {
+ modelProvider.dispose();
}
}
- protected void fireChanges() {
- if (listeners != null) {
- Object[] l= listeners.getListeners();
- for (int i= 0; i < l.length; i++)
- ((ISynchronizeModelChangeListener) l[i]).modelChanged(diffNodeController.getInput());
- }
+ /**
+ * Return the menu id that is used to obtain context menu items from the
+ * workbench.
+ * @return the menuId.
+ */
+ public String getMenuId() {
+ return menuId;
}
+ /**
+ * Return the <code>SyncInfoSet</code> being shown by the viewer
+ * associated with this configuration.
+ * @return a <code>SyncInfoSet</code>
+ */
+ public SyncInfoSet getSyncInfoSet() {
+ return set;
+ }
+
+ public abstract boolean navigate(boolean next);
/**
* Creates the input for this view and initializes it. At the time this method
@@ -135,37 +155,19 @@ public abstract class StructuredViewerAdvisor {
* @return the input that can be shown in a viewer
*/
public Object prepareInput(IProgressMonitor monitor) throws TeamException {
- if(diffNodeController != null) {
- diffNodeController.dispose();
+ if(modelProvider != null) {
+ modelProvider.dispose();
}
- diffNodeController = getDiffNodeController();
- return diffNodeController.prepareInput(monitor);
- }
-
- /**
- * Get the input that will be assigned to the viewer initialized by this
- * configuration. Subclass may override.
- * @return the viewer input
- */
- protected abstract SynchronizeModelProvider getDiffNodeController();
-
- /**
- * Get the label provider that will be assigned to the viewer initialized
- * by this configuration. Subclass may override but should either wrap the
- * default one provided by this method or subclass <code>TeamSubscriberParticipantLabelProvider</code>.
- * In the later case, the logical label provider should still be assigned
- * to the subclass of <code>TeamSubscriberParticipantLabelProvider</code>.
- * @param logicalProvider
- * the label provider for the selected logical view
- * @return a label provider
- * @see SynchronizeModelElementLabelProvider
- */
- protected ILabelProvider getLabelProvider() {
- return new SynchronizeModelElementLabelProvider();
+ modelProvider = getModelProvider();
+ return modelProvider.prepareInput(monitor);
}
- protected IStructuredContentProvider getContentProvider() {
- return new BaseWorkbenchContentProvider();
+ public void removeInputChangedListener(ISynchronizeModelChangeListener listener) {
+ if (listeners != null) {
+ listeners.remove(listener);
+ if (listeners.isEmpty())
+ listeners= null;
+ }
}
/**
@@ -175,19 +177,20 @@ public abstract class StructuredViewerAdvisor {
* the viewer being initialize
*/
protected abstract void initializeListeners(final StructuredViewer viewer);
-
+
/**
- * Return the <code>SyncInfoSet</code> being shown by the viewer
- * associated with this configuration.
- * @return a <code>SyncInfoSet</code>
+ * Get the input that will be assigned to the viewer initialized by this
+ * configuration. Subclass may override.
+ * @return the viewer input
*/
- public SyncInfoSet getSyncInfoSet() {
- return set;
- }
-
+ protected abstract SynchronizeModelProvider getModelProvider();
+
/**
* Callback that is invoked when a context menu is about to be shown in the
- * diff viewer.
+ * viewer. Subsclasses must implement to contribute menus. Also, menus can
+ * contributed by creating a viewer contribution with a <code>targetID</code>
+ * that groups sets of actions that are related.
+ *
* @param viewer
* the viewer
* @param manager
@@ -196,29 +199,22 @@ public abstract class StructuredViewerAdvisor {
protected void fillContextMenu(final StructuredViewer viewer, IMenuManager manager) {
// subclasses will add actions
}
-
- protected StructuredViewer getViewer() {
- return viewer;
- }
-
- /**
- * Cleanup listeners
- */
- public void dispose() {
- if(diffNodeController != null) {
- diffNodeController.dispose();
- }
- }
-
+
/**
- * Return the menu id that is used to obtain context menu items from the
- * workbench.
- * @return the menuId.
+ * Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code>
+ * in order to initialize any actions for the viewer. It is invoked before
+ * the input is set on the viewer in order to allow actions to be
+ * initialized before there is any reaction to the input being set (e.g.
+ * selecting and opening the first element).
+ * <p>
+ * The default behavior is to add the up and down navigation nuttons to the
+ * toolbar. Subclasses can override.
+ * @param viewer
+ * the viewer being initialize
*/
- public String getMenuId() {
- return menuId;
+ protected void initializeActions(StructuredViewer viewer) {
}
-
+
/**
* Returns whether workbench menu items whould be included in the context
* menu. By default, this returns <code>true</code> if there is a menu id
@@ -229,6 +225,10 @@ public abstract class StructuredViewerAdvisor {
return getMenuId() != null;
}
+ /**
+ * Run the runnable in the UI thread.
+ * @param r the runnable to run in the UI thread.
+ */
protected void aSyncExec(Runnable r) {
final Control ctrl = viewer.getControl();
if (ctrl != null && !ctrl.isDisposed()) {
@@ -236,34 +236,36 @@ public abstract class StructuredViewerAdvisor {
}
}
- /**
- * @param viewer
- */
- protected void setInput(StructuredViewer viewer) {
- diffNodeController.setViewer(viewer);
- viewer.setSorter(diffNodeController.getViewerSorter());
- DiffNode input = diffNodeController.getInput();
- input.addCompareInputChangeListener(new ICompareInputChangeListener() {
- public void compareInputChanged(ICompareInput source) {
- fireChanges();
- }
- });
- viewer.setInput(diffNodeController.getInput());
+ protected void fireChanges() {
+ if (listeners != null) {
+ Object[] l= listeners.getListeners();
+ for (int i= 0; i < l.length; i++)
+ ((ISynchronizeModelChangeListener) l[i]).modelChanged(modelProvider.getInput());
+ }
+ }
+
+ protected IStructuredContentProvider getContentProvider() {
+ return new BaseWorkbenchContentProvider();
}
+
/**
- * Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code>
- * in order to initialize any actions for the viewer. It is invoked before
- * the input is set on the viewer in order to allow actions to be
- * initialized before there is any reaction to the input being set (e.g.
- * selecting and opening the first element).
- * <p>
- * The default behavior is to add the up and down navigation nuttons to the
- * toolbar. Subclasses can override.
- * @param viewer
- * the viewer being initialize
+ * Get the label provider that will be assigned to the viewer initialized
+ * by this configuration. Subclass may override but should either wrap the
+ * default one provided by this method or subclass <code>TeamSubscriberParticipantLabelProvider</code>.
+ * In the later case, the logical label provider should still be assigned
+ * to the subclass of <code>TeamSubscriberParticipantLabelProvider</code>.
+ * @param logicalProvider
+ * the label provider for the selected logical view
+ * @return a label provider
+ * @see SynchronizeModelElementLabelProvider
*/
- protected void initializeActions(StructuredViewer viewer) {
+ protected ILabelProvider getLabelProvider() {
+ return new SynchronizeModelElementLabelProvider();
+ }
+
+ protected StructuredViewer getViewer() {
+ return viewer;
}
/**
@@ -274,7 +276,7 @@ public abstract class StructuredViewerAdvisor {
* the viewer being initialized
* @see fillContextMenu(StructuredViewer, IMenuManager)
*/
- protected void hookContextMenu(final StructuredViewer viewer) {
+ protected final void hookContextMenu(final StructuredViewer viewer) {
final MenuManager menuMgr = new MenuManager(getMenuId()); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@@ -317,6 +319,19 @@ public abstract class StructuredViewerAdvisor {
}
}
}
-
- public abstract boolean navigate(boolean next);
+
+ /**
+ * @param viewer
+ */
+ protected final void setInput(StructuredViewer viewer) {
+ modelProvider.setViewer(viewer);
+ viewer.setSorter(modelProvider.getViewerSorter());
+ DiffNode input = modelProvider.getInput();
+ input.addCompareInputChangeListener(new ICompareInputChangeListener() {
+ public void compareInputChanged(ICompareInput source) {
+ fireChanges();
+ }
+ });
+ viewer.setInput(modelProvider.getInput());
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
index 03b0ae06a..2cea55b65 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
@@ -85,8 +85,8 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
* is displayed to the user.
* @param sync the <code>SyncInfo</code> used as the base for the compare input.
*/
- public SyncInfoCompareInput(String description, SyncInfo sync) {
- super(new CompareConfiguration());
+ public SyncInfoCompareInput(CompareConfiguration cc, String description, SyncInfo sync) {
+ super(cc);
Assert.isNotNull(sync);
Assert.isNotNull(description);
this.description = description;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
index 78af46d31..0486ce71f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
@@ -12,15 +12,24 @@ package org.eclipse.team.ui.synchronize.viewers;
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.compare.*;
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.CompareUI;
+import org.eclipse.compare.CompareViewerPane;
+import org.eclipse.compare.NavigationAction;
import org.eclipse.compare.internal.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
index f38806af5..39b059c18 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
@@ -182,7 +182,7 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor implements IPrope
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#getDiffNodeController()
*/
- protected SynchronizeModelProvider getDiffNodeController() {
+ protected SynchronizeModelProvider getModelProvider() {
if(getShowCompressedFolders()) {
return new CompressedFoldersModelProvider((SyncInfoTree)getSyncInfoSet());
}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java
index 833849309..f05562b70 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java
@@ -53,7 +53,7 @@ public class TestDiffNodePresentationModel extends TeamTest {
super.setUp();
this.set = new SyncInfoTree();
this.configuration = new TreeViewerAdvisor(set) {
- protected SynchronizeModelProvider getDiffNodeController() {
+ protected SynchronizeModelProvider getModelProvider() {
return TestDiffNodePresentationModel.this.getDiffNodeController(set);
}
};

Back to the top