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/CVSSynchronizeViewCompareConfiguration.java70
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java58
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java3
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java125
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java)25
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java8
8 files changed, 206 insertions, 89 deletions
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
new file mode 100644
index 000000000..ddcf85657
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 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.core.resources.IResource;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider;
+
+public class CVSSynchronizeViewCompareConfiguration extends SynchronizeViewCompareConfiguration {
+
+ private static class CVSLabelProvider extends TeamSubscriberParticipantLabelProvider {
+ protected CVSLabelProvider(SyncInfoLabelProvider syncInfoLabelProvider) {
+ super(syncInfoLabelProvider);
+ }
+ protected String decorateText(String input, Object element) {
+ String text = input;
+ if (element instanceof SyncInfoDiffNode) {
+ IResource resource = ((SyncInfoDiffNode)element).getResource();
+ if(resource != null) {
+ CVSLightweightDecorator.Decoration decoration = new CVSLightweightDecorator.Decoration();
+ CVSLightweightDecorator.decorateTextLabel(resource, decoration, false, true);
+ StringBuffer output = new StringBuffer(25);
+ if(decoration.prefix != null) {
+ output.append(decoration.prefix);
+ }
+ output.append(text);
+ if(decoration.suffix != null) {
+ output.append(decoration.suffix);
+ }
+ return output.toString();
+ }
+ } else if(element instanceof ChangeLogDiffNode) {
+ return ((ChangeLogDiffNode)element).getComment();
+ }
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.TeamSubscriberParticipantLabelProvider#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
+ */
+ protected Image decorateImage(Image base, Object element) {
+ if(element instanceof ChangeLogDiffNode) {
+ //TODO: return getCompressedFolderImage();
+ }
+ return super.decorateImage(base, element);
+ }
+ }
+
+ public CVSSynchronizeViewCompareConfiguration(ISynchronizeView view, TeamSubscriberParticipant participant) {
+ super(view, participant);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#getLabelProvider(org.eclipse.team.ui.synchronize.content.SyncInfoLabelProvider)
+ */
+ protected ILabelProvider getLabelProvider(SyncInfoLabelProvider logicalProvider) {
+ return new CVSLabelProvider(logicalProvider);
+ }
+}
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 bf4abcc47..7ef634814 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
@@ -12,60 +12,17 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.util.*;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.ui.synchronize.*;
import org.eclipse.ui.IActionDelegate;
public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implements ISyncSetChangedListener {
-
- private static class CVSLabelProvider extends TeamSubscriberParticipantLabelProvider {
- private ILabelProvider oldLabelProvider;
- public CVSLabelProvider(ILabelProvider oldLabelProvider) {
- this.oldLabelProvider = oldLabelProvider;
- }
- protected String decorateText(String input, Object element) {
- String text = input;
- if (element instanceof SyncInfoDiffNode) {
- IResource resource = ((SyncInfoDiffNode)element).getResource();
- if(resource != null) {
- CVSLightweightDecorator.Decoration decoration = new CVSLightweightDecorator.Decoration();
- CVSLightweightDecorator.decorateTextLabel((IResource) resource, decoration, false, true);
- StringBuffer output = new StringBuffer(25);
- if(decoration.prefix != null) {
- output.append(decoration.prefix);
- }
- output.append(text);
- if(decoration.suffix != null) {
- output.append(decoration.suffix);
- }
- return output.toString();
- }
- } else if(element instanceof ChangeLogDiffNode) {
- return ((ChangeLogDiffNode)element).getComment();
- }
- return text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.TeamSubscriberParticipantLabelProvider#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
- */
- protected Image decorateImage(Image base, Object element) {
- if(element instanceof ChangeLogDiffNode) {
- //TODO: return getCompressedFolderImage();
- }
- return super.decorateImage(base, element);
- }
-
- }
private List delegates = new ArrayList(2);
@@ -149,17 +106,16 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
// Listen for decorator changed to refresh the viewer's labels.
CVSUIPlugin.addPropertyChangeListener(this);
-
- // Add a CVS specific label decorator to show CVS information in the sync
- // view. We aren't using the global adaptable decorators because we don't
- // want all outgoing/repository icons in this view. Instead, we add
- // CVS specific information that is useful in the synchronizing context.
- StructuredViewer viewer = (StructuredViewer)getChangesViewer();
- ILabelProvider oldLabelProvider = (ILabelProvider)viewer.getLabelProvider();
- viewer.setLabelProvider(new CVSLabelProvider(oldLabelProvider));
}
private SyncInfoSet getSyncInfoSet() {
return getParticipant().getFilteredSyncInfoCollector().getSyncInfoSet();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.TeamSubscriberParticipantPage#createSyncInfoSetCompareConfiguration()
+ */
+ protected SynchronizeViewCompareConfiguration createSyncInfoSetCompareConfiguration() {
+ return new CVSSynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java
index 529feda95..8945db435 100644
--- a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaSyncInfoSetContentProvider.java
@@ -23,6 +23,9 @@ import org.eclipse.team.ui.synchronize.content.SyncInfoSetTreeContentProvider;
* Extend the SyncSetTreeContentProvider to show a Java model elements in the view.
*
* TODO: Refresh behavior needs to be added
+ * TODO: non-java projects
+ * TODO: jars in project
+ * TODO: Outgoing addition of bin folder?
*/
public class JavaSyncInfoSetContentProvider extends SyncInfoSetTreeContentProvider {
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 6f6f25553..f9b66d6c9 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -218,7 +218,7 @@
<logicalView
name="%CompressFolderView.name"
description="%CompressFolderView.description"
- class="org.eclipse.team.ui.synchronize.content.CompressFolderView"
+ class="org.eclipse.team.internal.ui.synchronize.views.CompressFolderView"
id="org.eclipse.team.ui.compressed-folder-view">
</logicalView>
</extension>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
index f8ac2ab36..a30c433df 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
@@ -43,10 +43,15 @@ import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.views.navigator.ResourceSorter;
/**
- * This class provides the configurability of SyncInfo diff viewers.
- * A configuration can only be used with one viewer.
- * TODO: Should we make it reusable? If not, should assert on second call to createViewer
+ * This class provides the configurability of diff viewers that contain <code>SyncInfo</code>
+ * (e.g. <code>SyncInfoDiffTreeViewer</code> and <code>SyncInfoDiffCheckboxTreeViewer</code>
+ * as well as instance of <code>SyncInfoSetCompareInput</code>.
+ * A configuration can only be used to configure a single viewer and the lifecycle of the
+ * configuration
*
+ * @see SyncInfoSetCompareInput
+ * @see SyncInfoDiffTreeViewer
+ * @see SyncInfoDiffCheckboxTreeViewer
* @since 3.0
*/
public class SyncInfoSetCompareConfiguration {
@@ -140,15 +145,33 @@ public class SyncInfoSetCompareConfiguration {
viewer.setInput(getInput());
}
- protected void initializeNavigator(final StructuredViewer viewer) {
- viewer.getControl().setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());
+ private void initializeNavigator(StructuredViewer viewer) {
if (viewer instanceof INavigableTree) {
- initializeNavigation(viewer.getControl(), (INavigableTree)viewer);
- navigator.createActions(viewer);
+ initializeNavigation(viewer, (INavigableTree)viewer);
}
}
/**
+ * Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
+ * to initialize the navigation controller for the diff tree. The navigation control
+ * is provided by an instance of <code>SyncInfoDiffTreeNavigator</code>.
+ * @param viewer the viewer to be navigated
+ * @param target the interface used to navigate the viewer
+ * @see SyncInfoDiffTreeNavigator
+ */
+ protected void initializeNavigation(StructuredViewer viewer, INavigableTree target) {
+ this.navigator = new SyncInfoDiffTreeNavigator(target);
+ INavigatable nav= new INavigatable() {
+ public boolean gotoDifference(boolean next) {
+ // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ return getNavigator().navigate(next, true);
+ }
+ };
+ viewer.getControl().setData(INavigatable.NAVIGATOR_PROPERTY, nav);
+ navigator.createActions(viewer);
+ }
+
+ /**
* Get the input that will be assigned to the viewer initialized by this configuration.
* Subclass may override.
* @return the viewer input
@@ -159,25 +182,23 @@ public class SyncInfoSetCompareConfiguration {
/**
* Get the label provider that will be assigned to the viewer initialized by this configuration.
- * Subclass may override but any created label provider should wrap the default one provided
- * by this method.
+ * 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 TeamSubscriberParticipantLabelProvider
*/
protected ILabelProvider getLabelProvider(SyncInfoLabelProvider logicalProvider) {
return new TeamSubscriberParticipantLabelProvider(logicalProvider);
}
-
- protected void initializeNavigation(Control tree, INavigableTree target) {
- this.navigator = new SyncInfoDiffTreeNavigator(target);
- INavigatable nav= new INavigatable() {
- public boolean gotoDifference(boolean next) {
- // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- return navigator.navigate(next, true);
- }
- };
- tree.setData(INavigatable.NAVIGATOR_PROPERTY, nav);
- }
+ /**
+ * Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
+ * to initialize any listeners for the viewer.
+ * @param viewer the viewer being initialize
+ */
protected void initializeListeners(final StructuredViewer viewer) {
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
@@ -186,6 +207,11 @@ public class SyncInfoSetCompareConfiguration {
});
}
+ /**
+ * Return the <code>SyncInfoSet</code> being shown by the viewer associated with
+ * this configuration.
+ * @return a <code>SyncInfoSet</code>
+ */
public SyncInfoSet getSyncSet() {
return set;
}
@@ -236,6 +262,13 @@ public class SyncInfoSetCompareConfiguration {
}
}
+ /**
+ * Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
+ * to configure the viewer to call <code>fillContextMenu(StructuredViewer, IMenuManager)</code>
+ * when a context menu is being displayed in the diff tree viewer.
+ * @param viewer the viewer being initialized
+ * @see fillContextMenu(StructuredViewer, IMenuManager)
+ */
protected void hookContextMenu(final StructuredViewer viewer) {
final MenuManager menuMgr = new MenuManager(menuId); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
@@ -278,12 +311,23 @@ public class SyncInfoSetCompareConfiguration {
}
}
+ /**
+ * Callback that is invoked when a context menu is about to be shown in the diff viewer.
+ * @param viewer the viewer
+ * @param manager the menu manager
+ */
protected void fillContextMenu(final StructuredViewer viewer, IMenuManager manager) {
navigator.fillContextMenu(viewer, manager);
addLogicalViewSelection(viewer, manager);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
+ /**
+ * Method that can be invoked from <code>fillContextMenu(StructuredViewer, IMenuManager)</code>
+ * to add a submenu that allows the selection of one of the registered logical views.
+ * @param viewer the viewer
+ * @param manager the menu manager
+ */
protected void addLogicalViewSelection(final StructuredViewer viewer, IMenuManager manager) {
logicalViews.fillContextMenu(manager);
logicalViews.setPropertyChangeListener(new IPropertyChangeListener() {
@@ -300,6 +344,12 @@ public class SyncInfoSetCompareConfiguration {
});
}
+ /**
+ * Set the logical view to be used in the diff tree viewer. Passing <code>null</code>
+ * will remove any logical view and use the standard resource hierarchy view.
+ * @param viewer the viewer
+ * @param view the logical view to be used
+ */
protected void setLogicalViewProvider(StructuredViewer viewer, ILogicalView view) {
if (view != null) {
try {
@@ -319,7 +369,11 @@ public class SyncInfoSetCompareConfiguration {
}
}
- protected Object getTitle() {
+ /**
+ * Return the title of the diff viewer. This title is used by the <code>SyncInfoCompareInput</code>.
+ * @return a title string
+ */
+ public String getTitle() {
return "Synchronization Changes";
}
@@ -330,6 +384,11 @@ public class SyncInfoSetCompareConfiguration {
getStore().removePropertyChangeListener(propertyListener);
}
+ /**
+ * Called from the <code>SyncInfoCompareInput</code> to hook up the navigation
+ * commands to the compare input
+ * @param input the compare input
+ */
public void updateCompareEditorInput(CompareEditorInput input) {
navigator.updateCompareEditorInput(input);
}
@@ -338,6 +397,7 @@ public class SyncInfoSetCompareConfiguration {
* Handles a double-click event from the viewer.
* Expands or collapses a folder when double-clicked.
*
+ * @param viewer the viewer
* @param event the double-click event
*/
protected void handleDoubleClick(StructuredViewer viewer, DoubleClickEvent event) {
@@ -346,10 +406,24 @@ public class SyncInfoSetCompareConfiguration {
navigator.reveal(viewer, element);
}
+ /**
+ * Return the navigator that is associated with this compare configuration
+ * and its viewer.
+ * @return the viewer's navigator
+ */
public SyncInfoDiffTreeNavigator getNavigator() {
return navigator;
}
+ /**
+ * Callback that is used to convert resource label change events into
+ * label change events on the model objects (namely <code>SyncInfoDiffNode</code>
+ * instances. Any provided objects that cannot be converted to resources are
+ * returned as-is in the resulting array.
+ * @param viewer the viewer
+ * @param changed the changed objects
+ * @return the changed objects converted to diff model objects if possible
+ */
protected Object[] asModelObjects(StructuredViewer viewer, Object[] changed) {
if (changed != null && viewer.getInput() != null) {
ArrayList others= new ArrayList();
@@ -369,12 +443,19 @@ public class SyncInfoSetCompareConfiguration {
}
/**
- * @return Returns the menuId.
+ * Return the menu id that is used to obtain context menu items from the workbench.
+ * @return the menuId.
*/
public String getMenuId() {
return menuId;
}
+ /**
+ * 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 and <code>false</code>
+ * otherwise
+ * @return whether to include workbench context menu items
+ */
protected boolean allowParticipantMenuContributions() {
return getMenuId() != null;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
index 7abc2b3ec..897cd1ced 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
@@ -12,8 +12,7 @@ package org.eclipse.team.ui.synchronize;
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.*;
@@ -47,6 +46,7 @@ public class SyncInfoSetCompareInput extends CompareEditorInput {
public final Viewer createDiffViewer(Composite parent) {
StructuredViewer v = internalCreateDiffViewer(parent, diffViewerConfiguration);
+ v.getControl().setData(CompareUI.COMPARE_VIEWER_TITLE, diffViewerConfiguration.getTitle());
diffViewerConfiguration.updateCompareEditorInput(this);
initializeDiffViewer(v);
return v;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java
index 9a0135709..8651058d5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize;
+package org.eclipse.team.ui.synchronize;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.core.resources.IResource;
@@ -16,11 +16,9 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.synchronize.actions.*;
-import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.actions.INavigableTree;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -42,15 +40,20 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
this.participant = participant;
}
- public StructuredViewer createViewer(Composite parent) {
- final StructuredViewer treeViewer = new SyncInfoDiffTreeViewer(parent, this);
-
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#initializeViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.viewers.StructuredViewer)
+ */
+ public void initializeViewer(Composite parent, StructuredViewer viewer) {
+ super.initializeViewer(parent, viewer);
+ initializeActions(viewer);
+ }
+
+ protected void initializeActions(StructuredViewer treeViewer) {
openWithActions = new OpenWithActionGroup(view, participant);
refactorActions = new RefactorActionGroup(view.getSite().getPage().getActivePart());
refreshSelectionAction = new TeamParticipantRefreshAction(treeViewer, participant, false /*refresh*/);
- return treeViewer;
}
-
+
protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
openWithActions.fillContextMenu(manager);
refactorActions.fillContextMenu(manager);
@@ -72,7 +75,6 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
DiffNode node = (DiffNode) selection.getFirstElement();
if (node != null && node instanceof SyncInfoDiffNode) {
SyncInfoDiffNode syncNode = (SyncInfoDiffNode)node;
- SyncInfo info = syncNode.getSyncInfo();
if (syncNode != null
&& syncNode.getResource() != null
&& syncNode.getResource().getType() == IResource.FILE) {
@@ -142,8 +144,9 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#initializeNavigation(org.eclipse.swt.widgets.Control, org.eclipse.team.internal.ui.synchronize.SyncInfoDiffTreeNavigator.INavigationTarget)
*/
- protected void initializeNavigation(Control tree, INavigableTree target) {
- super.initializeNavigation(tree, target);
+ protected void initializeNavigation(StructuredViewer viewer, INavigableTree target) {
+ super.initializeNavigation(viewer, target);
getNavigator().setShowOpenAction(false);
}
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
index b6e3f3f0a..a4be58632 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
@@ -266,9 +266,13 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
}
public Viewer createChangesViewer(Composite parent) {
- configuration = new SynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
- Viewer viewer = configuration.createViewer(parent);
+ configuration = createSyncInfoSetCompareConfiguration();
+ Viewer viewer = new SyncInfoDiffTreeViewer(parent, configuration);
getSite().setSelectionProvider(viewer);
return viewer;
}
+
+ protected SynchronizeViewCompareConfiguration createSyncInfoSetCompareConfiguration() {
+ return new SynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
+ }
} \ No newline at end of file

Back to the top