Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-16 21:13:35 +0000
committerJean Michel-Lemieux2004-03-16 21:13:35 +0000
commit2925d223326c053676ec480def18c44c6abe7d10 (patch)
treea1620324e1dfbabdffe08bb6db05c96a2ae8ee62
parent0de9583bf935d2c4938765fe688062ea8df9e3db (diff)
downloadeclipse.platform.team-2925d223326c053676ec480def18c44c6abe7d10.tar.gz
eclipse.platform.team-2925d223326c053676ec480def18c44c6abe7d10.tar.xz
eclipse.platform.team-2925d223326c053676ec480def18c44c6abe7d10.zip
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoModelElement.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoModelElement.java)4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElement.java)9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementLabelProvider.java)52
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementSorter.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementSorter.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java52
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/UnchangedResourceModelElement.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/UnchangedResourceModelElement.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java2
-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/OpenWithActionGroup.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/DecoratingColorLabelProvider.java62
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelElement.java44
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java32
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelAction.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberAction.java)18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelOperation.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java)21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java20
24 files changed, 260 insertions, 146 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
index b087af928..fd7382383 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
@@ -153,7 +153,7 @@ public class ChangesSection extends Composite {
public void setViewer(Viewer viewer) {
this.changesViewer = viewer;
calculateDescription();
- page.getViewerAdviser().addInputChangedListener(changedListener);
+ page.getViewerAdvisor().addInputChangedListener(changedListener);
participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet().addSyncSetChangedListener(subscriberListener);
participant.getSubscriberSyncInfoCollector().getSyncInfoTree().addSyncSetChangedListener(outputSetListener);
}
@@ -288,7 +288,7 @@ public class ChangesSection extends Composite {
public void dispose() {
super.dispose();
- page.getViewerAdviser().removeInputChangedListener(changedListener);
+ page.getViewerAdvisor().removeInputChangedListener(changedListener);
participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet().removeSyncSetChangedListener(subscriberListener);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
index 47e360b1c..e1ce476ed 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
@@ -256,7 +256,7 @@ public final class SubscriberParticipantPage implements IPageBookViewPage, IProp
statusLine.fillActionBars(actionBars);
// allow the advisor to contribute
- getViewerConfiguration().setActionBars(actionBars);
+ getViewerAdvisor().setActionBars(actionBars);
}
}
@@ -322,7 +322,7 @@ public final class SubscriberParticipantPage implements IPageBookViewPage, IProp
return viewer;
}
- public StructuredViewerAdvisor getViewerConfiguration() {
+ public StructuredViewerAdvisor getViewerAdvisor() {
return viewerAdvisor;
}
@@ -331,6 +331,6 @@ public final class SubscriberParticipantPage implements IPageBookViewPage, IProp
}
public void setSelection(Object[] objects, boolean reveal) {
- getViewerConfiguration().setSelection(objects, reveal);
+ getViewerAdvisor().setSelection(objects, reveal);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoModelElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoModelElement.java
index fd3c93b44..f6cc756c0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoModelElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncInfoModelElement.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.ResourceNode;
@@ -19,8 +19,6 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
-import org.eclipse.team.internal.ui.synchronize.RemoteResourceTypedElement;
/**
* A diff node used to display the synchronization state for resources described by
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java
index 0c05f4ace..598833150 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.resources.IResource;
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.*;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.viewers.*;
import org.eclipse.ui.model.IWorkbenchAdapter;
/**
@@ -24,11 +24,8 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
*
* @since 3.0
*/
-public abstract class SynchronizeModelElement extends DiffNode implements IAdaptable {
+public abstract class SynchronizeModelElement extends DiffNode implements IAdaptable, ISynchronizeModelElement {
- public static final String BUSY_PROPERTY = TeamUIPlugin.ID + ".busy"; //$NON-NLS-1$
- public static final String PROPAGATED_CONFLICT_PROPERTY = TeamUIPlugin.ID + ".conflict"; //$NON-NLS-1$
-
/*
* Internal flags bits for stroing properties in the flags variable
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java
index e703cdab4..f84d1b87b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementLabelProvider.java
@@ -8,25 +8,27 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import java.util.*;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.viewers.ISynchronizeModelElement;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* A label provider that decorates viewers showing
- * {@link org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement}.
+ * {@link ISynchronizeModelElement}.
*
* @since 3.0
*/
@@ -42,40 +44,6 @@ public class SynchronizeModelElementLabelProvider extends LabelProvider implemen
// the workbench adapter.
private WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
- /**
- * Decorating label provider that also support color providers
- */
- public static class DecoratingColorLabelProvider extends DecoratingLabelProvider implements IColorProvider {
-
- public DecoratingColorLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
- super(provider, decorator);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
- */
- public Color getForeground(Object element) {
- ILabelProvider p = getLabelProvider();
- if (p instanceof IColorProvider) {
- return ((IColorProvider) p).getForeground(element);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
- */
- public Color getBackground(Object element) {
- ILabelProvider p = getLabelProvider();
- if (p instanceof IColorProvider) {
- return ((IColorProvider) p).getBackground(element);
- }
- return null;
- }
- }
-
public SynchronizeModelElementLabelProvider() {
}
@@ -84,9 +52,9 @@ public class SynchronizeModelElementLabelProvider extends LabelProvider implemen
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/
public Color getForeground(Object element) {
- if (element instanceof SynchronizeModelElement) {
- SynchronizeModelElement node = (SynchronizeModelElement)element;
- if(node.getProperty(SynchronizeModelElement.BUSY_PROPERTY)) {
+ if (element instanceof ISynchronizeModelElement) {
+ ISynchronizeModelElement node = (ISynchronizeModelElement)element;
+ if(node.getProperty(ISynchronizeModelElement.BUSY_PROPERTY)) {
return Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
}
}
@@ -184,8 +152,8 @@ public class SynchronizeModelElementLabelProvider extends LabelProvider implemen
* @return whether the node has descendant conflicts
*/
private boolean hasDecendantConflicts(DiffNode node) {
- if(node instanceof SynchronizeModelElement) {
- return ((SynchronizeModelElement)node).getProperty(SynchronizeModelElement.PROPAGATED_CONFLICT_PROPERTY);
+ if(node instanceof ISynchronizeModelElement) {
+ return ((ISynchronizeModelElement)node).getProperty(ISynchronizeModelElement.PROPAGATED_CONFLICT_PROPERTY);
}
return false;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementSorter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementSorter.java
index 7056320c6..43ce736f5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelElementSorter.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelElementSorter.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.Viewer;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
index 576117caf..311911027 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
@@ -27,7 +27,8 @@ import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.ui.synchronize.viewers.*;
+import org.eclipse.team.ui.synchronize.viewers.ISynchronizeModelElement;
+import org.eclipse.team.ui.synchronize.viewers.ISynchronizeModelProvider;
import org.eclipse.ui.progress.UIJob;
/**
@@ -154,7 +155,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
/**
* Builds the viewer model based on the contents of the sync set.
*/
- public SynchronizeModelElement prepareInput(IProgressMonitor monitor) {
+ public ISynchronizeModelElement prepareInput(IProgressMonitor monitor) {
// Connect to the sync set which will register us as a listener and give us a reset event
// in a background thread
getSyncInfoSet().connect(this, monitor);
@@ -188,7 +189,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* {@link #prepareInput(IProgressMonitor)} hasn't been called on this object yet.
* @return
*/
- public SynchronizeModelElement getModelRoot() {
+ public ISynchronizeModelElement getModelRoot() {
return root;
}
@@ -201,8 +202,8 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* the resource
* @return the <code>SyncInfoModelElement</code> for the given resource
*/
- protected SynchronizeModelElement getModelObject(IResource resource) {
- return (SynchronizeModelElement) resourceMap.get(resource);
+ protected ISynchronizeModelElement getModelObject(IResource resource) {
+ return (ISynchronizeModelElement) resourceMap.get(resource);
}
public void syncInfoChanged(final ISyncInfoSetChangeEvent event, IProgressMonitor monitor) {
@@ -217,7 +218,9 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
BusyIndicator.showWhile(ctrl.getDisplay(), new Runnable() {
public void run() {
handleChanges((ISyncInfoTreeChangeEvent)event);
- getModelRoot().fireChanges();
+ ISynchronizeModelElement root = getModelRoot();
+ if(root instanceof SynchronizeModelElement)
+ ((SynchronizeModelElement)root).fireChanges();
}
});
}
@@ -232,13 +235,13 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* @param node
* @return
*/
- protected abstract IDiffElement[] buildModelObjects(SynchronizeModelElement node);
+ protected abstract IDiffElement[] buildModelObjects(ISynchronizeModelElement node);
- protected abstract void doAdd(SynchronizeModelElement parent, SynchronizeModelElement element);
+ protected abstract void doAdd(ISynchronizeModelElement parent, ISynchronizeModelElement element);
- protected abstract void doRemove(SynchronizeModelElement element);
+ protected abstract void doRemove(ISynchronizeModelElement element);
- protected void associateDiffNode(SynchronizeModelElement node) {
+ protected void associateDiffNode(ISynchronizeModelElement node) {
IResource resource = node.getResource();
if(resource != null) {
resourceMap.put(resource, node);
@@ -286,7 +289,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
*/
protected abstract void handleResourceChanges(ISyncInfoTreeChangeEvent event);
- protected boolean isConflicting(SynchronizeModelElement diffNode) {
+ protected boolean isConflicting(ISynchronizeModelElement diffNode) {
return (diffNode.getKind() & SyncInfo.DIRECTION_MASK) == SyncInfo.CONFLICTING;
}
@@ -308,7 +311,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
// remove all from tree viewer
IDiffElement[] elements = getModelRoot().getChildren();
for (int i = 0; i < elements.length; i++) {
- doRemove((SynchronizeModelElement)elements[i]);
+ doRemove((ISynchronizeModelElement)elements[i]);
}
// Rebuild the model
@@ -316,7 +319,10 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
buildModelObjects(getModelRoot());
// Notify listeners that model has changed
- getModelRoot().fireChanges();
+ ISynchronizeModelElement root = getModelRoot();
+ if(root instanceof SynchronizeModelElement) {
+ ((SynchronizeModelElement)root).fireChanges();
+ }
} finally {
refreshViewer = true;
}
@@ -337,7 +343,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* @param resource
*/
protected void removeFromViewer(IResource resource) {
- SynchronizeModelElement node = getModelObject(resource);
+ ISynchronizeModelElement node = getModelObject(resource);
if (node == null) return;
if (isConflicting(node)) {
setParentConflict(node, false);
@@ -356,12 +362,12 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* @param node
* the root node
*/
- protected void clearModelObjects(SynchronizeModelElement node) {
+ protected void clearModelObjects(ISynchronizeModelElement node) {
IDiffElement[] children = node.getChildren();
for (int i = 0; i < children.length; i++) {
IDiffElement element = children[i];
- if (element instanceof SynchronizeModelElement) {
- clearModelObjects((SynchronizeModelElement) element);
+ if (element instanceof ISynchronizeModelElement) {
+ clearModelObjects((ISynchronizeModelElement) element);
}
}
IResource resource = node.getResource();
@@ -374,7 +380,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
}
}
- protected void addToViewer(SynchronizeModelElement node) {
+ protected void addToViewer(ISynchronizeModelElement node) {
associateDiffNode(node);
node.addPropertyChangeListener(listener);
if (isConflicting(node)) {
@@ -406,7 +412,7 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
* are accumulated and updated in a single call.
* @param diffNode the diff node to be updated
*/
- protected void updateLabel(SynchronizeModelElement diffNode) {
+ protected void updateLabel(ISynchronizeModelElement diffNode) {
pendingLabelUpdates.add(diffNode);
}
@@ -433,15 +439,15 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
}
}
- protected void setParentConflict(SynchronizeModelElement diffNode, boolean value) {
- diffNode.setPropertyToRoot(SynchronizeModelElement.PROPAGATED_CONFLICT_PROPERTY, value);
+ protected void setParentConflict(ISynchronizeModelElement diffNode, boolean value) {
+ diffNode.setPropertyToRoot(ISynchronizeModelElement.PROPAGATED_CONFLICT_PROPERTY, value);
updateParentLabels(diffNode);
}
- private void updateParentLabels(SynchronizeModelElement diffNode) {
+ private void updateParentLabels(ISynchronizeModelElement diffNode) {
updateLabel(diffNode);
while (diffNode.getParent() != null) {
- diffNode = (SynchronizeModelElement)diffNode.getParent();
+ diffNode = (ISynchronizeModelElement)diffNode.getParent();
updateLabel(diffNode);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/UnchangedResourceModelElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/UnchangedResourceModelElement.java
index a2b17e0d5..a9f0459aa 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/UnchangedResourceModelElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/UnchangedResourceModelElement.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.core.resources.IResource;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
index 6da1e0fcb..85f3a1402 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
@@ -18,8 +18,8 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.actions.ActionFactory;
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 0a99a1f94..c697b36e7 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
@@ -18,10 +18,10 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.viewers.SyncInfoCompareInput;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
import org.eclipse.ui.*;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
index 1d1fd9cfa..31a0e8cc1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
@@ -16,9 +16,9 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SubscriberParticipantPage;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.OpenWithMenu;
import org.eclipse.ui.views.navigator.ResourceNavigatorMessages;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
index 073399729..e030eaeff 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
@@ -19,10 +19,12 @@ import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.RefreshUserNotificationPolicy;
import org.eclipse.team.internal.ui.synchronize.RefreshUserNotificationPolicyInModalDialog;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor;
import org.eclipse.ui.*;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -111,7 +113,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
}
protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
- return new SubscriberParticipantPage(this, view);
+ return new SubscriberParticipantPage(this, view, createSynchronizeViewerAdvisor(view));
}
/* (non-Javadoc)
@@ -235,6 +237,14 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
}
/**
+ * Returns the viewer advisor which will be used to configure the display of the participant.
+ * @return
+ */
+ protected StructuredViewerAdvisor createSynchronizeViewerAdvisor(ISynchronizeView view) {
+ return new SynchronizeViewerAdvisor(view, this);
+ }
+
+ /**
* Get the <code>Subscriber</code> for this participant
* @return a <code>TamSubscriber</code>
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
index 1c93d6a78..88a3eed42 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
@@ -16,10 +16,10 @@ import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.internal.ui.synchronize.actions.OpenWithActionGroup;
import org.eclipse.team.internal.ui.synchronize.actions.RefactorActionGroup;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
/**
@@ -33,7 +33,6 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
private OpenWithActionGroup openWithActions;
private RefactorActionGroup refactorActions;
private Action refreshSelectionAction;
- private IToolBarManager toolbarMgr;
public SynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(participant.getId(), view.getViewSite(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
@@ -62,6 +61,10 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
Utils.initAction(refreshSelectionAction, "action.refreshWithRemote."); //$NON-NLS-1$
}
+ protected ISynchronizeView getSynchronizeView() {
+ return view;
+ }
+
protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
openWithActions.fillContextMenu(manager);
refactorActions.fillContextMenu(manager);
@@ -69,10 +72,6 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
manager.add(new Separator());
super.fillContextMenu(viewer, manager);
}
-
- public void updateToolbar(IToolBarManager mgr) {
-
- }
/*
* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/DecoratingColorLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/DecoratingColorLabelProvider.java
new file mode 100644
index 000000000..dc1cd6e70
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/DecoratingColorLabelProvider.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.ui.synchronize.viewers;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+
+/**
+ * Decorating label provider that also support color providers
+ *
+ * @since 3.0
+ */
+public class DecoratingColorLabelProvider extends DecoratingLabelProvider implements IColorProvider, IFontProvider {
+
+ public DecoratingColorLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
+ super(provider, decorator);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ ILabelProvider p = getLabelProvider();
+ if (p instanceof IColorProvider) {
+ return ((IColorProvider) p).getForeground(element);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ ILabelProvider p = getLabelProvider();
+ if (p instanceof IColorProvider) {
+ return ((IColorProvider) p).getBackground(element);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
+ */
+ public Font getFont(Object element) {
+ ILabelProvider p = getLabelProvider();
+ if (p instanceof IFontProvider) {
+ return ((IFontProvider) p).getFont(element);
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
index 189aa111f..54c00ab81 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
+
/**
* Listener that gets informed when the model created by the model provider is created or updated.
* <p>
@@ -23,5 +24,5 @@ public interface ISynchronizeModelChangeListener {
*
* @param input the root <code>DiffNode</code> of the model.
*/
- public void modelChanged(SynchronizeModelElement root);
+ public void modelChanged(ISynchronizeModelElement root);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelElement.java
new file mode 100644
index 000000000..1e978d48e
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelElement.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.ui.synchronize.viewers;
+
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+
+public interface ISynchronizeModelElement extends IDiffContainer, ITypedElement, ICompareInput {
+
+ public static final String BUSY_PROPERTY = TeamUIPlugin.ID + ".busy"; //$NON-NLS-1$
+ public static final String PROPAGATED_CONFLICT_PROPERTY = TeamUIPlugin.ID + ".conflict"; //$NON-NLS-1$
+
+ public abstract void addPropertyChangeListener(IPropertyChangeListener listener);
+
+ public abstract void removePropertyChangeListener(IPropertyChangeListener listener);
+
+ public void setPropertyToRoot(String propertyName, boolean value);
+
+ public void setProperty(String propertyName, boolean value);
+
+ /**
+ * Return whether this node has the given property set.
+ * @param propertyName the flag to test
+ * @return <code>true</code> if the property is set
+ */
+ public abstract boolean getProperty(String propertyName);
+
+ public abstract ImageDescriptor getImageDescriptor(Object object);
+
+ public abstract IResource getResource();
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
index 63a204a80..43e565ea7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
@@ -37,7 +37,7 @@ public interface ISynchronizeModelProvider {
/**
* Builds the viewer model based on the contents of the sync set.
*/
- public abstract SynchronizeModelElement prepareInput(IProgressMonitor monitor);
+ public abstract ISynchronizeModelElement prepareInput(IProgressMonitor monitor);
/**
* The provider can try and return a mapping for the provided object. Providers often use mappings
@@ -61,7 +61,7 @@ public interface ISynchronizeModelProvider {
* {@link #prepareInput(IProgressMonitor)} hasn't been called on this object yet.
* @return
*/
- public abstract SynchronizeModelElement getModelRoot();
+ public abstract ISynchronizeModelElement getModelRoot();
public abstract ViewerSorter getViewerSorter();
} \ No newline at end of file
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 49f9aa330..cd2ed0539 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
@@ -25,7 +25,8 @@ import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider;
+import org.eclipse.team.internal.ui.synchronize.SynchronizeModelElementLabelProvider;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
@@ -77,7 +78,7 @@ public abstract class StructuredViewerAdvisor {
// in the viewer.
private SyncInfoSet set;
private StructuredViewer viewer;
- private SynchronizeModelProvider modelProvider;
+ private ISynchronizeModelProvider modelProvider;
// Listeners for model changes
private ListenerList listeners;
@@ -271,7 +272,16 @@ public abstract class StructuredViewerAdvisor {
* @param viewer the viewer in which the context menu is being shown.
* @param manager the menu manager to which actions can be added.
*/
- protected void fillContextMenu(final StructuredViewer viewer, IMenuManager manager) {
+ protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
+ }
+
+ /**
+ * Allows the advisor to make contributions to the given action bars. Note that some of the
+ * items in the action bar may not be accessible.
+ *
+ * @param actionBars the toolbar manager to which to add actions.
+ */
+ public void setActionBars(IActionBars actionBars) {
}
/**
@@ -303,7 +313,7 @@ public abstract class StructuredViewerAdvisor {
* for the adviser's viewer.
* @return the model provider
*/
- protected abstract SynchronizeModelProvider getModelProvider();
+ protected abstract ISynchronizeModelProvider getModelProvider();
/**
@@ -442,12 +452,14 @@ public abstract class StructuredViewerAdvisor {
protected final void setInput(StructuredViewer viewer) {
modelProvider.setViewer(viewer);
viewer.setSorter(modelProvider.getViewerSorter());
- DiffNode input = modelProvider.getModelRoot();
- input.addCompareInputChangeListener(new ICompareInputChangeListener() {
- public void compareInputChanged(ICompareInput source) {
- fireChanges();
- }
- });
+ ISynchronizeModelElement input = modelProvider.getModelRoot();
+ if (input instanceof DiffNode) {
+ ((DiffNode) input).addCompareInputChangeListener(new ICompareInputChangeListener() {
+ public void compareInputChanged(ICompareInput source) {
+ fireChanges();
+ }
+ });
+ }
viewer.setInput(modelProvider.getModelRoot());
}
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 e3c9c9f29..02ac0fcb5 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
@@ -24,6 +24,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.ui.*;
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 b3d6fb782..22a57114e 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
@@ -19,8 +19,7 @@ import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.action.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
@@ -29,8 +28,10 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.team.ui.TeamImages;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IProgressService;
@@ -182,6 +183,8 @@ public class SynchronizeCompareInput extends CompareEditorInput implements ICont
tbm.removeAll();
tbm.add(new Separator("navigation")); //$NON-NLS-1$
contributeToToolBar(tbm);
+ IActionBars bars = getActionBars(tbm);
+ getViewerConfiguration().setActionBars(bars);
tbm.update(true);
}
}
@@ -216,10 +219,10 @@ public class SynchronizeCompareInput extends CompareEditorInput implements ICont
*/
public void saveChanges(IProgressMonitor pm) throws CoreException {
super.saveChanges(pm);
- SynchronizeModelElement root = (SynchronizeModelElement)diffViewerConfiguration.getViewer().getInput();
- if (root != null) {
+ ISynchronizeModelElement root = (ISynchronizeModelElement)diffViewerConfiguration.getViewer().getInput();
+ if (root != null && root instanceof DiffNode) {
try {
- commit(pm, root);
+ commit(pm, (DiffNode)root);
} finally {
setDirty(false);
}
@@ -273,4 +276,27 @@ public class SynchronizeCompareInput extends CompareEditorInput implements ICont
public boolean isBuffered() {
return buffered;
}
+
+ private IActionBars getActionBars(final IToolBarManager toolbar) {
+ return new IActionBars() {
+ public void clearGlobalActionHandlers() {
+ }
+ public IAction getGlobalActionHandler(String actionId) {
+ return null;
+ }
+ public IMenuManager getMenuManager() {
+ return null;
+ }
+ public IStatusLineManager getStatusLineManager() {
+ return null;
+ }
+ public IToolBarManager getToolBarManager() {
+ return toolbar;
+ }
+ public void setGlobalActionHandler(String actionId, IAction handler) {
+ }
+ public void updateActionBars() {
+ }
+ };
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelAction.java
index 20f799f55..20aeeac76 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.subscriber;
+package org.eclipse.team.ui.synchronize.viewers;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@@ -20,24 +20,24 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.ui.*;
/**
* This action provides utilities for performing operations on selections that
* are obtained from a view populated by a
* {@link org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider}.
- * The {@link org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage} is an example of such a view.
+ * The {@link org.eclipse.team.internal.ui.synchronize.SubscriberParticipantPage} is an example of such a view.
* Subclasses can use this support to filter the selection in order to
- * determine action enablement and generate the input for a {@link SubscriberOperation}.
+ * determine action enablement and generate the input for a {@link SynchronizeModelOperation}.
* @see SyncInfo
* @see SyncInfoSet
* @see org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider
- * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage
- * @see org.eclipse.team.ui.synchronize.subscriber.SubscriberOperation
+ * @see org.eclipse.team.internal.ui.synchronize.SubscriberParticipantPage
+ * @see org.eclipse.team.ui.synchronize.viewers.SynchronizeModelOperation
* @since 3.0
*/
-public abstract class SubscriberAction implements IObjectActionDelegate, IViewActionDelegate, IEditorActionDelegate {
+public abstract class SynchronizeModelAction implements IObjectActionDelegate, IViewActionDelegate, IEditorActionDelegate {
private IStructuredSelection selection;
private IWorkbenchPart part;
@@ -61,11 +61,11 @@ public abstract class SubscriberAction implements IObjectActionDelegate, IViewAc
* Return the subscriber operation associated with this action. This operation
* will be run when the action is run. Subclass may implement this method and provide
* an operation subclass or may override the <code>run(IAction)</code> method directly
- * if they choose not to implement a <code>SubscriberOperation</code>.
+ * if they choose not to implement a <code>SynchronizeModelOperation</code>.
* @param elements the selected diff element for which this action is enabled.
* @return the subscriber operation to be run by this action.
*/
- protected abstract SubscriberOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements);
+ protected abstract SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements);
/**
* Generic error handling code that uses an error dialog to show the error to the
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelOperation.java
index 0d1aee22a..a08fdf470 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelOperation.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.subscriber;
+package org.eclipse.team.ui.synchronize.viewers;
import java.util.ArrayList;
import java.util.List;
@@ -17,23 +17,22 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.ui.*;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
+import org.eclipse.team.ui.TeamOperation;
import org.eclipse.ui.IWorkbenchPart;
/**
* A subscriber operation provides access to a {@link SyncInfoSet} containing
- * the selection from a {@link SubscriberAction}.
- * When used in conjuntion with a {@link SubscriberAction}, the selected
+ * the selection from a {@link SynchronizeModelAction}.
+ * When used in conjuntion with a {@link SynchronizeModelAction}, the selected
* elements in the view will show busy indication if this
* operation is run as a job.
*
* @see SyncInfoSet
- * @see SubscriberAction
+ * @see SynchronizeModelAction
* @since 3.0
*/
-public abstract class SubscriberOperation extends TeamOperation {
+public abstract class SynchronizeModelOperation extends TeamOperation {
private IDiffElement[] elements;
@@ -43,7 +42,7 @@ public abstract class SubscriberOperation extends TeamOperation {
* {@link org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider}.
* @param elements
*/
- protected SubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
+ protected SynchronizeModelOperation(IWorkbenchPart part, IDiffElement[] elements) {
super(part);
this.elements = elements;
}
@@ -75,8 +74,8 @@ public abstract class SubscriberOperation extends TeamOperation {
private void markBusy(IDiffElement[] elements, boolean isBusy) {
for (int i = 0; i < elements.length; i++) {
IDiffElement element = elements[i];
- if (element instanceof SynchronizeModelElement) {
- ((SynchronizeModelElement)element).setPropertyToRoot(SynchronizeModelElement.BUSY_PROPERTY, isBusy);
+ if (element instanceof ISynchronizeModelElement) {
+ ((ISynchronizeModelElement)element).setPropertyToRoot(ISynchronizeModelElement.BUSY_PROPERTY, isBusy);
}
}
}
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 db098cf29..32f611ddc 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
@@ -19,7 +19,8 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfoTree;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.internal.ui.synchronize.*;
+import org.eclipse.team.internal.ui.synchronize.CompressedFoldersModelProvider;
+import org.eclipse.team.internal.ui.synchronize.HierarchicalModelProvider;
import org.eclipse.team.internal.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
@@ -164,7 +165,7 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor implements IPrope
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#getDiffNodeController()
*/
- protected SynchronizeModelProvider getModelProvider() {
+ protected ISynchronizeModelProvider getModelProvider() {
if(getShowCompressedFolders()) {
return new CompressedFoldersModelProvider((SyncInfoTree)getSyncInfoSet());
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
index 7fc692f56..5937a4409 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
@@ -20,27 +20,17 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
-import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.core.synchronize.SyncInfoTree;
-import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider;
-import org.eclipse.team.internal.ui.synchronize.SynchronizeView;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
import org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
-import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPage;
@@ -204,7 +194,7 @@ public class SynchronizeViewTestAdapter extends SyncInfoSource {
IPage page = ((SynchronizeView)view).getPage(participant);
if (page instanceof SubscriberParticipantPage) {
SubscriberParticipantPage subscriberPage = (SubscriberParticipantPage)page;
- ISelection selection = subscriberPage.getViewerAdviser().getSelection(new Object[] { resource });
+ ISelection selection = subscriberPage.getViewerAdvisor().getSelection(new Object[] { resource });
if (!selection.isEmpty() && selection instanceof StructuredSelection) {
StructuredSelection ss = (StructuredSelection)selection;
Object o = ss.getFirstElement();

Back to the top