Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-09 20:51:17 +0000
committerJean Michel-Lemieux2004-03-09 20:51:17 +0000
commit70d8db4a04629905c0aefa376adfc27566b12c73 (patch)
tree99abba1031918f6e868a7a1ad3e7faed7abce295
parentb1c14fbe58367c34bf6eef789f77edca3623f574 (diff)
downloadeclipse.platform.team-70d8db4a04629905c0aefa376adfc27566b12c73.tar.gz
eclipse.platform.team-70d8db4a04629905c0aefa376adfc27566b12c73.tar.xz
eclipse.platform.team-70d8db4a04629905c0aefa376adfc27566b12c73.zip
Added several things:
- a global action to refresh - a compare dialog framework that will allow you to show compare input in a dialog and support saving
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/FilteredSyncInfoCollector.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml707
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java142
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java50
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java65
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java32
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java27
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java79
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java49
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java5
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/cview16/compare_view.gifbin0 -> 128 bytes
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties16
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml39
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/OverlayIcon.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java59
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java25
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java116
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java35
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TeamPreferencePage.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java)3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java)3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java119
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RemoteResourceTypedElement.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java120
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java)19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java186
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java33
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshParticipantSelectionPage.java185
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshResourceSelectionPage.java240
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java137
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java27
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/SubscriberRefreshWizard.java49
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipantDescriptor.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java42
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java56
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantDialog.java149
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java67
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java53
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java49
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoModelElement.java45
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java114
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeDialog.java155
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java20
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java4
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestDiffNodePresentationModel.java1
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00008.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00039.html31
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00040.html6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00041.html16
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00042.html11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00043.html14
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00044.html11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00045.html11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00046.html11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00047.html20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00048.html50
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java32
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/toc.xml18
97 files changed, 2817 insertions, 1114 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/FilteredSyncInfoCollector.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/FilteredSyncInfoCollector.java
index 7430b54f0..53c8d48c9 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/FilteredSyncInfoCollector.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/FilteredSyncInfoCollector.java
@@ -71,6 +71,11 @@ public final class FilteredSyncInfoCollector implements ISyncInfoSetChangeListen
return filter;
}
+ public void setFilter(SyncInfoFilter filter, IProgressMonitor monitor) {
+ this.filter = filter;
+ start(monitor);
+ }
+
/**
* Dispose of the collector. The collector cannot be restarted after it has been disposed.
*/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
index 6b127b7f5..e5b6b0e59 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java
@@ -35,6 +35,8 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.MultiTagResourceVariantTree;
public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubscriberChangeListener {
public static final String ID = "org.eclipse.team.cvs.ui.compare-participant";
+ public static final String ID_MODAL = "org.eclipse.team.cvs.ui.compare-participant-modal";
+
public static final String QUALIFIED_NAME = CVSProviderPlugin.ID + ".compare"; //$NON-NLS-1$
private static final String UNIQUE_ID_PREFIX = "compare-"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
index cefb2e5b4..4c9c92348 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
@@ -58,7 +58,8 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
*/
public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResourceChangeListener, ISubscriberChangeListener {
- public static final String QUALIFIED_NAME = "org.eclipse.team.cvs.ui.cvsmerge-participant"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.team.cvs.ui.cvsmerge-participant"; //$NON-NLS-1$
+ public static final String ID_MODAL = "org.eclipse.team.cvs.ui.cvsmerge-participant-modal"; //$NON-NLS-1$
private static final String UNIQUE_ID_PREFIX = "merge-"; //$NON-NLS-1$
private CVSTag start, end;
@@ -72,7 +73,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
private static QualifiedName getUniqueId() {
String uniqueId = Long.toString(System.currentTimeMillis());
- return new QualifiedName(QUALIFIED_NAME, "CVS" + UNIQUE_ID_PREFIX + uniqueId); //$NON-NLS-1$
+ return new QualifiedName(ID, "CVS" + UNIQUE_ID_PREFIX + uniqueId); //$NON-NLS-1$
}
public CVSMergeSubscriber(QualifiedName id, IResource[] roots, CVSTag start, CVSTag end) {
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index 5c2777bc2..eb95820d9 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -191,7 +191,7 @@ CVSWorkspaceSubscriber.confirmMerged.tooltip=Mark the conflict as merged by upgr
CVSWorkspaceSubscriber.merge.label=&Update
CVSWorkspaceSubscriber.merge.tooltip=Perform an update merge on the visible resources
-CVSCompareSubscriber.revert.label=Re&vert Local to Remote
+CVSCompareSubscriber.revert.label=&Override and Update
CVSCompareSubscriber.revert.tooltip=Revert the local file contents to match that of their corresponding remotes
WorkInProgress.name=Work In Progress
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 9cd6676b2..319914fd6 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
- id="org.eclipse.team.cvs.ui"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.team.internal.ccvs.ui.CVSUIPlugin">
+ id="org.eclipse.team.cvs.ui"
+ name="%pluginName"
+ version="3.0.0"
+ provider-name="%providerName"
+ class="org.eclipse.team.internal.ccvs.ui.CVSUIPlugin">
<runtime>
<library name="teamcvsui.jar">
@@ -14,7 +14,7 @@
</library>
</runtime>
<requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
+ <import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.ui.ide" optional="true"/>
<import plugin="org.eclipse.ui.views" optional="true"/>
<import plugin="org.eclipse.jface.text" optional="true"/>
@@ -30,32 +30,32 @@
<import plugin="org.eclipse.compare"/>
</requires>
+
<!-- *************** Synchronize View Participant **************** -->
-<extension
+ <extension
point="org.eclipse.team.ui.synchronizeParticipants">
<participant
name="%CVSWorkspaceParticipant"
+ type="static"
icon="icons/full/cview16/cvs_persp.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant"
- type="static"
id="org.eclipse.team.cvs.ui.cvsworkspace-participant">
</participant>
<participant
name="%CVSMergeParticipant"
+ type="dynamic"
icon="icons/full/clcl16/newstream_wiz.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant"
- type="dynamic"
id="org.eclipse.team.cvs.ui.cvsmerge-participant">
</participant>
<participant
name="%CVSCompareParticipant"
+ type="dynamic"
icon="icons/full/cview16/compare_view.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant"
- type="dynamic"
id="org.eclipse.team.cvs.ui.compare-participant">
</participant>
-</extension>
-
+ </extension>
<!-- *************** Authenticator **************** -->
<extension
point="org.eclipse.team.cvs.core.authenticator">
@@ -88,8 +88,8 @@
<extension
point="org.eclipse.ui.propertyPages">
<page
- objectClass="org.eclipse.core.resources.IFile"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IFile"
name="%CVS"
class="org.eclipse.team.internal.ccvs.ui.CVSFilePropertiesPage"
id="org.eclipse.team.ccvs.ui.propertyPages.CVSFilePropertiesPage">
@@ -99,8 +99,8 @@
</filter>
</page>
<page
- objectClass="org.eclipse.core.resources.IFolder"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IFolder"
name="%CVS"
class="org.eclipse.team.internal.ccvs.ui.CVSFolderPropertiesPage"
id="org.eclipse.team.ccvs.ui.propertyPages.CVSFolderPropertiesPage">
@@ -110,8 +110,8 @@
</filter>
</page>
<page
- objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IProject"
name="%CVS"
class="org.eclipse.team.internal.ccvs.ui.CVSProjectPropertiesPage"
id="org.eclipse.team.ccvs.ui.propertyPages.CVSProjectPropertiesPage">
@@ -127,29 +127,27 @@
id="org.eclipse.team.ccvs.ui.propertyPages.CVSRepositoryPropertiesPage">
</page>
</extension>
-
-<!-- ******************* Action Definitions ******************** -->
-
- <extension point="org.eclipse.ui.commands">
+<!-- ******************* Action Definitions ******************** -->
+ <extension
+ point="org.eclipse.ui.commands">
<category
name="%CVSActionSet.categoryName"
description="%CVSActionSet.description"
id="org.eclipse.team.cvs.ui.actionSet">
</category>
<command
- category="org.eclipse.team.cvs.ui.actionSet"
name="%CVSActionSet.newLabel"
description="%CVSActionSet.newTooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
id="org.eclipse.team.cvs.ui.new.location">
</command>
</extension>
-
<!-- ******************* Menus ******************** -->
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
- objectClass="org.eclipse.core.resources.IFile"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IFile"
id="org.eclipse.team.ccvs.ui.IFileContributions">
<filter
name="projectPersistentProperty"
@@ -157,74 +155,74 @@
</filter>
<action
label="%IgnoreAction.label"
- tooltip="%IgnoreAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ tooltip="%IgnoreAction.tooltip"
menubarPath="team.main/group3"
- helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
id="org.eclipse.team.ccvs.ui.ignore">
</action>
<action
label="%AddAction.label"
- tooltip="%AddAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
+ tooltip="%AddAction.tooltip"
menubarPath="team.main/group3"
- helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
id="org.eclipse.team.ccvs.ui.add">
</action>
<action
label="%ShowHistoryAction.label"
- tooltip="%ShowHistoryAction.tooltip"
icon="icons/full/ctool16/history.gif"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
menubarPath="team.main/group2"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
id="org.eclipse.team.ccvs.ui.showHistory">
</action>
<action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
- icon="icons/full/ctool16/annotate.gif"
+ icon="icons/full/ctool16/annotate.gif"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
menubarPath="team.main/group2"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
</action>
<action
label="%CompareWithRevisionAction.label"
- tooltip="%CompareWithRevisionAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.compare_with_revision_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction"
+ tooltip="%CompareWithRevisionAction.tooltip"
menubarPath="compareWithMenu/compareWithGroup"
- helpContextId="org.eclipse.team.cvs.ui.compare_with_revision_action_context"
id="org.eclipse.team.ccvs.ui.compareWithRevision">
</action>
<action
label="%ReplaceWithRevisionAction.label"
+ helpContextId="org.eclipse.team.cvs.ui.replace_with_revision_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRevisionAction"
tooltip="%ReplaceWithRevisionAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction"
menubarPath="replaceWithMenu/replaceWithGroup"
- helpContextId="org.eclipse.team.cvs.ui.replace_with_revision_action_context"
id="org.eclipse.team.ccvs.ui.replaceWithRevision">
</action>
<action
label="%EditAction.label"
- tooltip="%EditAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_edit_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.EditAction"
+ tooltip="%EditAction.tooltip"
menubarPath="team.main/group4"
- helpContextId="org.eclipse.team.cvs.ui.team_edit_action_context"
id="org.eclipse.team.ccvs.ui.edit">
</action>
<action
label="%UneditAction.label"
- tooltip="%UneditAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_unedit_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.UneditAction"
+ tooltip="%UneditAction.tooltip"
menubarPath="team.main/group4"
- helpContextId="org.eclipse.team.cvs.ui.team_unedit_action_context"
id="org.eclipse.team.ccvs.ui.unedit">
</action>
</objectContribution>
<objectContribution
- objectClass="org.eclipse.core.resources.IResource"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IResource"
id="org.eclipse.team.ccvs.ui.ResourceContributions">
<filter
name="projectPersistentProperty"
@@ -232,97 +230,104 @@
</filter>
<action
label="%SetKeywordSubstitutionAction.label"
- tooltip="%SetKeywordSubstitutionAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_set_keyword_mode_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction"
+ tooltip="%SetKeywordSubstitutionAction.tooltip"
menubarPath="team.main/group3"
- helpContextId="org.eclipse.team.cvs.ui.team_set_keyword_mode_action_context"
id="org.eclipse.team.ccvs.ui.setKeywordSubstitution">
</action>
<action
label="%MergeAction.label"
- tooltip="%MergeAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.MergeAction"
+ tooltip="%MergeAction.tooltip"
menubarPath="team.main/group2"
- helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context"
id="org.eclipse.team.ccvs.ui.merge">
</action>
<action
label="%BranchAction.label"
- tooltip="%BranchAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ tooltip="%BranchAction.tooltip"
menubarPath="team.main/group2"
- helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
id="org.eclipse.team.ccvs.ui.branch">
</action>
<action
label="%TagAction.label"
- tooltip="%TagAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction"
+ tooltip="%TagAction.tooltip"
menubarPath="team.main/group2"
- helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context"
id="org.eclipse.team.ccvs.ui.tag">
</action>
- <action
+ <action
label="%CompareWithTagAction.label"
- tooltip="%CompareWithTagAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.compare_with_tag_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithTagAction"
+ tooltip="%CompareWithTagAction.tooltip"
menubarPath="compareWithMenu/compareWithGroup"
- helpContextId="org.eclipse.team.cvs.ui.compare_with_tag_action_context"
id="org.eclipse.team.ccvs.ui.compareWithTag">
</action>
<action
+ label="%CompareWithRemoteAction.label"
+ tooltip="%CompareWithRemoteAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRemoteAction"
+ menubarPath="compareWithMenu/compareWithGroup"
+ helpContextId="org.eclipse.team.cvs.ui.compare_with_latest_action_context"
+ id="org.eclipse.team.ccvs.ui.compareWithRemote">
+ </action>
+ <action
label="%ReplaceWithTagAction.label"
- tooltip="%ReplaceWithTagAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.replace_with_tag_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithTagAction"
+ tooltip="%ReplaceWithTagAction.tooltip"
menubarPath="replaceWithMenu/replaceWithGroup"
- helpContextId="org.eclipse.team.cvs.ui.replace_with_tag_action_context"
id="org.eclipse.team.ccvs.ui.replaceWithTag">
</action>
<action
label="%ReplaceWithAction.label"
- tooltip="%ReplaceWithAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.replace_with_latest_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction"
+ tooltip="%ReplaceWithAction.tooltip"
menubarPath="replaceWithMenu/replaceWithGroup"
- helpContextId="org.eclipse.team.cvs.ui.replace_with_latest_action_context"
id="org.eclipse.team.ccvs.ui.replace">
</action>
<action
label="%GenerateDiff.label"
- tooltip="%GenerateDiff.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_create__action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ tooltip="%GenerateDiff.tooltip"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_create__action_context"
id="org.eclipse.team.ccvs.ui.GenerateDiff">
</action>
<action
label="%UpdateAction.label"
- tooltip="%UpdateAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_update_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction"
+ tooltip="%UpdateAction.tooltip"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_update_action_context"
id="org.eclipse.team.ccvs.ui.update">
</action>
<action
label="%CommitAction.label"
- tooltip="%CommitAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
+ tooltip="%CommitAction.tooltip"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context"
id="org.eclipse.team.ccvs.ui.commit">
</action>
<action
label="%Synchronize.label"
- tooltip="%Synchronize.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_synchronize_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.SyncAction"
+ tooltip="%Synchronize.tooltip"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_synchronize_action_context"
id="org.eclipse.team.ccvs.ui.sync">
</action>
</objectContribution>
-
<objectContribution
- objectClass="org.eclipse.core.resources.IResource"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IResource"
id="org.eclipse.team.ccvs.ui.ResourceContributions">
<filter
name="projectPersistentProperty"
@@ -330,21 +335,17 @@
</filter>
<action
label="%ShowEditorsAction.label"
- tooltip="%ShowEditorsAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_show_editors_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowEditorsAction"
+ tooltip="%ShowEditorsAction.tooltip"
menubarPath="team.main/group4"
- helpContextId="org.eclipse.team.cvs.ui.team_show_editors_action_context"
id="org.eclipse.team.ccvs.ui.showeditors">
</action>
</objectContribution>
-
-
- <!-- ************** Project Menu *************** -->
-
-
+<!-- ************** Project Menu *************** -->
<objectContribution
- objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IProject"
id="org.eclipse.team.ccvs.ui.IProjectContributions">
<filter
name="projectPersistentProperty"
@@ -352,16 +353,16 @@
</filter>
<action
label="%UnmanageFolder.label"
- tooltip="%UnmanageFolder.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_disconnect_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.UnmanageAction"
+ tooltip="%UnmanageFolder.tooltip"
menubarPath="team.main/projectGroup"
- helpContextId="org.eclipse.team.cvs.ui.team_disconnect_action_context"
id="org.eclipse.team.ccvs.ui.unmanage">
</action>
</objectContribution>
<objectContribution
- objectClass="org.eclipse.core.resources.IContainer"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IContainer"
id="org.eclipse.team.ccvs.ui.IContainerContributions">
<filter
name="projectPersistentProperty"
@@ -369,16 +370,16 @@
</filter>
<action
label="%RestoreFromRepositoryAction.label"
- tooltip="%RestoreFromRepositoryAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_restore_from_repository_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.RestoreFromRepositoryAction"
+ tooltip="%RestoreFromRepositoryAction.tooltip"
menubarPath="team.main/group4"
- helpContextId="org.eclipse.team.cvs.ui.team_restore_from_repository_action_context"
id="org.eclipse.team.ccvs.ui.restoreFromRepository">
</action>
</objectContribution>
<objectContribution
- objectClass="org.eclipse.core.resources.IFolder"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IFolder"
id="org.eclipse.team.ccvs.ui.IFolderContributions">
<filter
name="projectPersistentProperty"
@@ -386,18 +387,18 @@
</filter>
<action
label="%IgnoreAction.label"
- tooltip="%IgnoreAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ tooltip="%IgnoreAction.tooltip"
menubarPath="team.main/group3"
- helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
id="org.eclipse.team.ccvs.ui.ignore">
</action>
<action
label="%AddAction.label"
- tooltip="%AddAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
+ tooltip="%AddAction.tooltip"
menubarPath="team.main/group3"
- helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
id="org.eclipse.team.ccvs.ui.add">
</action>
</objectContribution>
@@ -406,61 +407,63 @@
id="org.eclipse.team.ccvs.ui.RemoteFolderContributions">
<action
label="%CheckoutAsAction.label"
+ helpContextId="org.eclipse.team.cvs.ui.checkout_as_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CheckoutAsAction"
tooltip="%CheckoutAsAction.tooltip"
menubarPath="checkoutGroup"
- class="org.eclipse.team.internal.ccvs.ui.actions.CheckoutAsAction"
- helpContextId="org.eclipse.team.cvs.ui.checkout_as_action_context"
id="org.eclipse.team.ccvs.ui.checkoutAs">
</action>
<action
label="%CheckoutAction.label"
+ helpContextId="org.eclipse.team.cvs.ui.checkout_as_project_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CheckoutAction"
tooltip="%CheckoutAction.tooltip"
menubarPath="checkoutGroup"
- class="org.eclipse.team.internal.ccvs.ui.actions.CheckoutAction"
- helpContextId="org.eclipse.team.cvs.ui.checkout_as_project_action_context"
id="org.eclipse.team.ccvs.ui.checkout">
</action>
- <action
- id="org.eclipse.team.ccvs.ui.configureTagsOnRemoteFolder"
- label="%ConfigureTags.label"
- menubarPath="miscGroup"
- tooltip="%ConfigureTags.tooltip"
- icon="icons/full/clcl16/newstream_wiz.gif"
- helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
- class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoViewOnFolder"/>
- <action
- id="org.eclipse.team.ccvs.ui.addToBranch"
- label="%AddToBranch.label"
- menubarPath="miscGroup"
- tooltip="%ddToBranch.tooltip"
- icon="icons/full/clcl16/newstream_wiz.gif"
- helpContextId="org.eclipse.team.cvs.ui.add_to_branch_context"
- class="org.eclipse.team.internal.ccvs.ui.repo.AddToBranchAction"/>
+ <action
+ label="%ConfigureTags.label"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoViewOnFolder"
+ tooltip="%ConfigureTags.tooltip"
+ menubarPath="miscGroup"
+ id="org.eclipse.team.ccvs.ui.configureTagsOnRemoteFolder">
+ </action>
+ <action
+ label="%AddToBranch.label"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.add_to_branch_context"
+ class="org.eclipse.team.internal.ccvs.ui.repo.AddToBranchAction"
+ tooltip="%ddToBranch.tooltip"
+ menubarPath="miscGroup"
+ id="org.eclipse.team.ccvs.ui.addToBranch">
+ </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.core.ICVSRemoteFile"
id="org.eclipse.team.ccvs.ui.RemoteFileContributions">
<action
label="%OpenRemoteFileAction.label"
- tooltip="%OpenRemoteFileAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.OpenRemoteFileAction"
helpContextId="org.eclipse.team.cvs.ui.open_remote_file_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.OpenRemoteFileAction"
+ tooltip="%OpenRemoteFileAction.tooltip"
id="org.eclipse.team.ccvs.ui.openRemoteFile">
</action>
<action
label="%ShowHistoryAction.label"
- tooltip="%ShowHistoryAction.tooltip"
icon="icons/full/ctool16/history.gif"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowHistoryAction"
helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
id="org.eclipse.team.ccvs.ui.showHistory">
</action>
<action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
icon="icons/full/ctool16/annotate.gif"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
id="org.eclipse.team.ccvs.ui.showAnnotation">
</action>
</objectContribution>
@@ -469,71 +472,72 @@
id="org.eclipse.team.ccvs.ui.LogEntryContributions">
<action
label="%OpenLogEntryAction.label"
- tooltip="%OpenLogEntryAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.OpenLogEntryAction"
helpContextId="org.eclipse.team.cvs.ui.open_remote_file_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.OpenLogEntryAction"
+ tooltip="%OpenLogEntryAction.tooltip"
id="org.eclipse.team.ccvs.ui.openLogEntry">
</action>
<action
label="%CompareRemoteResourcesAction.label"
- tooltip="%CompareRemoteResourcesAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.compare_remote_resources_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareRemoteResourcesAction"
+ tooltip="%CompareRemoteResourcesAction.tooltip"
enablesFor="2"
- helpContextId="org.eclipse.team.cvs.ui.compare_remote_resources_action_context"
id="org.eclipse.team.ccvs.ui.compareLogEntries">
</action>
<action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
icon="icons/full/ctool16/annotate.gif"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
id="org.eclipse.team.ccvs.ui.showAnnotation">
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.ui.model.RemoteModule"
id="org.eclipse.team.ccvs.ui.VersionCategoryContributions">
- <action
- id="org.eclipse.team.ccvs.ui.configureTagsOnRemoteModule"
- label="%ConfigureTags.label"
- tooltip="%ConfigureTags.label"
- icon="icons/full/clcl16/newstream_wiz.gif"
- helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
- class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoViewOnFolder"/>
+ <action
+ label="%ConfigureTags.label"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoViewOnFolder"
+ tooltip="%ConfigureTags.label"
+ id="org.eclipse.team.ccvs.ui.configureTagsOnRemoteModule">
+ </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.ui.model.ProjectVersion"
id="org.eclipse.team.ccvs.ui.ProjectVersionContributions">
- <action
- id="org.eclipse.team.ccvs.ui.configureTagsOnProjectVersion"
- label="%ConfigureTags.label"
- tooltip="%ConfigureTags.label"
- icon="icons/full/clcl16/newstream_wiz.gif"
- helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
- class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoView"/>
+ <action
+ label="%ConfigureTags.label"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.tag_configuration_overview"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ConfigureTagsFromRepoView"
+ tooltip="%ConfigureTags.label"
+ id="org.eclipse.team.ccvs.ui.configureTagsOnProjectVersion">
+ </action>
</objectContribution>
-
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot"
id="org.eclipse.team.ccvs.ui.RemoteRootContributions">
<action
label="%CopyRepositoryNameAction.label"
+ helpContextId="org.eclipse.team.cvs.ui.copy_repository_name_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.repo.CopyRepositoryNameAction"
tooltip="%CopyRepositoryNameAction.tooltip"
menubarPath="miscGroup"
- class="org.eclipse.team.internal.ccvs.ui.repo.CopyRepositoryNameAction"
- helpContextId="org.eclipse.team.cvs.ui.copy_repository_name_action_context"
id="org.eclipse.team.ccvs.ui.copyNames">
</action>
<action
label="%RefreshTagsAction.label"
icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.refresh_tags_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.repo.RefreshTagsAction"
tooltip="%RefreshTagsAction.tooltip"
menubarPath="tagGroup"
- class="org.eclipse.team.internal.ccvs.ui.repo.RefreshTagsAction"
- helpContextId="org.eclipse.team.cvs.ui.refresh_tags_action_context"
id="org.eclipse.team.ccvs.ui.refreshTags">
- </action>
+ </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.ui.model.BranchCategory"
@@ -541,218 +545,246 @@
<action
label="%RefreshTagsAction.label"
icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.refresh_tags_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.repo.RefreshTagsAction"
tooltip="%RefreshTagsAction.tooltip"
menubarPath="tagGroup"
- class="org.eclipse.team.internal.ccvs.ui.repo.RefreshTagsAction"
- helpContextId="org.eclipse.team.cvs.ui.refresh_tags_action_context"
id="org.eclipse.team.ccvs.ui.refreshTags">
- </action>
+ </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.team.internal.ccvs.core.ICVSRemoteResource"
id="org.eclipse.team.ccvs.ui.RemoteResourceContributions">
<action
label="%CompareRemoteResourcesAction.label"
- menubarPath="miscGroup"
- tooltip="%CompareRemoteResourcesAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.compare_remote_resources_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareRemoteResourcesAction"
+ tooltip="%CompareRemoteResourcesAction.tooltip"
+ menubarPath="miscGroup"
enablesFor="2"
- helpContextId="org.eclipse.team.cvs.ui.compare_remote_resources_action_context"
id="org.eclipse.team.ccvs.ui.compareRemoteResources">
</action>
<action
label="%CompareRemoteWithTagAction.label"
- menubarPath="miscGroup"
- tooltip="%CompareRemoteWithTagAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.CompareRemoteWithTagAction"
helpContextId="org.eclipse.team.cvs.ui.compare_remote_with_tag_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CompareRemoteWithTagAction"
+ tooltip="%CompareRemoteWithTagAction.tooltip"
+ menubarPath="miscGroup"
id="org.eclipse.team.ccvs.ui.compareRemoteWithTag">
</action>
<action
label="%MoveTagAction.label"
- menubarPath="tagGroup"
- tooltip="%MoveTagAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.MoveRemoteTagAction"
helpContextId="org.eclipse.team.cvs.ui.move_remote_tag_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.MoveRemoteTagAction"
+ tooltip="%MoveTagAction.tooltip"
+ menubarPath="tagGroup"
id="org.eclipse.team.ccvs.ui.moveTagInRepository">
</action>
<action
label="%TagInRepositoryAction.label"
- menubarPath="tagGroup"
- tooltip="%TagInRepositoryAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.TagInRepositoryAction"
helpContextId="org.eclipse.team.cvs.ui.tag_remote_action_context"
+ class="org.eclipse.team.internal.ccvs.ui.actions.TagInRepositoryAction"
+ tooltip="%TagInRepositoryAction.tooltip"
+ menubarPath="tagGroup"
id="org.eclipse.team.ccvs.ui.tagInRepository">
</action>
</objectContribution>
</extension>
-
<!-- ************* Subscriber Menus ************ -->
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <viewerContribution
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriberContributions"
- targetID="org.eclipse.team.cvs.ui.cvsworkspace-participant">
- <action
- label="%CVSWorkspaceSubscriber.commit.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
- overrideActionId="org.eclipse.team.ccvs.ui.commit"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_commit_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.commit">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.update.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.update.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_update_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.update">
- </action>
- <action
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <viewerContribution
+ targetID="org.eclipse.team.cvs.ui.cvsworkspace-participant"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriberContributions">
+ <action
+ label="%CVSWorkspaceSubscriber.commit.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_commit_action"
+ overrideActionId="org.eclipse.team.ccvs.ui.commit"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
+ tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.commit">
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.update.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_update_action"
+ overrideActionId="org.eclipse.team.ccvs.ui.update"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
+ tooltip="%CVSWorkspaceSubscriber.update.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.update">
+ </action>
+ <action
label="%CVSWorkspaceSubscriber.confirmMerged.label"
- menubarPath="SubscriberActionsGroup2"
- tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
+ tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
+ menubarPath="SubscriberActionsGroup2"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.confirmMerged">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.overcommit.label"
- menubarPath="SubscriberActionsGroup2"
- tooltip="%CVSWorkspaceSubscriber.overcommit.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overcommit_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overcommit">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.overupdate.label"
- menubarPath="SubscriberActionsGroup2"
- tooltip="%CVSWorkspaceSubscriber.overupdate.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
- </action>
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.overcommit.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overcommit_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction"
+ tooltip="%CVSWorkspaceSubscriber.overcommit.tooltip"
+ menubarPath="SubscriberActionsGroup2"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overcommit">
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.overupdate.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction"
+ tooltip="%CVSWorkspaceSubscriber.overupdate.tooltip"
+ menubarPath="SubscriberActionsGroup2"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
+ </action>
<action
label="%ShowHistoryAction.label"
- tooltip="%ShowHistoryAction.tooltip"
icon="icons/full/ctool16/history.gif"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
id="org.eclipse.team.ccvs.ui.showHistory">
</action>
<action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
icon="icons/full/ctool16/annotate.gif"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
+ </action>
<action
label="%BranchAction.label"
- tooltip="%BranchAction.tooltip"
icon="icons/full/clcl16/newstream_wiz.gif"
+ helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ tooltip="%BranchAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
id="org.eclipse.team.ccvs.ui.branch">
</action>
<action
label="%GenerateDiff.label"
- tooltip="%GenerateDiff.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ tooltip="%GenerateDiff.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
id="org.eclipse.team.ccvs.ui.GenerateDiff">
- </action>
+ </action>
<action
label="%IgnoreAction.label"
- tooltip="%IgnoreAction.tooltip"
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ tooltip="%IgnoreAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
id="org.eclipse.team.ccvs.ui.ignore">
- </action>
- </viewerContribution>
-
- <viewerContribution
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions"
- targetID="org.eclipse.team.cvs.ui.cvsmerge-participant">
- <action
- label="%CVSWorkspaceSubscriber.confirmMerged.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.merge.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
- </action>
- <action
+ </action>
+ </viewerContribution>
+ <viewerContribution
+ targetID="org.eclipse.team.cvs.ui.cvsmerge-participant"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions">
+ <action
+ label="%CVSWorkspaceSubscriber.confirmMerged.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
+ tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.merge.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
+ overrideActionId="org.eclipse.team.ccvs.ui.update"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
+ tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
+ </action>
+ <action
label="%ShowHistoryAction.label"
- tooltip="%ShowHistoryAction.tooltip"
icon="icons/full/ctool16/history.gif"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
id="org.eclipse.team.ccvs.ui.showHistory">
</action>
<action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
icon="icons/full/ctool16/annotate.gif"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
- </viewerContribution>
-
- <viewerContribution
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriberContributions"
- targetID="org.eclipse.team.cvs.ui.compare-participant">
- <action
- label="%CVSCompareSubscriber.revert.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSCompareSubscriber.revert.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareRevertAction"
- helpContextId="org.eclipse.team.cvs.ui.compare_revert_action"
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriber.revert">
- </action>
- <action
+ </action>
+ </viewerContribution>
+ <viewerContribution
+ targetID="org.eclipse.team.cvs.ui.cvsmerge-participant-modal"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions">
+ <action
+ label="%CVSWorkspaceSubscriber.confirmMerged.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
+ tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.merge.label"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
+ overrideActionId="org.eclipse.team.ccvs.ui.update"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
+ tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
+ </action>
+ </viewerContribution>
+ <viewerContribution
+ targetID="org.eclipse.team.cvs.ui.compare-participant"
+ id="org.eclipse.team.ccvs.ui.CVSCompareSubscriberContributions">
+ <action
+ label="%CVSCompareSubscriber.revert.label"
+ helpContextId="org.eclipse.team.cvs.ui.compare_revert_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareRevertAction"
+ tooltip="%CVSCompareSubscriber.revert.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSCompareSubscriber.revert">
+ </action>
+ <action
label="%ShowHistoryAction.label"
- tooltip="%ShowHistoryAction.tooltip"
icon="icons/full/ctool16/history.gif"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
id="org.eclipse.team.ccvs.ui.showHistory">
- </action>
- <action
+ </action>
+ <action
label="%ShowAnnotationAction.label"
- tooltip="%ShowAnnotationAction.tooltip"
icon="icons/full/ctool16/annotate.gif"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
menubarPath="SubscriberActionsGroup3"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
- </viewerContribution>
- </extension>
-
+ </action>
+ </viewerContribution>
+ <viewerContribution
+ targetID="org.eclipse.team.cvs.ui.compare-participant-modal"
+ id="org.eclipse.team.ccvs.ui.CVSCompareSubscriberContributions">
+ <action
+ label="%CVSCompareSubscriber.revert.label"
+ helpContextId="org.eclipse.team.cvs.ui.compare_revert_action"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareRevertAction"
+ tooltip="%CVSCompareSubscriber.revert.tooltip"
+ menubarPath="SubscriberActionsGroup1"
+ id="org.eclipse.team.ccvs.ui.CVSCompareSubscriber.revert">
+ </action>
+ </viewerContribution>
+ </extension>
<!-- ************** Views ********************** -->
<extension
point="org.eclipse.ui.views">
@@ -763,8 +795,8 @@
<view
name="%RepositoriesView.name"
icon="icons/full/cview16/repo_rep.gif"
+ fastViewWidthRatio="0.5"
category="org.eclipse.team.ccvs.ui"
- fastViewWidthRatio="0.5"
class="org.eclipse.team.internal.ccvs.ui.repo.RepositoriesView"
id="org.eclipse.team.ccvs.ui.RepositoriesView">
</view>
@@ -775,7 +807,7 @@
class="org.eclipse.team.internal.ccvs.ui.HistoryView"
id="org.eclipse.team.ccvs.ui.HistoryView">
</view>
- <view
+ <view
name="%EditorsView.name"
icon="icons/full/cview16/rep_editors_view.gif"
category="org.eclipse.team.ccvs.ui"
@@ -836,23 +868,22 @@
id="org.eclipse.team.cvs.ui.WatchEditPreferencePage">
</page>
</extension>
-
<!-- **************** Decorator ******************* -->
<extension
point="org.eclipse.ui.decorators">
<decorator
- objectClass="org.eclipse.core.resources.IResource"
+ lightweight="true"
+ quadrant="BOTTOM_RIGHT"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IResource"
label="%DecoratorStandard.name"
- state="false"
- lightweight= "true"
- quadrant = "BOTTOM_RIGHT"
class="org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator"
+ state="true"
id="org.eclipse.team.cvs.ui.decorator">
<description>
%DecoratorStandard.desc
- </description>
- </decorator>
+ </description>
+ </decorator>
</extension>
<!-- *************** View Actions **************** -->
<extension
@@ -862,17 +893,16 @@
id="org.eclipse.team.cvs.ui.history">
<action
label="%HistoryFilter.label"
+ hoverIcon="icons/full/clcl16/filter_history.gif"
icon="icons/full/elcl16/filter_history.gif"
- disabledIcon="icons/full/dlcl16/filter_history.gif"
- hoverIcon="icons/full/clcl16/filter_history.gif"
- tooltip="%HistoryFilter.tooltip"
class="org.eclipse.team.internal.ccvs.ui.HistoryFilterAction"
+ tooltip="%HistoryFilter.tooltip"
toolbarPath="actions"
+ disabledIcon="icons/full/dlcl16/filter_history.gif"
id="org.eclipse.team.cvs.ui.historyaction">
</action>
</viewContribution>
</extension>
-
<!-- **************** CVS Perspective ******************* -->
<extension
point="org.eclipse.ui.perspectives">
@@ -891,71 +921,84 @@
<perspectiveShortcut
id="org.eclipse.team.cvs.ui.cvsPerspective">
</perspectiveShortcut>
- <view id="org.eclipse.team.ccvs.ui.console"
- relative="org.eclipse.ui.views.TaskList"
- visible="false"
- relationship="stack"/>
- <view id="org.eclipse.team.ccvs.ui.HistoryView"
- relative="org.eclipse.ui.views.TaskList"
- visible="false"
- relationship="stack"/>
- <view id="org.eclipse.team.ccvs.ui.RepositoriesView"
- relative="org.eclipse.ui.views.ResourceNavigator"
- visible="false"
- relationship="stack"/>
- <view id="org.eclipse.team.ccvs.ui.AnnotateView"
- relative="org.eclipse.ui.views.ResourceNavigator"
- visible="false"
- relationship="stack"/>
+ <view
+ relative="org.eclipse.ui.views.TaskList"
+ visible="false"
+ relationship="stack"
+ id="org.eclipse.team.ccvs.ui.console">
+ </view>
+ <view
+ relative="org.eclipse.ui.views.TaskList"
+ visible="false"
+ relationship="stack"
+ id="org.eclipse.team.ccvs.ui.HistoryView">
+ </view>
+ <view
+ relative="org.eclipse.ui.views.ResourceNavigator"
+ visible="false"
+ relationship="stack"
+ id="org.eclipse.team.ccvs.ui.RepositoriesView">
+ </view>
+ <view
+ relative="org.eclipse.ui.views.ResourceNavigator"
+ visible="false"
+ relationship="stack"
+ id="org.eclipse.team.ccvs.ui.AnnotateView">
+ </view>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.team.cvs.ui.cvsPerspective">
+ <actionSet
+ id="org.eclipse.team.cvs.ui.CVSActionSet">
+ </actionSet>
+ <view
+ relative="org.eclipse.team.ccvs.ui.RepositoriesView"
+ relationship="stack"
+ id="org.eclipse.team.ccvs.ui.AnnotateView">
+ </view>
</perspectiveExtension>
- <perspectiveExtension
- targetID="org.eclipse.team.cvs.ui.cvsPerspective">
- <actionSet id="org.eclipse.team.cvs.ui.CVSActionSet"/>
- <view id="org.eclipse.team.ccvs.ui.AnnotateView"
- relative="org.eclipse.team.ccvs.ui.RepositoriesView"
- relationship="stack"/>
- </perspectiveExtension>
</extension>
-
- <!-- ************** Project Sets **************** -->
- <extension point="org.eclipse.team.core.projectSets">
- <projectSet id="org.eclipse.team.cvs.core.cvsnature" class="org.eclipse.team.internal.ccvs.ui.CVSProjectSetSerializer"/>
- </extension>
-
- <!-- ********** Action Sets ************** -->
- <extension point="org.eclipse.ui.actionSets">
- <actionSet
- label="%CVS"
- visible="false"
- id="org.eclipse.team.cvs.ui.CVSActionSet"
- description="%CVSActionSet.description">
- <action
- toolbarPath="Normal/CVS"
- label="%CVSActionSet.newLabel"
- tooltip="%CVSActionSet.newTooltip"
- icon="icons/full/wizards/newconnect_wiz.gif"
- class="org.eclipse.team.internal.ccvs.ui.actions.NewRepositoryAction"
- id="org.eclipse.team.cvs.ui.actions.NewRepositoryAction"
- definitionId="org.eclipse.team.cvs.ui.new.location">
- </action>
- </actionSet>
- </extension>
-
- <!-- ********** Font Definitions ************** -->
- <extension
+<!-- ************** Project Sets **************** -->
+ <extension
+ point="org.eclipse.team.core.projectSets">
+ <projectSet
+ class="org.eclipse.team.internal.ccvs.ui.CVSProjectSetSerializer"
+ id="org.eclipse.team.cvs.core.cvsnature">
+ </projectSet>
+ </extension>
+<!-- ********** Action Sets ************** -->
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%CVS"
+ description="%CVSActionSet.description"
+ visible="false"
+ id="org.eclipse.team.cvs.ui.CVSActionSet">
+ <action
+ definitionId="org.eclipse.team.cvs.ui.new.location"
+ label="%CVSActionSet.newLabel"
+ icon="icons/full/wizards/newconnect_wiz.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.NewRepositoryAction"
+ tooltip="%CVSActionSet.newTooltip"
+ toolbarPath="Normal/CVS"
+ id="org.eclipse.team.cvs.ui.actions.NewRepositoryAction">
+ </action>
+ </actionSet>
+ </extension>
+<!-- ********** Font Definitions ************** -->
+ <extension
point="org.eclipse.ui.fontDefinitions">
<fontDefinition
label="%CVSConsoleFont.label"
defaultsTo="org.eclipse.jface.textfont"
id="pref_console_font">
- <description>
- %CVSConsoleFont.description
- </description>
+ <description>
+ %CVSConsoleFont.description
+ </description>
</fontDefinition>
- </extension>
-
- <!-- ********** QuickDiff text editor support ************** -->
- <extension
+ </extension>
+<!-- ********** QuickDiff text editor support ************** -->
+ <extension
point="org.eclipse.ui.workbench.texteditor.quickDiffReferenceProvider">
<referenceprovider
label="%CVSRemoteQuickDiffProvider.label"
@@ -963,5 +1006,5 @@
id="org.eclipse.quickdiff.providers.CVSReferenceProvider">
</referenceprovider>
</extension>
-
+
</plugin>
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
index 915bf0b16..1dbaef57a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
@@ -27,13 +27,12 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
-import org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction;
+import org.eclipse.team.internal.ui.Utils;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.help.WorkbenchHelp;
@@ -41,13 +40,16 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
IFile resource;
ILogEntry[] editions;
TableViewer viewer;
- Action getContentsAction;
- Action getRevisionAction;
- Action getAnnotateAction;
+ Action getRevisionAction;
Shell shell;
+ // Provide the widget for the history table
private HistoryTableProvider historyTableProvider;
+ /**
+ * Provide a wrapper for a resource node that doesn't buffer. Changes are saved directly to the
+ * underlying file.
+ */
class TypedBufferedContent extends ResourceNode {
public TypedBufferedContent(IFile resource) {
super(resource);
@@ -88,6 +90,9 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
public ITypedElement replace(ITypedElement child, ITypedElement other) {
return null;
}
+ public void fireChange() {
+ fireContentChanged();
+ }
}
/**
@@ -121,6 +126,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
return super.getName();
}
};
+
/**
* A compare node that gets its label from the right element
*/
@@ -137,7 +143,9 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
}
return null;
}
-
+ public void fireContentChanges() {
+ fireChange();
+ }
};
/**
* A content provider which knows how to get the children of the diff container
@@ -167,7 +175,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
this.shell = parent.getShell();
viewer = getHistoryTableProvider().createTable(parent);
Table table = viewer.getTable();
- table.setData(CompareUI.COMPARE_VIEWER_TITLE, Policy.bind("CVSCompareRevisionsInput.structureCompare")); //$NON-NLS-1$
+ table.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle()); //$NON-NLS-1$
viewer.setContentProvider(new VersionCompareContentProvider());
@@ -176,9 +184,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
mm.addMenuListener(
new IMenuListener() {
public void menuAboutToShow(IMenuManager mm) {
- mm.add(getContentsAction);
mm.add(getRevisionAction);
- mm.add(getAnnotateAction);
}
}
);
@@ -187,103 +193,30 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (!(selection instanceof IStructuredSelection)) {
- getContentsAction.setEnabled(false);
getRevisionAction.setEnabled(false);
- getAnnotateAction.setEnabled(false);
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
- getContentsAction.setEnabled(ss.size() == 1);
getRevisionAction.setEnabled(ss.size() == 1);
- getAnnotateAction.setEnabled(ss.size() == 1);
}
});
// Add F1 help.
WorkbenchHelp.setHelp(table, IHelpContextIds.COMPARE_REVISIONS_VIEW);
- WorkbenchHelp.setHelp(getContentsAction, IHelpContextIds.GET_FILE_CONTENTS_ACTION);
- WorkbenchHelp.setHelp(getRevisionAction, IHelpContextIds.GET_FILE_REVISION_ACTION);
- WorkbenchHelp.setHelp(getAnnotateAction, IHelpContextIds.GET_ANNOTATE_ACTION);
-
return viewer;
}
-
+
private void initLabels() {
CompareConfiguration cc = (CompareConfiguration)getCompareConfiguration();
- String resourceName = resource.getName();
-// if (editions[0].isTeamStreamResource()) {
-// setTitle(Policy.bind("CompareResourceEditorInput.compareResourceAndStream", new Object[] {resourceName, editions[0].getTeamStream().getName()}));
-// } else {
-// setTitle(Policy.bind("CompareResourceEditorInput.compareResourceAndVersions", new Object[] {resourceName}));
-// }
- setTitle(Policy.bind("CVSCompareRevisionsInput.compareResourceAndVersions", new Object[] {resourceName})); //$NON-NLS-1$
cc.setLeftEditable(true);
cc.setRightEditable(false);
-
+ String resourceName = resource.getName();
String leftLabel = Policy.bind("CVSCompareRevisionsInput.workspace", new Object[] {resourceName}); //$NON-NLS-1$
cc.setLeftLabel(leftLabel);
String rightLabel = Policy.bind("CVSCompareRevisionsInput.repository", new Object[] {resourceName}); //$NON-NLS-1$
cc.setRightLabel(rightLabel);
}
- private void initializeActions() {
-
- getAnnotateAction = new Action(Policy.bind("HistoryView.getAnnotateAction"), null) { //$NON-NLS-1$
- public void run() {
- try {
- IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
- if (selection.size() != 1) return;
- VersionCompareDiffNode node = (VersionCompareDiffNode)selection.getFirstElement();
- ResourceEditionNode right = (ResourceEditionNode)node.getRight();
- ICVSRemoteResource edition = right.getRemoteResource();
- ShowAnnotationAction annotateAction = new ShowAnnotationAction();
- annotateAction.execute(edition);
-
- } catch (InterruptedException e) {
- // Do nothing
- return;
- } catch (InvocationTargetException e) {
- handle(e);
- }
- }
- };
-
- getContentsAction = new Action(Policy.bind("HistoryView.getContentsAction"), null) { //$NON-NLS-1$
- public void run() {
- try {
- new ProgressMonitorDialog(shell).run(false, true, new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
- if (selection.size() != 1) return;
- VersionCompareDiffNode node = (VersionCompareDiffNode)selection.getFirstElement();
- ResourceEditionNode right = (ResourceEditionNode)node.getRight();
- IResourceVariant edition = (IResourceVariant)right.getRemoteResource();
- // Do the load. This just consists of setting the local contents. We don't
- // actually want to change the base.
- try {
- monitor.beginTask(null, 100);
- InputStream in = edition.getStorage(new SubProgressMonitor(monitor, 50)).getContents();
- resource.setContents(in, false, true, new SubProgressMonitor(monitor, 50));
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- });
- } catch (InterruptedException e) {
- // Do nothing
- return;
- } catch (InvocationTargetException e) {
- handle(e);
- }
- // recompute the labels on the viewer
- updateCurrentEdition();
- viewer.refresh();
- }
- };
-
+ private void initializeActions() {
getRevisionAction = new Action(Policy.bind("HistoryView.getRevisionAction"), null) { //$NON-NLS-1$
public void run() {
try {
@@ -315,6 +248,12 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
} catch (InvocationTargetException e) {
handle(e);
}
+ // fire change
+ IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+ if (selection.size() != 1) return;
+ VersionCompareDiffNode node = (VersionCompareDiffNode)selection.getFirstElement();
+ TypedBufferedContent left = (TypedBufferedContent)node.getLeft();
+ left.fireChange();
// recompute the labels on the viewer
viewer.refresh();
}
@@ -323,8 +262,8 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
initLabels();
DiffNode diffRoot = new DiffNode(Differencer.NO_CHANGE);
+ ITypedElement left = new TypedBufferedContent(resource);
for (int i = 0; i < editions.length; i++) {
- ITypedElement left = new TypedBufferedContent(resource);
ITypedElement right = new ResourceRevisionNode(editions[i]);
diffRoot.add(new VersionCompareDiffNode(left, right));
}
@@ -350,5 +289,34 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
}
return historyTableProvider;
}
-
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#saveChanges(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void saveChanges(IProgressMonitor pm) throws CoreException {
+ super.saveChanges(pm);
+ }
+
+ public void replaceLocalWithCurrentlySelectedRevision() throws CoreException {
+ IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+ if (selection.size() != 1) return;
+ VersionCompareDiffNode node = (VersionCompareDiffNode)selection.getFirstElement();
+ ResourceRevisionNode right = (ResourceRevisionNode)node.getRight();
+ TypedBufferedContent left = (TypedBufferedContent)node.getLeft();
+ left.setContent(Utils.readBytes(right.getContents()));
+ }
+
+ public Viewer getViewer() {
+ return viewer;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#getTitle()
+ */
+ public String getTitle() {
+ String resourceName = resource.getName();
+ return Policy.bind("CVSCompareRevisionsInput.compareResourceAndVersions", new Object[] {resourceName}); //$NON-NLS-1$
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 7635e7a79..4205d12c1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -14,20 +14,11 @@ package org.eclipse.team.internal.ccvs.ui;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -40,11 +31,7 @@ import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSStatus;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.ui.console.CVSOutputConsole;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
@@ -56,10 +43,7 @@ import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.*;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -624,6 +608,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_DETERMINE_SERVER_VERSION, true);
store.setDefault(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG, CVSProviderPlugin.DEFAULT_CONFIRM_MOVE_TAG);
store.setDefault(ICVSUIConstants.PREF_DEBUG_PROTOCOL, false);
+ store.setDefault(ICVSUIConstants.PREF_WARN_REMEMBERING_MERGES, true);
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR, new RGB(0, 0, 0));
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR, new RGB(0, 0, 255));
@@ -737,29 +722,4 @@ public class CVSUIPlugin extends AbstractUIPlugin {
return null;
}
}
-
- /**
- * This is a convenience method to show the CVS workspace subscriber in the sync view.
- * The working set of the workspace participant will be set to the provided working set
- * and the provided resources will be refreshed.
- * @param shell shell used to display errors (can be <code>null</code>)
- * @param resources the resources to be refreshed (can be <code>null</code>)
- * @param workingSet the working set to be assigned to the participant (can be <code>null</code>)
- * @param mode the mode to place the participant in (can be 0)
- */
- public static void showInSyncView(Shell shell, IResource[] resources, int mode) {
- ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
- if(view != null) {
- WorkspaceSynchronizeParticipant cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
- view.display(cvsPage);
- if (resources != null) {
- cvsPage.refreshWithRemote(resources, false);
- }
- if (mode != 0) {
- cvsPage.setMode(mode);
- }
- } else {
- CVSUIPlugin.openError(shell, Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index 496ad351c..d9b445ba0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -78,6 +78,8 @@ public interface ICVSUIConstants {
public final String PREF_DETERMINE_SERVER_VERSION = "pref_determine_server_version"; //$NON-NLS-1$
public final String PREF_CONFIRM_MOVE_TAG = "pref_confirm_move_tag"; //$NON-NLS-1$
public final String PREF_DEBUG_PROTOCOL = "pref_debug_protocol"; //$NON-NLS-1$
+ public final String PREF_WARN_REMEMBERING_MERGES = "pref_remember_merges"; //$NON-NLS-1$
+ public final String PREF_FIRST_STARTUP = "pref_first_startup"; //$NON-NLS-1$
// console preferences
public final String PREF_CONSOLE_COMMAND_COLOR = "pref_console_command_color"; //$NON-NLS-1$
@@ -89,7 +91,6 @@ public interface ICVSUIConstants {
// decorator preferences
- public final String PREF_FIRST_STARTUP = "pref_first_startup"; //$NON-NLS-1$
public final String PREF_FILETEXT_DECORATION = "pref_filetext_decoration"; //$NON-NLS-1$
public final String PREF_FOLDERTEXT_DECORATION = "pref_foldertext_decoration"; //$NON-NLS-1$
public final String PREF_PROJECTTEXT_DECORATION = "pref_projecttext_decoration"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
new file mode 100644
index 000000000..f36c5a974
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.actions;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
+
+/**
+ * This action shows the CVS workspace participant into a model dialog. For single file
+ * selection, the compare editor is shown instead.
+ *
+ * @since 3.0
+ */
+public class CompareWithRemoteAction extends WorkspaceAction {
+
+ public void execute(IAction action) throws InvocationTargetException, InterruptedException {
+ final IResource[] resources = getSelectedResources();
+
+ // Show the 3-way comparison in a model dialog
+ WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ SubscriberParticipantDialog openCompare = new SubscriberParticipantDialog(getShell(), participant.getId(), participant, resources);
+ openCompare.setRememberInSyncView(false);
+ openCompare.run();
+ }
+
+ /*
+ * Update the text label for the action based on the tags in the selection.
+ * @see TeamAction#setActionEnablement(org.eclipse.jface.action.IAction)
+ */
+ protected void setActionEnablement(IAction action) {
+ super.setActionEnablement(action);
+ action.setText(calculateActionTagValue());
+ }
+
+ /**
+ * Enable for resources that are managed (using super) or whose parent is a CVS folder.
+ *
+ * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForCVSResource(org.eclipse.team.internal.ccvs.core.ICVSResource)
+ */
+ protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException {
+ return super.isEnabledForCVSResource(cvsResource) || cvsResource.getParent().isCVSFolder();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForNonExistantResources()
+ */
+ protected boolean isEnabledForNonExistantResources() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
index b41b7886f..dd474d785 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
@@ -16,9 +16,11 @@ import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
@@ -27,7 +29,12 @@ import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.ui.synchronize.viewers.SynchronizeDialog;
+/**
+ * Compare with revision will allow a user to browse the history of a file, compare with the
+ * other revisions and merge changes from other revisions into the workspace copy.
+ */
public class CompareWithRevisionAction extends WorkspaceAction {
/**
@@ -85,40 +92,49 @@ public class CompareWithRevisionAction extends WorkspaceAction {
// Show the compare viewer
run(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- CompareUI.openCompareEditorOnPage(
- new CVSCompareRevisionsInput((IFile)getSelectedResources()[0], entries[0]),
- getTargetPage());
+ public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ CVSCompareRevisionsInput input = new CVSCompareRevisionsInput((IFile)getSelectedResources()[0], entries[0]);
+ // running with a null progress monitor is fine because we have already pre-fetched the log entries above.
+ input.run(new NullProgressMonitor());
+ SynchronizeDialog cd = createCompareDialog(getShell(), input);
+ cd.setBlockOnOpen(true);
+ cd.open();
}
}, false /* cancelable */, PROGRESS_BUSYCURSOR);
}
/**
+ * Return the compare dialog to use to show the compare input.
+ */
+ protected SynchronizeDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
+ return new SynchronizeDialog(getShell(), "Compare With Revision", input);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getErrorTitle()
*/
protected String getErrorTitle() {
return Policy.bind("CompareWithRevisionAction.compare"); //$NON-NLS-1$
}
- /**
+ /* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForCVSResource(org.eclipse.team.internal.ccvs.core.ICVSResource)
*/
protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException {
return (!cvsResource.isFolder() && super.isEnabledForCVSResource(cvsResource));
}
- /**
+ /* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForMultipleResources()
*/
protected boolean isEnabledForMultipleResources() {
return false;
}
- /**
+ /* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForAddedResources()
*/
protected boolean isEnabledForAddedResources() {
return false;
}
-
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index 34393d71d..3dfd3c3e8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -19,34 +19,23 @@ import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
public class CompareWithTagAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- IResource[] resources = getSelectedResources();
+ final IResource[] resources = getSelectedResources();
CVSTag tag = promptForTag(resources);
if (tag == null)
return;
- IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage activePage = null;
- if (wWindow != null) {
- activePage = wWindow.getActivePage();
- }
- // Create the synchronize view participant
+
+ // Run the comparison
CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag);
- CompareParticipant participant = (CompareParticipant)SubscriberParticipant.find(s);
- boolean addParticipant = false;
- if(participant == null) {
- participant = new CompareParticipant(s);
- addParticipant = true;
- }
- participant.refreshWithRemote(s.roots(), addParticipant);
+ CompareParticipant participant = new CompareParticipant(s);
+ SubscriberParticipantDialog openCompare = new SubscriberParticipantDialog(getShell(), CVSCompareSubscriber.ID_MODAL, participant, resources);
+ openCompare.run();
}
-
+
protected CVSTag promptForTag(IResource[] resources) {
IProject[] projects = new IProject[resources.length];
for (int i = 0; i < resources.length; i++) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java
new file mode 100644
index 000000000..63762b0db
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.actions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.synchronize.viewers.SynchronizeDialog;
+
+/**
+ * Displays a compare dialog and allows the same behavior as the compare. In addition
+ * a replace button is added to the dialog that will replace the local with the currently
+ * selected revision.
+ *
+ * @since 3.0
+ */
+public class ReplaceWithRevisionAction extends CompareWithRevisionAction {
+
+ protected static final int REPLACE_ID = 10;
+
+ protected class ReplaceCompareDialog extends SynchronizeDialog {
+ private Button replaceButton;
+
+ public ReplaceCompareDialog(Shell shell, String title, CVSCompareRevisionsInput input) {
+ super(shell, title, input);
+ }
+
+ /**
+ * Add the replace button to the dialog.
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ replaceButton = createButton(parent, REPLACE_ID, "&Replace", false);
+ replaceButton.setEnabled(false);
+ ((CVSCompareRevisionsInput)getCompareEditorInput()).getViewer().addSelectionChangedListener(
+ new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent e) {
+ ISelection s= e.getSelection();
+ replaceButton.setEnabled(s != null && ! s.isEmpty());
+ }
+ }
+ );
+ super.createButtonsForButtonBar(parent);
+ }
+
+ /**
+ * If the replace button was pressed.
+ */
+ protected void buttonPressed(int buttonId) {
+ if(buttonId == REPLACE_ID) {
+ CVSCompareRevisionsInput input = (CVSCompareRevisionsInput)getCompareEditorInput();
+ try {
+ input.replaceLocalWithCurrentlySelectedRevision();
+ } catch (CoreException e) {
+ Utils.handle(e);
+ }
+ buttonId = IDialogConstants.OK_ID;
+ }
+ super.buttonPressed(buttonId);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction#createCompareDialog(org.eclipse.swt.widgets.Shell, org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput)
+ */
+ protected SynchronizeDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
+ return new ReplaceCompareDialog(shell, "Replace With Revision", input);
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index 1a8a7668f..0e5688de6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -17,6 +17,7 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
/**
* Action for catchup/release in popup menus.
@@ -27,7 +28,10 @@ public class SyncAction extends WorkspaceAction {
IResource[] resources = getResourcesToSync();
if (resources == null || resources.length == 0) return;
- CVSUIPlugin.showInSyncView(getShell(), resources, 0 /* no mode in particular */);
+ WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ if(participant != null) {
+ participant.refresh(resources);
+ }
}
protected IResource[] getResourcesToSync() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 8f1c0767f..f6a553be7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -11,20 +11,23 @@
package org.eclipse.team.internal.ccvs.ui.merge;
+import org.eclipse.compare.CompareEditorInput;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.ui.synchronize.viewers.SynchronizeDialog;
+import org.eclipse.ui.*;
public class MergeWizard extends Wizard {
MergeWizardStartPage startPage;
@@ -63,12 +66,38 @@ public class MergeWizard extends Wizard {
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
MergeSynchronizeParticipant participant = (MergeSynchronizeParticipant)SubscriberParticipant.find(s);
- boolean addParticipant = false;
if(participant == null) {
participant = new MergeSynchronizeParticipant(s);
- addParticipant = true;
- }
- participant.refreshWithRemote(s.roots(), addParticipant);
+ }
+
+ SubscriberParticipantDialog compareAction = new SubscriberParticipantDialog(activePage.getWorkbenchWindow().getShell(), CVSMergeSubscriber.ID_MODAL, participant, s.roots()) {
+ protected SynchronizeDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
+ return new SynchronizeDialog(shell, title, input) {
+ public boolean close() {
+ final IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ if(! isRememberParticipant() && store.getBoolean(ICVSUIConstants.PREF_PROMPT_ON_MIXED_TAGS)) {
+ AvoidableMessageDialog dialog = new AvoidableMessageDialog(
+ getShell(),
+ "Remember the Merge", //$NON-NLS-1$
+ null, // accept the default window icon
+ "Do you want to remember this merge session for later? If you plan on merging changes into your workspace from this merge configuration later on you should save this session. This will make it easier to incrementally merge changes.", //$NON-NLS-1$
+ MessageDialog.WARNING,
+ new String[] {IDialogConstants.OK_LABEL, IDialogConstants.NO_LABEL},
+ 0);
+
+ if(dialog.open() == IDialogConstants.OK_ID) {
+ rememberParticipant();
+ }
+ if(dialog.isDontShowAgain()) {
+ store.setValue(ICVSUIConstants.PREF_WARN_REMEMBERING_MERGES, false);
+ }
+ }
+ return super.close();
+ }
+ };
+ }
+ };
+ compareAction.run();
return true;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index af2b1022e..ca27c5ca2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -116,7 +116,7 @@ CVSCompareEditorInput.noWorkspaceFile=No workspace file
CVSCompareEditorInput.noRepositoryFile=No repository file
CVSCompareRevisionsInput.addToWorkspace=Get
-CVSCompareRevisionsInput.compareResourceAndVersions=Compare {0} <workspace> and versions
+CVSCompareRevisionsInput.compareResourceAndVersions=Revisions of ''{0}''
CVSCompareRevisionsInput.errorReplacingTitle=Unable to Replace
CVSCompareRevisionsInput.errorReplacingMessage=Resource(s) could not be loaded. A communication error may have occurred, or \
the resource(s) may not exist on the server, or you may \
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java
index 557cb03ed..91dddcb5d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.operations;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -21,6 +22,7 @@ import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
/**
* Reconcile an existing unshared local project with an existing remote folder.
@@ -44,11 +46,16 @@ public class ReconcileProjectOperation extends CVSOperation {
monitor.beginTask(null, 300);
ICVSRemoteFolder remote = CheckoutToRemoteFolderOperation.checkoutRemoteFolder(getShell(), folder, Policy.subMonitorFor(monitor, 100));
// TODO: make -in-sync should also be done by the subscriber
-// makeFoldersInSync(project, remote, Policy.subMonitorFor(monitor, 100));
- CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber().setRemote(project, (IResourceVariant)remote, Policy.subMonitorFor(monitor, 100));
+ // makeFoldersInSync(project, remote, Policy.subMonitorFor(monitor, 100));
+
+ final CVSWorkspaceSubscriber participant = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
+ participant.setRemote(project, (IResourceVariant)remote, Policy.subMonitorFor(monitor, 100));
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- CVSUIPlugin.showInSyncView(getShell(), null, 0 /* no mode in particular */);
+ WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ if(participant != null) {
+ participant.refresh(new IResource[] {project});
+ }
}
});
} catch (InvocationTargetException e) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
index 01a775c3e..3ff4dd5e2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
@@ -24,6 +24,7 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.viewers.*;
import org.eclipse.ui.progress.UIJob;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index 90c98db82..3462ab803 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -21,7 +21,7 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.part.IPageBookViewPage;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
public class CompareParticipant extends SubscriberParticipant {
@@ -62,7 +62,7 @@ public class CompareParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#doCreatePage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new CompareParticipantPage(this, view);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
index 55d7aebb1..47e0cd2fb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
@@ -14,11 +14,11 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider;
import org.eclipse.team.internal.ui.synchronize.actions.RemoveSynchronizeParticipantAction;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
import org.eclipse.team.ui.synchronize.subscriber.SynchronizeViewerAdvisor;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider;
import org.eclipse.ui.IActionBars;
public class CompareParticipantPage extends CVSSynchronizeViewPage {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index 877e8228d..26d207fa6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -21,11 +21,12 @@ import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.subscriber.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.IPageBookViewPage;
public class MergeSynchronizeParticipant extends SubscriberParticipant {
@@ -52,7 +53,7 @@ public class MergeSynchronizeParticipant extends SubscriberParticipant {
*/
protected void setSubscriber(Subscriber subscriber) {
super.setSubscriber(subscriber);
- String id = CVSMergeSubscriber.QUALIFIED_NAME;
+ String id = CVSMergeSubscriber.ID;
try {
ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(id);
setInitializationData(descriptor);
@@ -103,7 +104,7 @@ public class MergeSynchronizeParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#createPage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new MergeSynchronizePage(this, view);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index bde067da7..edac01341 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -14,9 +14,9 @@ import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.IPageBookViewPage;
public class WorkspaceSynchronizeParticipant extends SubscriberParticipant {
@@ -25,7 +25,7 @@ public class WorkspaceSynchronizeParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#doCreatePage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new WorkspaceSynchronizePage(this, view);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 51505e727..754044ca1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -307,7 +307,10 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
throw new InvocationTargetException(e);
}
}
- CVSUIPlugin.showInSyncView(getContainer().getShell(), null, SubscriberParticipant.OUTGOING_MODE);
+ WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ if(participant != null) {
+ participant.refresh(new IResource[] {project});
+ }
}
} catch (InterruptedException e) {
return true;
diff --git a/bundles/org.eclipse.team.ui/icons/full/cview16/compare_view.gif b/bundles/org.eclipse.team.ui/icons/full/cview16/compare_view.gif
new file mode 100644
index 000000000..41800a0c9
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/icons/full/cview16/compare_view.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index cb76d2eca..ead44fbe3 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -39,21 +39,5 @@ Command.category.description=Actions that apply when working with a Team
Command.syncAll.name=Synchronize
Command.syncAll.description=Synchronize
-Command.incomingFilter.name=Select Incoming Mode
-Command.incomingFilter.description=Select Incoming Mode in the Synchronize view
-Command.outgoingFilter.name=Select Outgoing Mode
-Command.outgoingFilter.description=Select Outgoing Mode in the Synchronize view
-Command.conflictsFilter.name=Select Conflicts Mode
-Command.conflictsFilter.description=Select Conflicts Mode in the Synchronize view
-Command.bothFilter.name=Select Incoming/Outgoing Mode
-Command.bothFilter.description=Select Incoming/Outgoing Mode in the Synchronize view
-Command.toggleView.name=Toggle Synchronize View Layout
-Command.toggleView.description=Toggle the Synchronize view's layout
-
-Command.selectNextChange.description=Move to the next change
-Command.selectNextChange.name=Next Change
-Command.selectPreviousChange.description=Move to the previous change
-Command.selectPreviousChange.name=Previous Change
-
CompressFolderView.name=Compress Folders
CompressFolderView.description=Compress in-sync folders paths
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 23a969d05..78affbe5e 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -137,6 +137,7 @@
point="org.eclipse.ui.perspectives">
<perspective
name="%Synchronizing.perspective"
+ label="%Synchronizing.perspective"
icon="icons/full/cview16/synch_synch.gif"
class="org.eclipse.team.internal.ui.synchronize.TeamSynchronizingPerspective"
id="org.eclipse.team.ui.TeamSynchronizingPerspective">
@@ -193,14 +194,44 @@
</showInPart>
</perspectiveExtension>
</extension>
-<!-- ***************** Action sets ********************** -->
+<!-- ***************** Actions ********************** -->
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ name="%Command.category.name"
+ description="%Command.category.description"
+ id="org.eclipse.team.ui.category.team">
+ </category>
+ <command
+ name="%Command.syncAll.name"
+ category="org.eclipse.team.ui.category.team"
+ description="%Command.syncAll.description"
+ id="org.eclipse.team.ui.synchronizeAll">
+ </command>
+ <keyBinding
+ string=""
+ scope="org.eclipse.ui.globalScope"
+ command="org.eclipse.team.ui.synchronizeAll"
+ configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
+ </keyBinding>
+ </extension>
+<!-- action sets -->
<extension
point="org.eclipse.ui.actionSets">
<actionSet
- label="%Team"
- description="%ActionSet.description"
- visible="false"
+ label="%Command.category.name"
+ description="%Command.category.description"
+ visible="true"
id="org.eclipse.team.ui.actionSet">
+ <action
+ label="%Command.syncAll.name"
+ pulldown="true"
+ style="pulldown"
+ icon="icons/full/cview16/synch_synch.gif"
+ class="org.eclipse.team.internal.ui.synchronize.actions.GlobalRefreshAction"
+ toolbarPath="Normal/Team"
+ id="org.eclipse.team.ui.synchronizeAll">
+ </action>
</actionSet>
</extension>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java
index 38c613284..3bd284dc8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java
@@ -28,5 +28,11 @@ public interface IPreferenceIds {
public static final String SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES = PREFIX + "syncview__bkg_promptwhennochanges"; //$NON-NLS-1$
public static final String SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES = PREFIX + "syncview_bkg_promptwithchanges"; //$NON-NLS-1$
- public static final String SYNCVIEW_VIEW_SMART_MODE_SWITCH = PREFIX + "syncview_smartmode"; //$NON-NLS-1$
-}
+ public static final String SYNCHRONIZING_DEFAULT_PARTICIPANT = PREFIX + "sychronizing_default_participant"; //$NON-NLS-1$
+ public static final String SYNCHRONIZING_COMPLETE_SHOW_DIALOG = PREFIX + "sychronizing_dontshow_complete_dialog"; //$NON-NLS-1$
+
+ public static final String SYNCHRONIZING_COMPLETE_PERSPECTIVE = PREFIX + "sychronizing_default_perspective_to_show"; //$NON-NLS-1$
+ public static final String SYNCHRONIZING_COMPLETE_PERSPECTIVE_PROMPT = PREFIX + "sychronizing_default_perspective_to_show_prompt"; //$NON-NLS-1$
+ public static final String SYNCHRONIZING_COMPLETE_PERSPECTIVE_ALWAYS = PREFIX + "sychronizing_default_perspective_to_show_always"; //$NON-NLS-1$
+ public static final String SYNCHRONIZING_COMPLETE_PERSPECTIVE_NEVER = PREFIX + "sychronizing_default_perspective_to_show_never"; //$NON-NLS-1$
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/OverlayIcon.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/OverlayIcon.java
index 801bd250e..df86de033 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/OverlayIcon.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/OverlayIcon.java
@@ -14,9 +14,7 @@ import java.util.Arrays;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.*;
/**
* An OverlayIcon consists of a main icon and several adornments.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
index 36611f963..700e99613 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
@@ -15,11 +15,7 @@ import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.team.internal.core.InfiniteSubProgressMonitor;
import org.eclipse.team.internal.core.NullSubProgressMonitor;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index 5de10c18f..533724f5e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.internal.ui.synchronize.SynchronizeManager;
import org.eclipse.team.internal.ui.synchronize.TeamSynchronizingPerspective;
+import org.eclipse.team.internal.ui.synchronize.actions.GlobalRefreshAction;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
@@ -145,7 +146,9 @@ public class TeamUIPlugin extends AbstractUIPlugin {
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES, true);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES, false);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES, true);
- store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_SMART_MODE_SWITCH, false);
+ store.setDefault(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, GlobalRefreshAction.NO_DEFAULT_PARTICPANT);
+ store.setDefault(IPreferenceIds.SYNCHRONIZING_COMPLETE_SHOW_DIALOG, true);
+ store.setDefault(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE, IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE_PROMPT); //$NON-NLS-1$
}
/**
@@ -288,9 +291,9 @@ public class TeamUIPlugin extends AbstractUIPlugin {
createImageDescriptor(plugin, ISharedImages.IMG_CONFLICT_OVR, baseURL);
createImageDescriptor(plugin, ISharedImages.IMG_CHECKEDIN_OVR, baseURL);
createImageDescriptor(plugin, ISharedImages.IMG_CHECKEDOUT_OVR, baseURL);
-
-
+
createImageDescriptor(plugin, ISharedImages.IMG_SYNC_VIEW, baseURL);
+ createImageDescriptor(plugin, ISharedImages.IMG_COMPARE_VIEW, baseURL);
// Collapse all
createImageDescriptor(plugin, ISharedImages.IMG_COLLAPSE_ALL, baseURL);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 3a2a29329..a02f4537b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -10,46 +10,30 @@
*******************************************************************************/
package org.eclipse.team.internal.ui;
+import java.io.*;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.*;
import java.util.List;
-import java.util.ResourceBundle;
-import java.util.Set;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.*;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
public class Utils {
@@ -470,4 +454,35 @@ public class Utils {
}
job.schedule();
}
+
+ public static byte[] readBytes(InputStream in) {
+ ByteArrayOutputStream bos= new ByteArrayOutputStream();
+ try {
+ while (true) {
+ int c= in.read();
+ if (c == -1)
+ break;
+ bos.write(c);
+ }
+
+ } catch (IOException ex) {
+ return null;
+
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException x) {
+ // silently ignored
+ }
+ }
+ try {
+ bos.close();
+ } catch (IOException x) {
+ // silently ignored
+ }
+ }
+
+ return bos.toByteArray();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
index 3eebe1a5b..806a46a8a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
@@ -13,21 +13,14 @@ package org.eclipse.team.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.*;
/**
* This runnable context executes it's operation in the context of a background job.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
index 035f8a3cb..1275112a2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
@@ -10,26 +10,18 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.dialogs;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.*;
import java.util.List;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.*;
/**
* This class provides facilities to allow common widget groupings to be shared
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
index acaf2b035..3bc3b6a5d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
@@ -16,35 +16,18 @@ import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferencePageContainer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.preference.*;
+import org.eclipse.jface.resource.*;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
index 52191239a..1c7fa1542 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
@@ -1,37 +1,35 @@
package org.eclipse.team.internal.ui.jobs;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import java.util.*;
+
+import org.eclipse.compare.CompareUI;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.synchronize.IRefreshEvent;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.synchronize.RefreshCompleteDialog;
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.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.*;
+import org.eclipse.team.ui.synchronize.viewers.SyncInfoCompareInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
+/**
+ * This class manages the notification and setup that occurs after a refresh is completed.
+ *
+ *
+ */
public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener {
private SubscriberParticipant participant;
- private boolean addIfNeeded;
- public RefreshUserNotificationPolicy(SubscriberParticipant participant, boolean addIfNeeded) {
+ public RefreshUserNotificationPolicy(SubscriberParticipant participant) {
this.participant = participant;
- this.addIfNeeded = addIfNeeded;
}
/*
* (non-Javadoc)
- *
* @see org.eclipse.team.internal.ui.jobs.IRefreshSubscriberListener#refreshStarted(org.eclipse.team.internal.ui.jobs.IRefreshEvent)
*/
public void refreshStarted(IRefreshEvent event) {
@@ -39,61 +37,49 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
/*
* (non-Javadoc)
- *
* @see org.eclipse.team.internal.ui.jobs.IRefreshSubscriberListener#refreshDone(org.eclipse.team.internal.ui.jobs.IRefreshEvent)
*/
- public void refreshDone(IRefreshEvent event) {
- if(event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber()) return;
+ public void refreshDone(final IRefreshEvent event) {
+ // Ensure that this event was generated for this participant
+ if (event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber())
+ return;
- int type = event.getRefreshType();
-
- boolean promptWithChanges = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES);
- boolean promptWhenNoChanges = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES);
- boolean promptWithChangesBkg = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES);
- boolean promptWhenNoChangesBkg = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES);
-
- boolean shouldPrompt = false;
- SyncInfo[] infos = event.getChanges();
-
- if (type == IRefreshEvent.USER_REFRESH) {
- if (promptWhenNoChanges && infos.length == 0) {
- shouldPrompt = true;
- } else if (promptWithChanges && infos.length > 0) {
- shouldPrompt = true;
- }
- } else {
- if (promptWhenNoChangesBkg && infos.length == 0) {
- shouldPrompt = true;
- } else if (promptWithChangesBkg && infos.length > 0) {
- shouldPrompt = true;
- }
- }
-
- // If there are interesting changes, ensure the sync view is showing them
- // Also, add the participant to the sync view only if changes have been found.
- if (infos.length > 0) {
- participant.setMode(SubscriberParticipant.INCOMING_MODE);
- final ISynchronizeManager manager = TeamUI.getSynchronizeManager();
- if (addIfNeeded) {
- manager.addSynchronizeParticipants(new ISynchronizeParticipant[]{participant});
- TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- ISynchronizeView view = manager.showSynchronizeViewInActivePage(null);
- if (view != null) {
- view.display(participant);
+ // Decide on what action to take after the refresh is completed
+ TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ boolean prompt = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCHRONIZING_COMPLETE_SHOW_DIALOG);
+
+ SyncInfo[] infos = event.getChanges();
+ List selectedResources = new ArrayList();
+ selectedResources.addAll(Arrays.asList(event.getResources()));
+ for (int i = 0; i < infos.length; i++) {
+ selectedResources.add(infos[i].getLocal());
+ }
+ IResource[] resources = (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]);
+
+ // If it's a file, simply show the compare editor
+ if (resources.length == 1 && resources[0].getType() == IResource.FILE) {
+ IResource file = resources[0];
+ SyncInfo info = participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet().getSyncInfo(file);
+ if(info != null) {
+ CompareUI.openCompareEditor(new SyncInfoCompareInput(participant.getName(), info));
+ prompt = false;
}
}
- });
- }
- }
-
- // Prompt user if preferences are set for this type of refresh.
- if (shouldPrompt) {
- notifyIfNeededModal(event);
- }
+
+ // ensure the synchronize views are shown
+ TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage();
+
+
+ // Prompt user if preferences are set for this type of refresh.
+ if (prompt) {
+ notifyIfNeededModal(event);
+ }
+ }
+ });
RefreshSubscriberJob.removeRefreshListener(this);
}
-
+
private void notifyIfNeededModal(final IRefreshEvent event) {
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() {
@@ -115,4 +101,6 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
}
}, message);
}
+
+
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 9b93efdf6..d70efa8ab 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -342,17 +342,12 @@ Utils.24=Incoming/Outgoing
Utils.25=Conflicting
Utils.26=unknown mode
RefreshCompleteDialog.4=Team Resfresh Complete - {0}
-RefreshCompleteDialog.5={0} new changes found
-RefreshCompleteDialog.6=No new changes found
-RefreshCompleteDialog.7=refreshing the following {0} resource(s):
-RefreshCompleteDialog.13=SyncViewerPreferencePage.16
-RefreshCompleteDialog.14=SyncViewerPreferencePage.17
-RefreshCompleteDialog.15=SyncViewerPreferencePage.31
-RefreshCompleteDialog.16=SyncViewerPreferencePage.32
-RefreshCompleteDialog.17=Preview Changes >>
-RefreshCompleteDialog.18=<< Preview Changes
-RefreshUserNotificationPolicy.0=Refresh of ''{0}'' Complete.
-ConfigureRefreshScheduleDialog.0=Configure Refresh Schedule - {0}
+RefreshCompleteDialog.5=Synchronize has completed and you have changes to synchronize. {0} currently has {1} outgoing, {2} incoming, and {3} conflicting changes.
+RefreshCompleteDialog.6=No changes to synchronize.
+RefreshCompleteDialog.17=Details >>
+RefreshCompleteDialog.18=<< Details
+RefreshUserNotificationPolicy.0=Synchronize of ''{0}'' Complete.
+ConfigureRefreshScheduleDialog.0=Configure Synchronize Schedule - {0}
ConfigureRefreshScheduleDialog.1=You can allow ''{0}'' to periodically refresh it's synchronization state in the background.
ConfigureRefreshScheduleDialog.1a=The last refresh occured at: {0}
ConfigureRefreshScheduleDialog.2=Don't schedule the refresh operation to run periodically.
@@ -377,3 +372,22 @@ ChangesSection.9=Reset View
ChangesSection.10=Errors have occurred calculating the synchronization state for {0}
ChangesSection.11=Errors Populating View
ChangesSection.12=Multiple errors occurred while attempting to populate the view.
+
+OpenComparedDialog.diffViewTitleMany=Changes
+OpenComparedDialog.diffViewTitleOne=Changes
+OpenComparedDialog.noChangeTitle=Operation Complete
+OpenComparedDialog.noChangesMessage=No Changes Found.
+GlobalRefreshAction.4=Synchronize...
+GlobalRefreshAction.5=Synchronize {0}...
+SubscriberRefreshWizard.0=Synchronize
+ParticipantCompareDialog.1=Remember this result by placing it in the Synchronize View.
+ParticipantCompareDialog.2=Confirm Save
+ParticipantCompareDialog.3=Do you want to save changes?
+RefreshCompleteDialog.21=Show only the latest new incoming changes
+RefreshCompleteDialog.22=Don't show this dialog again.
+SynchronizeManager.27=Confirm Perspective Switch
+SynchronizeManager.28=Never
+SynchronizeManager.29=Always
+SynchronizeManager.30=Synchronization is associated with the {0} perspective. Do you want to switch to that perspective now?
+RefreshCompleteDialog.9=Changes
+RefreshSubscriberJob.2=Synchronizing {0}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
index 924527d9b..4374a8fa0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
@@ -11,28 +11,17 @@
package org.eclipse.team.internal.ui.preferences;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.IIgnoreInfo;
import org.eclipse.team.core.Team;
-import org.eclipse.team.internal.ui.IHelpContextIds;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
index a423da7c9..2a5f1c12b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
@@ -31,10 +31,9 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
private BooleanFieldEditor compressFolders = null;
private BooleanFieldEditor showSyncInLabels = null;
- private BooleanFieldEditor promptWithChanges = null;
- private BooleanFieldEditor promptWhenNoChanges = null;
- private BooleanFieldEditor promptWithChangesBkg = null;
- private BooleanFieldEditor promptWhenNoChangesBkg = null;
+ private BooleanFieldEditor promptAtEndOfSynchronize = null;
+ private BooleanFieldEditor useDefaultPerspective = null;
+ private RadioGroupFieldEditor synchronizePerspectiveSwitch = null;
private static class PerspectiveDescriptorComparator implements Comparator {
/*
@@ -69,25 +68,25 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
public void createFieldEditors() {
- Group displayGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.8")); //$NON-NLS-1$
-
- compressFolders = new BooleanFieldEditor(SYNCVIEW_COMPRESS_FOLDERS, Policy.bind("SyncViewerPreferencePage.9"), SWT.NONE, displayGroup); //$NON-NLS-1$
+ compressFolders = new BooleanFieldEditor(SYNCVIEW_COMPRESS_FOLDERS, Policy.bind("SyncViewerPreferencePage.9"), SWT.NONE, getFieldEditorParent()); //$NON-NLS-1$
addField(compressFolders);
- showSyncInLabels = new BooleanFieldEditor(SYNCVIEW_VIEW_SYNCINFO_IN_LABEL, Policy.bind("SyncViewerPreferencePage.19"), SWT.NONE, displayGroup); //$NON-NLS-1$
+ showSyncInLabels = new BooleanFieldEditor(SYNCVIEW_VIEW_SYNCINFO_IN_LABEL, Policy.bind("SyncViewerPreferencePage.19"), SWT.NONE, getFieldEditorParent()); //$NON-NLS-1$
addField(showSyncInLabels);
- Group promptGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.30")); //$NON-NLS-1$
+ new Label(getFieldEditorParent(), SWT.NONE);
+
+ promptAtEndOfSynchronize = new BooleanFieldEditor(SYNCHRONIZING_COMPLETE_SHOW_DIALOG, "Prompt at the end of a synchronize operation.", SWT.NONE, getFieldEditorParent()); //$NON-NLS-1$
+ addField(promptAtEndOfSynchronize);
- promptWhenNoChanges = new BooleanFieldEditor(SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES, Policy.bind("SyncViewerPreferencePage.16"), SWT.NONE, promptGroup); //$NON-NLS-1$
- addField(promptWhenNoChanges);
- promptWithChanges = new BooleanFieldEditor(SYNCVIEW_VIEW_PROMPT_WITH_CHANGES, Policy.bind("SyncViewerPreferencePage.17"), SWT.NONE, promptGroup); //$NON-NLS-1$
- addField(promptWithChanges);
+ synchronizePerspectiveSwitch= new RadioGroupFieldEditor(SYNCHRONIZING_COMPLETE_PERSPECTIVE, "Switch to the associated perspective when a synchronize operation completes", 3,
+ new String[][] {
+ {"Always", SYNCHRONIZING_COMPLETE_PERSPECTIVE_ALWAYS},
+ {"Never", SYNCHRONIZING_COMPLETE_PERSPECTIVE_NEVER},
+ {"Prompt", SYNCHRONIZING_COMPLETE_PERSPECTIVE_PROMPT}
+ },
+ getFieldEditorParent(), true);
+ addField(synchronizePerspectiveSwitch);
- promptWhenNoChangesBkg = new BooleanFieldEditor(SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES, Policy.bind("SyncViewerPreferencePage.31"), SWT.NONE, promptGroup); //$NON-NLS-1$
- addField(promptWhenNoChangesBkg);
- promptWithChangesBkg = new BooleanFieldEditor(SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES, Policy.bind("SyncViewerPreferencePage.32"), SWT.NONE, promptGroup); //$NON-NLS-1$
- addField(promptWithChangesBkg);
-
Group perspectiveGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.15")); //$NON-NLS-1$
createLabel(perspectiveGroup, Policy.bind("SynchronizationViewPreference.defaultPerspectiveDescription"), 1); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TeamPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TeamPreferencePage.java
index dbf86809a..c65178491 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TeamPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TeamPreferencePage.java
@@ -16,12 +16,8 @@ import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.team.internal.ui.IHelpContextIds;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
index f1675c65d..995140b84 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
@@ -23,12 +23,14 @@ public class SynchronizeParticipantDescriptor implements ISynchronizeParticipant
public static final String ATT_ICON = "icon"; //$NON-NLS-1$
public static final String ATT_CLASS = "class"; //$NON-NLS-1$
private static final String ATT_TYPE = "type"; //$NON-NLS-1$
- private static final String TYPE_STATIC = "static"; //$NON-NLS-1$
+ private static final String ATT_TYPE_STATIC = "static"; //$NON-NLS-1$
+ private static final String ATT_SUPPORTS_REFRESH = "supportsRefresh"; //$NON-NLS-1$
private String label;
private String className;
private String type;
private String id;
+ private boolean supportsRefresh;
private ImageDescriptor imageDescriptor;
private String description;
@@ -82,13 +84,17 @@ public class SynchronizeParticipantDescriptor implements ISynchronizeParticipant
return imageDescriptor;
}
- public String getLabel() {
+ public String getName() {
return label;
}
public boolean isStatic() {
if(type == null) return true;
- return type.equals(TYPE_STATIC);
+ return type.equals(ATT_TYPE_STATIC);
+ }
+
+ public boolean doesSupportRefresh() {
+ return supportsRefresh;
}
/**
@@ -99,6 +105,12 @@ public class SynchronizeParticipantDescriptor implements ISynchronizeParticipant
label = configElement.getAttribute(ATT_NAME);
className = configElement.getAttribute(ATT_CLASS);
type = configElement.getAttribute(ATT_TYPE);
+ String supportsRefreshString = configElement.getAttribute(ATT_SUPPORTS_REFRESH);
+ if(supportsRefreshString == null) {
+ supportsRefresh = true;
+ } else {
+ supportsRefresh = Boolean.valueOf(supportsRefreshString).booleanValue();
+ }
// Sanity check.
if ((label == null) || (className == null) || (identifier == null)) {
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 6ae1b6723..a0b90fea1 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
@@ -263,7 +263,7 @@ public class ChangesSection extends Composite {
Label warning = new Label(composite, SWT.NONE);
warning.setImage(TeamUIPlugin.getPlugin().getImage(ISharedImages.IMG_WARNING));
- Hyperlink link = forms.createHyperlink(composite, Policy.bind("ChangesSection.workingSetRemove"), SWT.WRAP);
+ Hyperlink link = forms.createHyperlink(composite, Policy.bind("ChangesSection.workingSetRemove"), SWT.WRAP); //$NON-NLS-1$
link.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
participant.setWorkingSet(null);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
index 0a02d8a62..786d85898 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.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 java.util.*;
@@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.viewers.*;
public class CompressedFoldersModelProvider extends HierarchicalModelProvider {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
index c4c62f649..63f241520 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ConfigureRefreshScheduleDialog.java
@@ -2,16 +2,13 @@ package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberRefreshSchedule;
-import org.eclipse.team.internal.ui.Policy;
public class ConfigureRefreshScheduleDialog extends DetailsDialog {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
index a537e8da4..7ecfb3a56 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.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.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.ui.synchronize.viewers.*;
/**
* An input that can be used with both {@link } and
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
deleted file mode 100644
index 12bb707a5..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.eclipse.team.internal.ui.synchronize;
-
-public interface IRefreshSubscriberListener {
- public void refreshStarted(IRefreshEvent event);
- public void refreshDone(IRefreshEvent event);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java
index 237a00fea..4ea6fa6f0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java
@@ -10,20 +10,12 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
-import org.eclipse.compare.IEditableContent;
-import org.eclipse.compare.IStreamContentAccessor;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.ResourceNode;
+import org.eclipse.compare.*;
import org.eclipse.compare.internal.BufferedResourceNode;
import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -78,6 +70,7 @@ public class LocalResourceTypedElement extends ResourceNode {
file.create(is, false, pm);
fDirty= false;
} finally {
+ fireContentChanged();
if (is != null)
try {
is.close();
@@ -124,6 +117,7 @@ public class LocalResourceTypedElement extends ResourceNode {
} catch (CoreException ex) {
}
}
+ fireContentChanged();
return child;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
index 800693903..5d96ae5de 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
@@ -11,15 +11,16 @@
package org.eclipse.team.internal.ui.synchronize;
import java.lang.reflect.InvocationTargetException;
+
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -28,22 +29,24 @@ import org.eclipse.team.core.subscribers.FilteredSyncInfoCollector;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
+import org.eclipse.team.ui.synchronize.subscriber.IRefreshEvent;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeCompareInput;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
public class RefreshCompleteDialog extends DetailsDialog {
+ // For remembering the dialog sizings
private static final String HEIGHT_KEY = "width-key"; //$NON-NLS-1$
- private final static int RESOURCE_LIST_SIZE = 10;
private static final String WIDTH_KEY = "height-key"; //$NON-NLS-1$
+
+ private SyncInfoFilter filter;
private FilteredSyncInfoCollector collector;
private SynchronizeCompareInput compareEditorInput;
private IRefreshEvent event;
private SubscriberParticipant participant;
- private Button promptWhenNoChanges;
- private Button promptWithChanges;
+ private Button dontShowAgainButton;
+
private IDialogSettings settings;
private SyncInfoTree syncInfoSet = new SyncInfoTree();
@@ -56,8 +59,7 @@ public class RefreshCompleteDialog extends DetailsDialog {
setImageKey(DLG_IMG_INFO);
// Set-up a sync info set that contains the resources that where found
// when the refresh occured.
- SyncInfoFilter filter = new SyncInfoFilter() {
-
+ filter = new SyncInfoFilter() {
public boolean select(SyncInfo info, IProgressMonitor monitor) {
IResource[] resources = getResources();
for (int i = 0; i < resources.length; i++) {
@@ -123,11 +125,10 @@ public class RefreshCompleteDialog extends DetailsDialog {
protected Composite createDropDownDialogArea(Composite parent) {
try {
CompareConfiguration compareConfig = new CompareConfiguration();
- TreeViewerAdvisor viewerAdvisor = new TreeViewerAdvisor(participant.getId(), null, syncInfoSet);
+ TreeViewerAdvisor viewerAdvisor = new TreeViewerAdvisor(syncInfoSet);
compareEditorInput = new SynchronizeCompareInput(compareConfig, viewerAdvisor) {
-
public String getTitle() {
- return "Resources found during last refresh";
+ return Policy.bind("RefreshCompleteDialog.9"); //$NON-NLS-1$
}
};
// Preparing the input should be fast since we haven't started the collector
@@ -151,6 +152,22 @@ public class RefreshCompleteDialog extends DetailsDialog {
Control c = compareEditorInput.createContents(result);
data = new GridData(GridData.FILL_BOTH);
c.setLayoutData(data);
+
+ Button onlyNewChangesButton = new Button(result, SWT.CHECK);
+ onlyNewChangesButton.setText(Policy.bind("RefreshCompleteDialog.21")); //$NON-NLS-1$
+ onlyNewChangesButton.setSelection(true);
+ onlyNewChangesButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ if(((Button)e.getSource()).getSelection()) {
+ collector.setFilter(filter, new NullProgressMonitor());
+ } else {
+ collector.setFilter(new FastSyncInfoFilter(), new NullProgressMonitor());
+ }
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
return result;
}
@@ -161,60 +178,35 @@ public class RefreshCompleteDialog extends DetailsDialog {
StringBuffer text = new StringBuffer();
SyncInfo[] changes = event.getChanges();
IResource[] resources = event.getResources();
- if (changes.length != 0) {
- text.append(Policy.bind("RefreshCompleteDialog.5", Integer.toString(changes.length))); //$NON-NLS-1$
+ SyncInfoSet set = getSubscriberSyncInfoSet();
+ if (! set.isEmpty()) {
+ String outgoing = Long.toString(set.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK));
+ String incoming = Long.toString(set.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK));
+ String conflicting = Long.toString(set.countFor(SyncInfo.CONFLICTING, SyncInfo.DIRECTION_MASK));
+ text.append(Policy.bind("RefreshCompleteDialog.5", new Object[] {participant.getName(), outgoing, incoming, conflicting})); //$NON-NLS-1$
+ createLabel(parent, text.toString(), 2);
} else {
text.append(Policy.bind("RefreshCompleteDialog.6")); //$NON-NLS-1$
+ createLabel(parent, text.toString(), 2);
}
- text.append(Policy.bind("RefreshCompleteDialog.7", Integer.toString(resources.length))); //$NON-NLS-1$ //$NON-NLS-2$
- createLabel(parent, text.toString(), 2);
- Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
- data.horizontalSpan = 2;
- data.widthHint = 200;
- data.heightHint = 125;
- table.setLayoutData(data);
- TableViewer resourceList = new TableViewer(table);
- resourceList.setContentProvider(new ArrayContentProvider());
- resourceList.setLabelProvider(new WorkbenchLabelProvider());
- resourceList.setInput(resources);
- createLabel(parent, "", 2); //$NON-NLS-1$
- promptWhenNoChanges = new Button(parent, SWT.CHECK);
- data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- promptWhenNoChanges.setLayoutData(data);
- promptWithChanges = new Button(parent, SWT.CHECK);
- data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- promptWithChanges.setLayoutData(data);
- if (event.getRefreshType() == IRefreshEvent.USER_REFRESH) {
- promptWhenNoChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.13"))); //$NON-NLS-1$
- promptWhenNoChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES));
- promptWithChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.14"))); //$NON-NLS-1$
- promptWithChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES));
- } else {
- promptWhenNoChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.15"))); //$NON-NLS-1$
- promptWhenNoChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES));
- promptWithChanges.setText(Policy.bind(Policy.bind("RefreshCompleteDialog.16"))); //$NON-NLS-1$
- promptWithChanges.setSelection(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES));
- }
+
+ dontShowAgainButton = new Button(parent, SWT.CHECK);
+ dontShowAgainButton.setText(Policy.bind("RefreshCompleteDialog.22")); //$NON-NLS-1$
+
+ initializeSettings();
Dialog.applyDialogFont(parent);
}
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#getDetailsButtonLabelHide()
- */
- protected String getDetailsButtonLabelHide() {
- return Policy.bind("RefreshCompleteDialog.18");
+ private void initializeSettings() {
+ if(dontShowAgainButton != null) {
+ dontShowAgainButton.setSelection(! TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCHRONIZING_COMPLETE_SHOW_DIALOG));
+ }
}
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#getDetailsButtonLabelShow()
- */
- protected String getDetailsButtonLabelShow() {
- return Policy.bind("RefreshCompleteDialog.17");
+ protected SyncInfoSet getSubscriberSyncInfoSet() {
+ return participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#getInitialSize()
*/
@@ -241,7 +233,7 @@ public class RefreshCompleteDialog extends DetailsDialog {
* @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton()
*/
protected boolean includeDetailsButton() {
- return event.getChanges().length != 0;
+ return ! getSubscriberSyncInfoSet().isEmpty();
}
/* (non-Javadoc)
@@ -255,14 +247,10 @@ public class RefreshCompleteDialog extends DetailsDialog {
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
protected void okPressed() {
- if (event.getRefreshType() == IRefreshEvent.USER_REFRESH) {
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WHEN_NO_CHANGES, promptWhenNoChanges.getSelection());
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_PROMPT_WITH_CHANGES, promptWithChanges.getSelection());
- } else {
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES, promptWhenNoChanges.getSelection());
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WITH_CHANGES, promptWithChanges.getSelection());
+ if(dontShowAgainButton != null) {
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_COMPLETE_SHOW_DIALOG, ! dontShowAgainButton.getSelection());
}
- TeamUIPlugin.getPlugin().savePluginPreferences();
+ TeamUIPlugin.getPlugin().savePluginPreferences();
super.okPressed();
}
@@ -277,6 +265,7 @@ public class RefreshCompleteDialog extends DetailsDialog {
label.setText(text);
GridData data = new GridData();
data.horizontalSpan = columns;
+ data.widthHint = 375;
label.setLayoutData(data);
return label;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RemoteResourceTypedElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RemoteResourceTypedElement.java
index 912f874d5..3210ffbaf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RemoteResourceTypedElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RemoteResourceTypedElement.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.variants.IResourceVariant;
+import org.eclipse.team.internal.core.Assert;
/**
* RemoteResourceTypedElement
@@ -31,6 +32,7 @@ public class RemoteResourceTypedElement extends BufferedContent implements IType
* Creates a new content buffer for the given team node.
*/
public RemoteResourceTypedElement(IResourceVariant remote) {
+ Assert.isNotNull(remote);
this.remote = remote;
}
@@ -112,4 +114,15 @@ public class RemoteResourceTypedElement extends BufferedContent implements IType
public void cacheContents(IProgressMonitor monitor) throws TeamException {
bufferedContents = remote.getStorage(monitor);
}
+
+ /**
+ * Update the remote handle in this typed element.
+ * @param variant the new remote handle
+ */
+ public void update(IResourceVariant variant) {
+ Assert.isNotNull(variant);
+ discardBuffer();
+ remote = variant;
+ fireContentChanged();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index 5e6f95f1b..8e5e1e062 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -10,51 +10,21 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.io.*;
+import java.util.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.util.ListenerList;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantDescriptor;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantRegistry;
import org.eclipse.team.ui.ITeamUIConstants;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.*;
/**
* Manages the registered synchronize participants. It handles notification of
@@ -160,7 +130,7 @@ public class SynchronizeManager implements ISynchronizeManager {
participant.init(savedState);
} catch (PartInitException e2) {
participant = null;
- throw new TeamException(Policy.bind("SynchronizeManager.11"), e2);
+ throw new TeamException(Policy.bind("SynchronizeManager.11"), e2); //$NON-NLS-1$
} catch (CoreException e) {
participant = null;
throw TeamException.asTeamException(e);
@@ -329,16 +299,16 @@ public class SynchronizeManager implements ISynchronizeManager {
return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
- /**
- * Called to display the synchronize view in the given page. If the given
- * page is <code>null</code> the synchronize view is shown in the default
- * active workbench window.
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeManager#showSynchronizeViewInActivePage()
*/
- public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage activePage) {
+ public ISynchronizeView showSynchronizeViewInActivePage() {
IWorkbench workbench = TeamUIPlugin.getPlugin().getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (!TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE).equals(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE_NONE)) {
+ boolean switchPerspectives = promptForPerspectiveSwitch();
+ IWorkbenchPage activePage = null;
+ if(switchPerspectives) {
try {
String pId = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE);
activePage = workbench.showPerspective(pId, window);
@@ -358,6 +328,64 @@ public class SynchronizeManager implements ISynchronizeManager {
return null;
}
}
+
+ /**
+ * Decides what action to take when switching perspectives and showing the synchronize view. Basically there are a
+ * set of user preferences that control how perspective switching.
+ */
+ private boolean promptForPerspectiveSwitch() {
+ // Decide if a prompt is even required
+ String option = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE);
+ if(option.equals(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE_ALWAYS)) {
+ return true;
+ } else if(option.equals(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE_NEVER)) {
+ return false;
+ }
+
+ // Otherwise determine if a prompt is required
+ IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry();
+ String defaultSyncPerspective = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE);
+ String currentPerspective = null;
+ IPerspectiveDescriptor perspectiveDescriptor = registry.findPerspectiveWithId(defaultSyncPerspective);
+ IWorkbenchPage page = TeamUIPlugin.getActivePage();
+ if(page != null) {
+ IPerspectiveDescriptor p = page.getPerspective();
+ if(currentPerspective != null && currentPerspective.equals(defaultSyncPerspective)) {
+ perspectiveDescriptor = null;
+ }
+ }
+
+ if(perspectiveDescriptor != null) {
+ String perspectiveName = perspectiveDescriptor.getLabel();
+
+ MessageDialog m = new MessageDialog(Display.getDefault().getActiveShell(),
+ Policy.bind("SynchronizeManager.27"), //$NON-NLS-1$
+ null, // accept the default window icon
+ Policy.bind("SynchronizeManager.30", perspectiveDescriptor.getLabel()), //$NON-NLS-1$
+ MessageDialog.QUESTION,
+ new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, Policy.bind("SynchronizeManager.28"), Policy.bind("SynchronizeManager.29")}, //$NON-NLS-1$ //$NON-NLS-2$
+ 0); // yes is the default
+
+ int result = m.open();
+ switch (result) {
+ // yes
+ case 0 :
+ return true;
+ // no
+ case 1 :
+ return false;
+ // never
+ case 2 :
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE, IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE_NEVER);
+ return false;
+ // always
+ case 3 :
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE, IPreferenceIds.SYNCHRONIZING_COMPLETE_PERSPECTIVE_ALWAYS);
+ return true;
+ }
+ }
+ return false;
+ }
/**
* Creates the participant registry and restore any saved participants.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
index 8b6def3e6..576117caf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.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 java.util.*;
@@ -27,6 +27,7 @@ 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.ui.progress.UIJob;
/**
@@ -43,7 +44,7 @@ import org.eclipse.ui.progress.UIJob;
* @see CompressedFoldersModelProvider
* @since 3.0
*/
-public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeListener {
+public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeListener, ISynchronizeModelProvider {
// Flasg to indicate if tree control should be updated while
// building the model.
@@ -161,6 +162,20 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
}
/**
+ * The provider can try and return a mapping for the provided object. Providers often use mappings
+ * to store the source of a logical element they have created. For example, when displaying resource
+ * based logical elements, a provider will cache the resource -> element mapping for quick retrieval
+ * of the element when resource based changes are made.
+ *
+ * @param object the object to query for a mapping
+ * @return an object created by this provider that would be shown in a viewer, or <code>null</code>
+ * if the provided object is not mapped by this provider.
+ */
+ public Object getMapping(Object object) {
+ return resourceMap.get(object);
+ }
+
+ /**
* Dispose of the builder
*/
public void dispose() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
index 8875ed041..e794f0106 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
@@ -23,16 +23,9 @@ import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction;
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.ISynchronizeParticipantListener;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.*;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
+import org.eclipse.ui.part.*;
/**
* Implements a Synchronize View that contains multiple synchronize participants.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java
index b28617e0d..3387a7b4c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.*;
public class TeamSynchronizingPerspective implements IPerspectiveFactory {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java
new file mode 100644
index 000000000..ce43c6c6d
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * 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.ui.synchronize.actions;
+
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.wizards.GlobalSynchronizeWizard;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+
+/**
+ * A global refresh action that allows the user to select the participant to refresh
+ * or the default action is to refresh the last selected participant. Participants are
+ * only listed if they support
+ * <p>
+ * This action is normally associated with the Team action set and is enabled by default
+ * in the Team Synchronizing perspective.
+ * </p>
+ * @since 3.0
+ */
+public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate {
+
+ public final static String NO_DEFAULT_PARTICPANT = "none"; //$NON-NLS-1$
+ private Menu fMenu;
+ private Action synchronizeAction;
+ private IWorkbenchWindow window;
+
+ static class SynchronizeWizardDialog extends WizardDialog {
+ SynchronizeWizardDialog(Shell parent, IWizard wizard) {
+ super(parent, wizard);
+ setShellStyle(getShellStyle());
+ setMinimumPageSize(500, 300);
+ }
+ }
+
+ class RefreshParticipantAction extends Action {
+ private ISynchronizeParticipant participant;
+
+ public void run() {
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, participant.getId());
+ IWizard wizard = participant.createSynchronizeWizard();
+ SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ dialog.open();
+ GlobalRefreshAction.this.updateTooltipMessage();
+ }
+
+ public RefreshParticipantAction(int prefix, ISynchronizeParticipant participant) {
+ super("&" + prefix + " " + participant.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ this.participant = participant;
+ setImageDescriptor(participant.getImageDescriptor());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.IUpdate#update()
+ */
+ public void update() {
+ ISynchronizeParticipant[] pages = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+ setEnabled(pages.length >= 1);
+ }
+
+ public GlobalRefreshAction() {
+ Utils.initAction(this, "action.refreshSubscriber."); //$NON-NLS-1$
+ synchronizeAction = new Action(Policy.bind("GlobalRefreshAction.4")) { //$NON-NLS-1$
+ public void run() {
+ IWizard wizard = new GlobalSynchronizeWizard();
+ SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ dialog.open();
+ }
+ };
+ setMenuCreator(this);
+ setToolTipText("this is a test");
+ //updateTooltipMessage();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.IMenuCreator#dispose()
+ */
+ public void dispose() {
+ if (fMenu != null) {
+ fMenu.dispose();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
+ */
+ public Menu getMenu(Menu parent) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
+ */
+ public Menu getMenu(Control parent) {
+ if (fMenu != null) {
+ fMenu.dispose();
+ }
+ fMenu = new Menu(parent);
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+ for (int i = 0; i < participants.length; i++) {
+ ISynchronizeParticipant description = participants[i];
+ if (description.doesSupportSynchronize()) {
+ Action action = new RefreshParticipantAction(i + 1, description);
+ addActionToMenu(fMenu, action);
+ }
+ }
+ addMenuSeparator();
+ addActionToMenu(fMenu, synchronizeAction);
+ return fMenu;
+ }
+
+ protected void addActionToMenu(Menu parent, Action action) {
+ ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(parent, -1);
+ }
+
+ protected void addMenuSeparator() {
+ new MenuItem(fMenu, SWT.SEPARATOR);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ String id = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT);
+ IWizard wizard = new GlobalSynchronizeWizard();
+ if(! id.equals(NO_DEFAULT_PARTICPANT)) {
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().find(id);
+ if(participants.length > 0) {
+ wizard = participants[0].createSynchronizeWizard();
+ }
+ }
+ SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ dialog.open();
+ updateTooltipMessage();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ protected void updateTooltipMessage() {
+ String id = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT);
+ if(! id.equals(NO_DEFAULT_PARTICPANT)) {
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().find(id);
+ if(participants.length > 0) {
+ setToolTipText(Policy.bind("GlobalRefreshAction.5", participants[0].getName())); //$NON-NLS-1$
+ }
+ } else {
+ setToolTipText(Policy.bind("GlobalRefreshAction.4")); //$NON-NLS-1$
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
index bb4784fc7..0a99a1f94 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize.actions;
-import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -95,9 +94,7 @@ public class OpenInCompareAction extends Action {
*/
private static SyncInfoCompareInput getCompareInput(ISynchronizeParticipant participant, SyncInfo info) {
if (info != null && info.getLocal() instanceof IFile) {
- CompareConfiguration cc = new CompareConfiguration();
- //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, Boolean.TRUE);
- return new SyncInfoCompareInput(cc, participant.getName(), info);
+ return new SyncInfoCompareInput(participant.getName(), info);
}
return null;
}
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 71a6d58fc..1d1fd9cfa 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,8 +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.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.subscriber.*;
+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/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
index e0d21abd6..2714a2500 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ShowSynchronizeParticipantAction.java
@@ -11,8 +11,8 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import org.eclipse.jface.action.Action;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
public class ShowSynchronizeParticipantAction extends Action {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java
deleted file mode 100644
index 1dbb8fce9..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * 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.ui.synchronize.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
-import org.eclipse.team.ui.synchronize.subscriber.RefreshAction;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.IWorkbenchSite;
-
-/**
- * A specialized RefreshAction that extracts the required components from a
- * particpant.
- */
-public class TeamParticipantRefreshAction extends RefreshAction {
-
- public TeamParticipantRefreshAction(ISelectionProvider provider, SubscriberParticipant participant, boolean addIfNeeded, boolean refreshAll) {
- super(provider, participant.getName(), participant.getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(participant, addIfNeeded), refreshAll);
- }
-
- public static void run(IWorkbenchSite site, IResource[] resources, SubscriberParticipant participant, boolean addIfNeeded) {
- run(site, participant.getName(), resources, participant.getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(participant, addIfNeeded));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshParticipantSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshParticipantSelectionPage.java
new file mode 100644
index 000000000..ac82939c1
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshParticipantSelectionPage.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * 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.ui.wizards;
+
+import java.util.*;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.model.BaseWorkbenchContentProvider;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+
+/**
+ * Page that allows the user to select a set of resources that are managed
+ * by a synchronize participant.
+ *
+ * Remembers last participant
+ *
+ * @since 3.0
+ */
+public class GlobalRefreshParticipantSelectionPage extends WizardPage implements IDoubleClickListener, ISelectionChangedListener {
+
+ private TableViewer fViewer;
+ private ISynchronizeParticipantDescriptor selectedParticipantDescriptor;
+ private IWizard wizard;
+ private ISynchronizeParticipant participant;
+ private List createdImages;
+
+ class MyContentProvider extends BaseWorkbenchContentProvider {
+ public Object[] getChildren(Object element) {
+ if(element instanceof ISynchronizeManager) {
+ List participants = new ArrayList();
+ ISynchronizeManager manager = (ISynchronizeManager)element;
+ ISynchronizeParticipant[] desciptors = manager.getSynchronizeParticipants();
+ for (int i = 0; i < desciptors.length; i++) {
+ ISynchronizeParticipant descriptor = desciptors[i];
+ if(descriptor.doesSupportSynchronize()) {
+ participants.add(descriptor);
+ }
+ }
+ return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
+ }
+ return super.getChildren(element);
+ }
+ }
+
+ class MyLabelProvider extends LabelProvider {
+ public String getText(Object element) {
+ if(element instanceof ISynchronizeParticipant) {
+ ISynchronizeParticipant descriptor = (ISynchronizeParticipant)element;
+ return descriptor.getName();
+ }
+ return null;
+ }
+
+ public Image getImage(Object element) {
+ if(element instanceof ISynchronizeParticipant) {
+ ISynchronizeParticipant descriptor = (ISynchronizeParticipant)element;
+ ImageDescriptor d = descriptor.getImageDescriptor();
+ if(createdImages == null) {
+ createdImages = new ArrayList(3);
+ }
+ Image image = d.createImage();
+ createdImages.add(image);
+ return image;
+ }
+ return null;
+ }
+ }
+
+ public GlobalRefreshParticipantSelectionPage() {
+ super("Synchronize");
+ setDescription("Select the participant to synchronize");
+ setTitle("Select a Synchronize Participant");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
+ */
+ public void dispose() {
+ if (createdImages != null) {
+ for (Iterator it = createdImages.iterator(); it.hasNext();) {
+ Image image = (Image) it.next();
+ image.dispose();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent2) {
+ Composite top = new Composite(parent2, SWT.NULL);
+ top.setLayout(new GridLayout());
+ setControl(top);
+
+ Label l = new Label(top, SWT.NULL);
+ l.setText("Available synchronize participants:");
+ fViewer = new TableViewer(top, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ fViewer.getControl().setLayoutData(data);
+ fViewer.setContentProvider(new MyContentProvider());
+ fViewer.addDoubleClickListener(this);
+ fViewer.setLabelProvider(new MyLabelProvider());
+ fViewer.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ fViewer.setInput(TeamUI.getSynchronizeManager());
+ fViewer.addSelectionChangedListener(this);
+ fViewer.getTable().setFocus();
+ Dialog.applyDialogFont(parent2);
+ }
+
+ public void doubleClick(DoubleClickEvent event) {
+ selectionChanged(
+ new SelectionChangedEvent(
+ event.getViewer(),
+ event.getViewer().getSelection()));
+ getContainer().showPage(getNextPage());
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Initialize the wizard so we can tell whether to enable the
+ // Next button
+ ISelection selection = event.getSelection();
+ if (selection == null || !(selection instanceof IStructuredSelection)) {
+ wizard = null;
+ setPageComplete(false);
+ return;
+ }
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() != 1) {
+ wizard = null;
+ setPageComplete(false);
+ return;
+ }
+ participant = (ISynchronizeParticipant)ss.getFirstElement();
+ wizard = participant.createSynchronizeWizard();
+ wizard.addPages();
+ // Ask the container to update button enablement
+ setPageComplete(true);
+ }
+
+ public IWizard getSelectedWizard() {
+ return this.wizard;
+ }
+
+ public ISynchronizeParticipant getSelectedParticipant() {
+ return this.participant;
+ }
+
+ /**
+ * The <code>WizardSelectionPage</code> implementation of
+ * this <code>IWizardPage</code> method returns the first page
+ * of the currently selected wizard if there is one.
+ *
+ * @see WizardPage#getNextPage
+ */
+ public IWizardPage getNextPage() {
+ if (wizard == null) return null;
+ return wizard.getStartingPage();
+ }
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ fViewer.getTable().setFocus();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshResourceSelectionPage.java
new file mode 100644
index 000000000..e269f03b3
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshResourceSelectionPage.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * 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.ui.wizards;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.ui.*;
+import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.internal.dialogs.ContainerCheckedTreeViewer;
+import org.eclipse.ui.model.BaseWorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+
+/**
+ * Page that allows the user to select a set of resources that are managed
+ * by a synchronize participant.
+ *
+ * Remembers last selection
+ * Remembers last working set
+ *
+ * @since 3.0
+ */
+public class GlobalRefreshResourceSelectionPage extends WizardPage {
+
+ private SubscriberParticipant participant;
+ private Button selectOutgoingChanges;
+ private ContainerCheckedTreeViewer fViewer;
+
+ class MyContentProvider extends BaseWorkbenchContentProvider {
+ public Object[] getChildren(Object element) {
+ if(element instanceof SubscriberParticipant) {
+ return ((SubscriberParticipant)element).getResources();
+ }
+ return super.getChildren(element);
+ }
+ }
+
+ class MyLabelProvider extends LabelProvider {
+ private LabelProvider workbenchProvider = new WorkbenchLabelProvider();
+ public String getText(Object element) {
+ if(element instanceof IContainer) {
+ IContainer c = (IContainer)element;
+ List participantRoots = Arrays.asList(participant.getResources());
+ if(participantRoots.contains(c)) {
+ return c.getFullPath().toString();
+ }
+ }
+ return workbenchProvider.getText(element);
+ }
+ public Image getImage(Object element) {
+ return workbenchProvider.getImage(element);
+ }
+ }
+
+ class MyContainerCheckedTree extends ContainerCheckedTreeViewer {
+
+ public MyContainerCheckedTree(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ protected void doCheckStateChanged(Object element) {
+ Widget item = findItem(element);
+ if (item instanceof TreeItem) {
+ TreeItem treeItem = (TreeItem) item;
+ treeItem.setGrayed(false);
+ //updateChildrenItems(treeItem);
+ doUpdateParentItems(treeItem.getParentItem());
+ }
+ }
+
+ /**
+ * Updates the check / gray state of all parent items
+ */
+ private void doUpdateParentItems(TreeItem item) {
+ if (item != null) {
+ Item[] children = getChildren(item);
+ boolean containsChecked = false;
+ boolean containsUnchecked = false;
+ for (int i = 0; i < children.length; i++) {
+ TreeItem curr = (TreeItem) children[i];
+ containsChecked |= curr.getChecked();
+ containsUnchecked |= (!curr.getChecked() || curr.getGrayed());
+ }
+ item.setChecked(containsChecked);
+ item.setGrayed(containsChecked && containsUnchecked);
+ doUpdateParentItems(item.getParentItem());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.internal.dialogs.ContainerCheckedTreeViewer#setExpanded(org.eclipse.swt.widgets.Item, boolean)
+ */
+ protected void setExpanded(Item item, boolean expand) {
+ ((TreeItem) item).setExpanded(expand);
+ }
+ }
+
+ public GlobalRefreshResourceSelectionPage(SubscriberParticipant participant) {
+ super("Synchronize");
+ setDescription("Select the resource to synchronize");
+ setTitle("Synchronize");
+ setParticipant(participant);
+ }
+
+ public void setParticipant(SubscriberParticipant participant) {
+ this.participant = participant;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent2) {
+ Composite top = new Composite(parent2, SWT.NULL);
+ top.setLayout(new GridLayout());
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+ setControl(top);
+
+ if (participant.getSubscriber().roots().length == 0) {
+ Label l = new Label(top, SWT.NULL);
+ l.setText("There are no resources associated with '" + participant.getName() + "''.");
+ } else {
+ Label l = new Label(top, SWT.NULL);
+ l.setText("Available resources to Synchronize:");
+ fViewer = new ContainerCheckedTreeViewer(top, SWT.BORDER) {
+
+ };
+ GridData data = new GridData(GridData.FILL_BOTH);
+ fViewer.getControl().setLayoutData(data);
+ fViewer.setContentProvider(new MyContentProvider());
+ fViewer.setLabelProvider(new MyLabelProvider());
+ fViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateOKStatus();
+ }
+ });
+ fViewer.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ fViewer.setInput(participant);
+
+ Composite buttonComposote = new Composite(top, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.numColumns = 3;
+ layout.makeColumnsEqualWidth = true;
+ buttonComposote.setLayout(layout);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ buttonComposote.setLayoutData(data);
+
+ Button selectAll = new Button(buttonComposote, SWT.NULL);
+ selectAll.setText("&Select All");
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setCheckedElements(participant.getResources());
+ updateOKStatus();
+ }
+ });
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ selectAll.setLayoutData(data);
+ Dialog.applyDialogFont(selectAll);
+
+ Button deSelectAll = new Button(buttonComposote, SWT.NULL);
+ deSelectAll.setText("&Deselect All");
+ deSelectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setCheckedElements(new Object[0]);
+ updateOKStatus();
+ }
+ });
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ deSelectAll.setLayoutData(data);
+ Dialog.applyDialogFont(deSelectAll);
+
+ Button selectWorkingSetButton = new Button(buttonComposote, SWT.NULL);
+ selectWorkingSetButton.setText("&Working Set...");
+ selectWorkingSetButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
+ IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(getShell(), false);
+ dialog.open();
+ IWorkingSet[] workingSet = dialog.getSelection();
+ if(workingSet != null) {
+ for (int i = 0; i < workingSet.length; i++) {
+ IWorkingSet set = workingSet[i];
+ List resources = IDE.computeSelectedResources(new StructuredSelection(set.getElements()));
+ if(! resources.isEmpty()) {
+ fViewer.setCheckedElements((IResource[])resources.toArray(new IResource[resources.size()]));
+ }
+ }
+ updateOKStatus();
+ }
+ }
+ });
+ data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ selectWorkingSetButton.setLayoutData(data);
+ Dialog.applyDialogFont(selectWorkingSetButton);
+ }
+ updateOKStatus();
+ Dialog.applyDialogFont(top);
+ }
+
+ protected void updateOKStatus() {
+ if(fViewer != null) {
+ setPageComplete(fViewer.getCheckedElements().length > 0);
+ } else {
+ setPageComplete(true);
+ }
+ }
+
+ public IResource[] getSelectedResources() {
+ if(fViewer != null) {
+ List resources = IDE.computeSelectedResources(new StructuredSelection(fViewer.getCheckedElements()));
+ return (IResource[]) resources.toArray(new IResource[resources.size()]);
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java
new file mode 100644
index 000000000..5844001d9
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalSynchronizeWizard.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.ui.wizards;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.wizard.*;
+import org.eclipse.team.internal.ui.IPreferenceIds;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * The wizard for synchronizing a synchronize participant.
+ *
+ * @since 3.0
+ */
+public class GlobalSynchronizeWizard extends Wizard {
+
+ protected IWorkbench workbench;
+ protected IWizard wizard;
+ protected GlobalRefreshParticipantSelectionPage mainPage;
+ protected ISynchronizeParticipant participant;
+ private String pluginId = TeamUIPlugin.PLUGIN_ID;
+
+ public GlobalSynchronizeWizard() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("Synchronize"); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_WIZBAN_SHARE));
+ setForcePreviousAndNextButtons(true);
+ }
+
+ /*
+ * @see Wizard#addPages
+ */
+ public void addPages() {
+ ISynchronizeParticipant[] participants = getParticipants();
+ if (participants.length == 1) {
+ // If there is only one wizard, skip the first page.
+ // Only skip the first page if the one wizard has at least one
+ // page.
+ participant = participants[0];
+ IWizard wizard = participants[0].createSynchronizeWizard();
+ wizard.addPages();
+ if (wizard.getPageCount() > 0) {
+ wizard.setContainer(getContainer());
+ IWizardPage[] pages = wizard.getPages();
+ for (int i = 0; i < pages.length; i++) {
+ addPage(pages[i]);
+ }
+ return;
+ }
+ }
+ mainPage = new GlobalRefreshParticipantSelectionPage();
+ addPage(mainPage);
+ }
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (wizard != null) {
+ return wizard.getNextPage(page);
+ }
+ return super.getNextPage(page);
+ }
+
+ public boolean canFinish() {
+ // If we are on the first page, never allow finish unless the selected
+ // wizard has no pages.
+ if (getContainer().getCurrentPage() == mainPage) {
+ if (mainPage.getSelectedWizard() != null && mainPage.getNextPage() == null) {
+ return true;
+ }
+ return false;
+ }
+ if (wizard != null) {
+ return wizard.canFinish();
+ }
+ return super.canFinish();
+ }
+
+ /*
+ * @see Wizard#performFinish
+ */
+ public boolean performFinish() {
+ // There is only one wizard with at least one page
+ if (wizard != null) {
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, getSelectedParticipant().getId());
+ return wizard.performFinish();
+ }
+ // If we are on the first page and the selected wizard has no pages then allow it to finish.
+ if (getContainer().getCurrentPage() == mainPage) {
+ IWizard noPageWizard = mainPage.getSelectedWizard();
+ if (noPageWizard != null) {
+ if (noPageWizard.canFinish()) {
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, getSelectedParticipant().getId());
+ return noPageWizard.performFinish();
+ }
+ }
+ }
+ // If the wizard has pages and there are several
+ // wizards registered then the registered wizard
+ // will call it's own performFinish().
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, getSelectedParticipant().getId());
+ return true;
+ }
+
+ protected ISynchronizeParticipant[] getParticipants() {
+ List participants = new ArrayList();
+ ISynchronizeManager manager = (ISynchronizeManager) TeamUI.getSynchronizeManager();
+ ISynchronizeParticipant[] desciptors = manager.getSynchronizeParticipants();
+ for (int i = 0; i < desciptors.length; i++) {
+ ISynchronizeParticipant descriptor = desciptors[i];
+ if (descriptor.doesSupportSynchronize()) {
+ participants.add(descriptor);
+ }
+ }
+ return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
+ }
+
+ protected ISynchronizeParticipant getSelectedParticipant() {
+ if(participant == null && mainPage != null) {
+ return mainPage.getSelectedParticipant();
+ } else {
+ return participant;
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java
index f29f19f97..34e57b626 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java
@@ -10,19 +10,11 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.wizards;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
+import java.io.*;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.*;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -30,17 +22,10 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.core.IProjectSetSerializer;
-import org.eclipse.team.core.Team;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.ProjectSetContentHandler;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.core.*;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.ui.ISharedImages;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.*;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/SubscriberRefreshWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/SubscriberRefreshWizard.java
new file mode 100644
index 000000000..fdc4fafa7
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/SubscriberRefreshWizard.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.ui.wizards;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.TeamImages;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+
+public class SubscriberRefreshWizard extends Wizard {
+
+ private SubscriberParticipant participant;
+ private GlobalRefreshResourceSelectionPage selectionPage;
+
+ public SubscriberRefreshWizard(SubscriberParticipant participant) {
+ this.participant = participant;
+ setWindowTitle(Policy.bind("SubscriberRefreshWizard.0") + participant.getName()); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_WIZBAN_SHARE));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ selectionPage = new GlobalRefreshResourceSelectionPage(participant);
+ addPage(selectionPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ IResource[] resources = selectionPage.getSelectedResources();
+ if(resources != null) {
+ participant.refresh(resources);
+ }
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
index b827bebb5..81e612616 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
@@ -26,6 +26,7 @@ public interface ISharedImages {
public final String IMG_COLLAPSE_ALL_ENABLED = "elcl16/collapseall.gif"; //$NON-NLS-1$
public final String IMG_SYNC_VIEW = "cview16/synch_synch.gif"; //$NON-NLS-1$
+ public final String IMG_COMPARE_VIEW = "cview16/compare_view.gif"; //$NON-NLS-1$
// local toolbars (colour)
public final String IMG_DLG_SYNC_INCOMING = "clcl16/incom_synch.gif"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
index 7da095d8d..8abc0d516 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
@@ -19,6 +19,7 @@ import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantDescriptor;
import org.eclipse.team.ui.TeamImages;
+import org.eclipse.team.ui.TeamUI;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
@@ -118,6 +119,14 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
return true;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#doesSupportRefresh()
+ */
+ public boolean doesSupportSynchronize() {
+ ISynchronizeParticipantDescriptor d = TeamUI.getSynchronizeManager().getParticipantDescriptor(getId());
+ return d == null ? false : d.doesSupportRefresh();
+ }
+
/*
* (non-Javadoc)
*
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
index 9c5cdbebc..e796751df 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import org.eclipse.ui.IWorkbenchPage;
/**
* Manages synchronization view participants. Clients can programatically add
@@ -63,12 +62,12 @@ public interface ISynchronizeManager {
public ISynchronizeParticipant[] getSynchronizeParticipants();
/**
- * Opens the synchronize view in the given page. Has no effect if the view is
- * already open in that page.
+ * Opens the synchronize views in the perspective defined by the user in the team synchronize
+ * perferences.
*
- * @return the opened synchronize view
+ * @return the opened synchronize view or <code>null</code> if it can't be opened.
*/
- public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
+ public ISynchronizeView showSynchronizeViewInActivePage();
/**
* Returns the registered synchronize participants with the given id. It is
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
index 4daa0e83f..1e583180d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
@@ -13,6 +13,7 @@ package org.eclipse.team.ui.synchronize;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -93,7 +94,27 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* participant
*/
public IPageBookViewPage createPage(ISynchronizeView view);
-
+
+ /**
+ * Creates and returns a wizard page used to globally synchronize this participant. Participants
+ * returning a wizard will get added to the global Team synchronize action and users can
+ * easily initiate a synchronization on the participant. The implementor can decide exactly
+ * what information is needed from the user to synchronize.
+ *
+ * @return a wizard that prompts the user for information necessary to synchronize this
+ * participant or <code>null</code> if this participant doesn't want to support global refresh.
+ */
+ public IWizard createSynchronizeWizard();
+
+ /**
+ * Returns if this participant supports a global synchronize action and will return a wizard
+ * if {@link #createSynchronizeWizard()} is called.
+ *
+ * @return <code>true</code> if this participant supports a global synchronize action and
+ * <code>false</code> otherwise.
+ */
+ public boolean doesSupportSynchronize();
+
/**
* Initializes this participant with the given participant state.
* A memento is passed to the participant which contains a snapshot
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipantDescriptor.java
index 9a0a99fac..0cfbed6f5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipantDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipantDescriptor.java
@@ -25,6 +25,13 @@ import org.eclipse.jface.resource.ImageDescriptor;
*/
public interface ISynchronizeParticipantDescriptor {
/**
+ * Returns the name of this participant. This can be shown to the user.
+ *
+ * @return the name of this participant. This can be shown to the user.
+ */
+ public String getName();
+
+ /**
* Returns a string describing this participant type.
*
* @return a string describing this participant type.
@@ -56,4 +63,11 @@ public interface ISynchronizeParticipantDescriptor {
* <code>false</code> otherwise
*/
public boolean isStatic();
+
+ /**
+ * Returns if this participant supports a global refresh action.
+ *
+ * @return if this participant supports a global refresh action.
+ */
+ public boolean doesSupportRefresh();
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
index 1fd7579a0..995db2767 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.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.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java
new file mode 100644
index 000000000..ef57f1b5f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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.subscriber;
+
+public interface IRefreshSubscriberListener {
+ public void refreshStarted(IRefreshEvent event);
+ public void refreshDone(IRefreshEvent event);
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
index a3b999a5a..5ff05a326 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
@@ -11,20 +11,17 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.*;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
-import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IWorkbenchSite;
/**
* A general refresh action that will refresh a subscriber in the background.
+ *
+ * @since 3.0
*/
public class RefreshAction extends Action {
@@ -56,13 +53,34 @@ public class RefreshAction extends Action {
}
}
- public static void run(IWorkbenchSite site, String description, IResource[] resources, final SubscriberSyncInfoCollector collector, IRefreshSubscriberListener listener) {
- // Cancel the scheduled background refresh or any other refresh that is happening.
- // The scheduled background refresh will restart automatically.
- Platform.getJobManager().cancel(RefreshSubscriberJob.getFamily());
- RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", description), resources, collector); //$NON-NLS-1$
+ /**
+ * Policy.bind("SyncViewRefresh.taskName");
+ *
+ * @param site
+ * @param taskName
+ * @param description
+ * @param resources
+ * @param collector
+ * @param listener
+ */
+ public static void run(IWorkbenchSite site, String taskName, IResource[] resources, final SubscriberSyncInfoCollector collector, final IRefreshSubscriberListener listener) {
+ RefreshSubscriberJob job = new RefreshSubscriberJob(taskName, resources, collector); //$NON-NLS-1$
+ IRefreshSubscriberListener autoListener = new IRefreshSubscriberListener() {
+ public void refreshStarted(IRefreshEvent event) {
+ if(listener != null) {
+ listener.refreshStarted(event);
+ }
+ }
+ public void refreshDone(IRefreshEvent event) {
+ if(listener != null) {
+ listener.refreshDone(event);
+ RefreshSubscriberJob.removeRefreshListener(this);
+ }
+ }
+ };
+
if (listener != null) {
- RefreshSubscriberJob.addRefreshListener(listener);
+ RefreshSubscriberJob.addRefreshListener(autoListener);
}
Utils.schedule(job, site);
}
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 5a9ef43d3..1f503660e 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
@@ -13,23 +13,17 @@ package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.actions.TeamParticipantRefreshAction;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
+import org.eclipse.team.internal.ui.wizards.SubscriberRefreshWizard;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.*;
import org.eclipse.ui.part.IPageBookViewPage;
/**
@@ -50,7 +44,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
private ISynchronizeView view;
- private boolean starting = true;
+ private SubscriberParticipantPage page;
/**
* Key for settings in memento
@@ -101,13 +95,21 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
*/
public final IPageBookViewPage createPage(ISynchronizeView view) {
this.view = view;
- return doCreatePage(view);
+ this.page = doCreatePage(view);
+ return this.page;
}
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new SubscriberParticipantPage(this, view);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#createRefreshPage()
+ */
+ public IWizard createSynchronizeWizard() {
+ return new SubscriberRefreshWizard(this);
+ }
+
public void setMode(int mode) {
int oldMode = getMode();
if(oldMode == mode) return;
@@ -144,13 +146,27 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
return workingSet;
}
- public void refreshWithRemote(IResource[] resources, boolean addIfNeeded) {
+ public void selectResources(IResource[] resources) {
+ page.setSelection(resources, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#getResources()
+ */
+ public IResource[] getResources() {
+ return collector.getSubscriber().roots();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#refresh(org.eclipse.core.resources.IResource[])
+ */
+ public void refresh(IResource[] resources) {
IWorkbenchSite site = view != null ? view.getSite() : null;
+ IResource[] resourcesToRefresh = resources;
if((resources == null || resources.length == 0)) {
- TeamParticipantRefreshAction.run(site, collector.getWorkingSet(), this, addIfNeeded);
- } else {
- TeamParticipantRefreshAction.run(site, resources, this, addIfNeeded);
+ resourcesToRefresh = collector.getWorkingSet();
}
+ RefreshAction.run(site, getName(), resourcesToRefresh, getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(this));
}
/* (non-Javadoc)
@@ -190,7 +206,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
/**
* This method is invoked just before the collector is started.
- * This gives an opertunity to configure the collector parameters
+ * This gives an oportunity to configure the collector parameters
* before collection starts. The default implementation sets the working
* set as returned by <code>getWorkingSet()</code> and sets the mode
* as returned by <code>getMode()</code>.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantDialog.java
new file mode 100644
index 000000000..e0f581e07
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantDialog.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * 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.subscriber;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.*;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.subscribers.Subscriber;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.ui.synchronize.viewers.*;
+
+/**
+ * Dialog that supports synchronizing a participant and displaying the results in a dialog. The user can edit the changes
+ * in the dialog and will be prompted to save the changes when the dialog is closed. This provides a modal helper for
+ * showing a subscriber participant to the user.
+ * <p>
+ * Example usage of this dialog:
+ * <pre>
+ * SubscriberParticipant = new MyParticipant();
+ * SubscriberParticipantDialog dialog = new SubscriberParticipantDialog(shell, participant.getId(), participant, resources);
+ * dialog.run();
+ * </pre>
+ * </p>
+ * TODO: mention the remembering of the participant
+ *
+ * @see SubscriberParticipant
+ * @since 3.0
+ */
+public class SubscriberParticipantDialog {
+
+ private SubscriberParticipant participant;
+ private Shell shell;
+ private IResource[] resources;
+ private boolean rememberInSyncView;
+ private String targetId;
+
+ /**
+ *
+ * @param shell shell to use to open the compare dialog
+ * @param participant the participant to use as a basis for the comparison
+ * @param resources
+ */
+ public SubscriberParticipantDialog(Shell shell, String targetId, SubscriberParticipant participant, IResource[] resources) {
+ this.shell = shell;
+ this.targetId = targetId;
+ this.participant = participant;
+ this.resources = resources;
+ }
+
+ public void run() {
+ Subscriber s = participant.getSubscriber();
+ RefreshAction.run(null, participant.getName(), s.roots(), participant.getSubscriberSyncInfoCollector(), new IRefreshSubscriberListener() {
+ public void refreshStarted(IRefreshEvent event) {
+ }
+ public void refreshDone(final IRefreshEvent event) {
+ TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (participant.getSubscriberSyncInfoCollector().getSyncInfoTree().isEmpty()) {
+ MessageDialog.openInformation(getShell(), Policy.bind("OpenComparedDialog.noChangeTitle"), Policy.bind("OpenComparedDialog.noChangesMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ if (isSingleFileCompare(resources)) {
+ compareAndOpenEditors(event, participant);
+ } else {
+ compareAndOpenDialog(event, participant);
+ }
+ }
+ });
+ }
+ });
+ }
+
+ protected Shell getShell() {
+ return shell;
+ }
+
+ protected boolean isSingleFileCompare(IResource[] resources) {
+ return resources.length == 1 && resources[0].getType() == IResource.FILE;
+ }
+
+ protected void compareAndOpenEditors(IRefreshEvent event, SubscriberParticipant participant) {
+ for (int i = 0; i < resources.length; i++) {
+ SyncInfo info = participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet().getSyncInfo(resources[i]);
+ if(info != null) {
+ CompareUI.openCompareEditor(new SyncInfoCompareInput(event.getSubscriber().getName(), info));
+ }
+ }
+ }
+
+ protected void compareAndOpenDialog(final IRefreshEvent event, final SubscriberParticipant participant) {
+ TreeViewerAdvisor advisor = new TreeViewerAdvisor(targetId, null, participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
+ CompareConfiguration cc = new CompareConfiguration();
+ SynchronizeCompareInput input = new SynchronizeCompareInput(cc, advisor) {
+ public String getTitle() {
+ int numChanges = participant.getSubscriberSyncInfoCollector().getSyncInfoTree().size();
+ if(numChanges > 1) {
+ return Policy.bind("OpenComparedDialog.diffViewTitleMany", Integer.toString(numChanges)); //$NON-NLS-1$
+ } else {
+ return Policy.bind("OpenComparedDialog.diffViewTitleOne", Integer.toString(numChanges)); //$NON-NLS-1$
+ }
+ }
+ };
+ try {
+ // model will be built in the background since we know the compare input was
+ // created with a subscriber participant
+ input.run(new NullProgressMonitor());
+ } catch (InterruptedException e) {
+ Utils.handle(e);
+ } catch (InvocationTargetException e) {
+ Utils.handle(e);
+ }
+ SynchronizeDialog dialog = createCompareDialog(getShell(), participant.getName(), input);
+ if(isRememberInSyncView()) {
+ dialog.setSynchronizeParticipant(participant);
+ }
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+ }
+
+ protected SynchronizeDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
+ return new SynchronizeDialog(shell, title, input);
+ }
+
+ /**
+ * @return Returns the rememberInSyncView.
+ */
+ public boolean isRememberInSyncView() {
+ return rememberInSyncView;
+ }
+ /**
+ * @param rememberInSyncView The rememberInSyncView to set.
+ */
+ public void setRememberInSyncView(boolean rememberInSyncView) {
+ this.rememberInSyncView = rememberInSyncView;
+ }
+}
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 712c82176..fe705c96b 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
@@ -11,6 +11,7 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.compare.internal.INavigatable;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -21,10 +22,12 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
import org.eclipse.team.internal.ui.synchronize.ChangesSection;
import org.eclipse.team.internal.ui.synchronize.ConfigureRefreshScheduleDialog;
import org.eclipse.team.internal.ui.synchronize.actions.*;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor;
import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
import org.eclipse.ui.*;
import org.eclipse.ui.part.*;
@@ -58,7 +61,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
private NavigateAction gotoPrevious;
private Action configureSchedule;
private SyncViewerShowPreferencesAction showPreferences;
- private TeamParticipantRefreshAction refreshAllAction;
+ private RefreshAction refreshAllAction;
private Action collapseAll;
private WorkingSetFilterActionGroup workingSetGroup;
private StatusLineContributionGroup statusLine;
@@ -101,7 +104,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
};
gotoNext = new NavigateAction(view, nav, true /*next*/);
gotoPrevious = new NavigateAction(view, nav, false /*previous*/);
- refreshAllAction = new TeamParticipantRefreshAction(getSite().getSelectionProvider(), getParticipant(), false, true /* refresh all */);
+ refreshAllAction = new RefreshAction(getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
refreshAllAction.setWorkbenchSite(view.getSite());
collapseAll = new Action() {
public void run() {
@@ -297,8 +300,8 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
getSite().setSelectionProvider(viewer);
return viewer;
}
-
- public TreeViewerAdvisor getViewerConfiguration() {
+
+ public StructuredViewerAdvisor getViewerConfiguration() {
return viewerAdvisor;
}
@@ -309,4 +312,8 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
protected SynchronizeViewerAdvisor createSynchronizeViewerAdvisor() {
return new SynchronizeViewerAdvisor(getSynchronizeView(), getParticipant());
}
+
+ public void setSelection(IResource[] resources, boolean reveal) {
+ getViewerConfiguration().setSelection(resources, reveal);
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
index 1b8a8c7f8..17acfd648 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
@@ -9,8 +9,6 @@ import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
-import org.eclipse.team.internal.ui.synchronize.IRefreshEvent;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IMemento;
public class SubscriberRefreshSchedule {
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 427c714c5..b3b00ce68 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,9 +16,12 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.*;
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.viewers.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
+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;
/**
* Overrides the SyncInfoDiffViewerConfiguration to configure the diff viewer
@@ -30,7 +33,7 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
private SubscriberParticipant participant;
private OpenWithActionGroup openWithActions;
private RefactorActionGroup refactorActions;
- private TeamParticipantRefreshAction refreshSelectionAction;
+ private RefreshAction refreshSelectionAction;
public SynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(participant.getId(), view.getViewSite(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
@@ -46,7 +49,7 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
super.initializeActions(treeViewer);
openWithActions = new OpenWithActionGroup(view, participant);
refactorActions = new RefactorActionGroup(view);
- refreshSelectionAction = new TeamParticipantRefreshAction(treeViewer, participant, false /* refresh */, false);
+ refreshSelectionAction = new RefreshAction(view.getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
refreshSelectionAction.setWorkbenchSite(view.getSite());
}
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 cbe3e8a37..189aa111f 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,10 +10,8 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
-
/**
- * Listener that gets informed when the <code>DiffNode</code> model created
- * by the configurator is created or updated.
+ * Listener that gets informed when the model created by the model provider is created or updated.
* <p>
* Clients may implement this interface.
* </p>
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
new file mode 100644
index 000000000..63a204a80
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.team.core.synchronize.SyncInfoSet;
+
+/**
+ * This class represents provisional API. A provider is not required to
+ * implement this API. Implementers, and those who reference it, do so with the
+ * awareness that this class may be removed or substantially changed at future
+ * times without warning.
+ */
+public interface ISynchronizeModelProvider {
+
+ public abstract SyncInfoSet getSyncInfoSet();
+
+ /**
+ * Return the <code>AbstractTreeViewer</code> asociated with this content
+ * provider or <code>null</code> if the viewer is not of the proper type.
+ * @return
+ */
+ public abstract StructuredViewer getViewer();
+
+ public abstract void setViewer(StructuredViewer viewer);
+
+ /**
+ * Builds the viewer model based on the contents of the sync set.
+ */
+ public abstract SynchronizeModelElement prepareInput(IProgressMonitor monitor);
+
+ /**
+ * The provider can try and return a mapping for the provided object. Providers often use mappings
+ * to store the source of a logical element they have created. For example, when displaying resource
+ * based logical elements, a provider will cache the resource -> element mapping for quick retrieval
+ * of the element when resource based changes are made.
+ *
+ * @param object the object to query for a mapping
+ * @return an object created by this provider that would be shown in a viewer, or <code>null</code>
+ * if the provided object is not mapped by this provider.
+ */
+ public abstract Object getMapping(Object object);
+
+ /**
+ * Dispose of the builder
+ */
+ public abstract void dispose();
+
+ /**
+ * Returns the input created by this controller or <code>null</code> if
+ * {@link #prepareInput(IProgressMonitor)} hasn't been called on this object yet.
+ * @return
+ */
+ public abstract SynchronizeModelElement 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 1ac0f965b..c827836ac 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,21 +10,12 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
+import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-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.action.*;
import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.widgets.Control;
@@ -34,6 +25,7 @@ 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.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
@@ -74,14 +66,21 @@ import org.eclipse.ui.model.BaseWorkbenchContentProvider;
* @since 3.0
*/
public abstract class StructuredViewerAdvisor {
-
- private SynchronizeModelProvider modelProvider;
- private ListenerList listeners;
- private String targetID;
+
+ // Workbench site is used to register the context menu for the viewer
private IWorkbenchPartSite site;
+ // The id to use for registration of the context menu. If null then menu will not allow viewer contributions.
+ private String targetID;
+ // The physical model shown to the user in the provided viewer. The information in
+ // this set is transformed by the model provider into the actual logical model displayed
+ // in the viewer.
private SyncInfoSet set;
private StructuredViewer viewer;
+ private SynchronizeModelProvider modelProvider;
+
+ // Listeners for model changes
+ private ListenerList listeners;
/**
* Create an advisor that will allow viewer contributions with the given <code>targetID</code>. This
@@ -200,6 +199,26 @@ public abstract class StructuredViewerAdvisor {
public abstract boolean navigate(boolean next);
/**
+ * Sets a new selection for this viewer and optionally makes it visible. The advisor will try and
+ * convert the objects into the appropriate viewer objects. This is required because the model
+ * provider controls the actual model elements in the viewer and must be consulted in order to
+ * understand what objects can be selected in the viewer.
+ *
+ * @param object the objects to select
+ * @param reveal <code>true</code> if the selection is to be made visible, and
+ * <code>false</code> otherwise
+ */
+ public void setSelection(Object[] objects, boolean reveal) {
+ Object[] viewerObjects = new Object[objects.length];
+ if (modelProvider != null) {
+ for (int i = 0; i < objects.length; i++) {
+ viewerObjects[i] = modelProvider.getMapping(objects[i]);
+ }
+ viewer.setSelection(new StructuredSelection(viewerObjects), reveal);
+ }
+ }
+
+ /**
* Creates the model that will be shown in the viewers. This can be called before the
* viewer has been created.
* <p>
@@ -385,7 +404,7 @@ public abstract class StructuredViewerAdvisor {
if (ws != null) {
ws.registerContextMenu(getTargetID(), menuMgr, viewer);
} else {
- TeamUIPlugin.log(IStatus.ERROR, "Cannot add menu contributions because the site cannot be found: " + getTargetID(), null);
+ TeamUIPlugin.log(IStatus.ERROR, "Cannot add menu contributions because the site cannot be found: " + getTargetID(), null); //$NON-NLS-1$
}
}
}
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 2cea55b65..e3c9c9f29 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
@@ -12,38 +12,21 @@ package org.eclipse.team.ui.synchronize.viewers;
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.IContentChangeListener;
-import org.eclipse.compare.IContentChangeNotifier;
-import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.*;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
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.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
import org.eclipse.team.ui.ISharedImages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.*;
import org.eclipse.ui.progress.UIJob;
/**
@@ -85,8 +68,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(CompareConfiguration cc, String description, SyncInfo sync) {
- super(cc);
+ public SyncInfoCompareInput(String description, SyncInfo sync) {
+ super(getDefaultCompareConfiguration());
Assert.isNotNull(sync);
Assert.isNotNull(description);
this.description = description;
@@ -96,6 +79,12 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
initializeResourceChangeListeners();
}
+ private static CompareConfiguration getDefaultCompareConfiguration() {
+ CompareConfiguration cc = new CompareConfiguration();
+ //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, true);
+ return cc;
+ }
+
private void initializeContentChangeListeners() {
ITypedElement te = node.getLeft();
if (te instanceof IContentChangeNotifier) {
@@ -120,7 +109,7 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
IResourceDelta resourceDelta = delta.findMember(resource.getFullPath());
if (resourceDelta != null) {
if (editor != null && editor instanceof IReusableEditor) {
- UIJob job = new UIJob("") {
+ UIJob job = new UIJob("") { //$NON-NLS-1$
public IStatus runInUIThread(IProgressMonitor monitor) {
node.update(node.getSyncInfo());
return Status.OK_STATUS;
@@ -133,6 +122,16 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
}
}
+ /**
+ * We have to hook into the editors lifecycle in order to register/un-register resource
+ * change listeners. CompareEditorInputs aren't aware of the lifecycle of its containing
+ * editor
+ * <p>
+ * The side effect of not calling this method is that the input will not keep in sync with changes
+ * to the workspace resource.
+ * </p>
+ * @param editor the editor showing this input
+ */
public void setCompareEditor(IEditorPart editor) {
Assert.isNotNull(editor);
this.editor = editor;
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/ui/synchronize/viewers/SyncInfoModelElement.java
index 3763b09b1..3189f9f6b 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/ui/synchronize/viewers/SyncInfoModelElement.java
@@ -16,8 +16,8 @@ import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.synchronize.*;
-import org.eclipse.team.core.variants.*;
+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;
@@ -30,12 +30,8 @@ import org.eclipse.team.internal.ui.synchronize.RemoteResourceTypedElement;
* display the compare result in a <code>DiffTreeViewer</code> and as the
* input to any other compare/merge viewer.
* <p>
- * You can access the {@link SyncInfoSet} this node was created from for quick access
- * to the underlying sync state model.
- * </p>
- * <p>
- * TODO: mention node builders and syncinfocompareinput and syncinfodifftree viewer
* Clients typically use this class as is, but may subclass if required.
+ * </p>
* @see DiffTreeViewer
* @see Differencer
*/
@@ -45,29 +41,46 @@ public class SyncInfoModelElement extends SynchronizeModelElement {
private SyncInfo info;
/**
- * Construct a <code>SyncInfoModelElement</code> for the given resource. The {@link SyncInfoSet}
- * that contains sync states for this resource must also be provided. This set is used
- * to access the underlying sync state model that is the basis for this node this helps for
- * providing quick access to the logical containment
+ * Construct a <code>SyncInfoModelElement</code> for the given resource.
*
* @param set The set associated with the diff tree veiwer
* @param resource The resource for the node
*/
public SyncInfoModelElement(IDiffContainer parent, SyncInfo info) {
super(parent);
- update(info);
- }
-
- public void update(SyncInfo info) {
this.info = info;
// update state
setKind(info.getKind());
// local
setLeft(createLocalTypeElement(info));
// remote
- setRight(createRemoteTypeElement(info));
+ setRight(createRemoteTypeElement(info));
// base
setAncestor(createBaseTypeElement(info));
+
+ fireChange();
+ }
+
+ public void update(SyncInfo info) {
+ this.info = info;
+ // update state
+ setKind(info.getKind());
+ // never have to update the local, it's always the workspace resource
+ // remote
+ RemoteResourceTypedElement rightEl = (RemoteResourceTypedElement)getRight();
+ if(rightEl == null && info.getRemote() != null) {
+ setRight(createRemoteTypeElement(info));
+ } else if(rightEl != null){
+ rightEl.update(info.getRemote());
+ }
+ // base
+ RemoteResourceTypedElement ancestorEl = (RemoteResourceTypedElement)getRight();
+ if(ancestorEl == null && info.getBase() != null) {
+ setAncestor(createBaseTypeElement(info));
+ } else if(ancestorEl != null){
+ ancestorEl.update(info.getBase());
+ }
+
fireChange();
}
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 0486ce71f..b3d6fb782 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,29 +12,25 @@ package org.eclipse.team.ui.synchronize.viewers;
import java.lang.reflect.InvocationTargetException;
-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.*;
+import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.internal.INavigatable;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
-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.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
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.ui.ISharedImages;
+import org.eclipse.team.ui.TeamImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IProgressService;
@@ -48,12 +44,14 @@ import org.eclipse.ui.progress.IProgressService;
*
* @since 3.0
*/
-public class SynchronizeCompareInput extends CompareEditorInput {
+public class SynchronizeCompareInput extends CompareEditorInput implements IContentChangeListener {
private TreeViewerAdvisor diffViewerConfiguration;
private Viewer diffViewer;
private NavigationAction nextAction;
private NavigationAction previousAction;
+
+ private boolean buffered = false;
/**
* Create a <code>SynchronizeCompareInput</code> whose diff viewer is configured
@@ -70,6 +68,12 @@ public class SynchronizeCompareInput extends CompareEditorInput {
this.diffViewer = internalCreateDiffViewer(parent, getViewerConfiguration());
diffViewer.getControl().setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());
+ // buffered merge mode, don't ask for save when switching nodes since contents will be buffered in diff nodes
+ // and saved when the input is saved.
+ if(isBuffered()) {
+ getCompareConfiguration().setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, new Boolean(false));
+ }
+
/*
* This viewer can participate in navigation support in compare editor inputs. Note that
* it is currently accessing an internal compare interface that should be made public. See
@@ -87,9 +91,9 @@ public class SynchronizeCompareInput extends CompareEditorInput {
nextAction.setCompareEditorInput(this);
previousAction.setCompareEditorInput(this);
-
initializeToolBar(diffViewer.getControl().getParent());
initializeDiffViewer(diffViewer);
+ diffViewerConfiguration.navigate(true);
return diffViewer;
}
@@ -139,6 +143,7 @@ public class SynchronizeCompareInput extends CompareEditorInput {
IProgressService manager = PlatformUI.getWorkbench().getProgressService();
try {
node.cacheContents(new NullProgressMonitor());
+ hookContentChangeListener(node);
} catch (TeamException e) {
Utils.handle(e);
} finally {
@@ -153,6 +158,17 @@ public class SynchronizeCompareInput extends CompareEditorInput {
}
}
+ private void hookContentChangeListener(DiffNode node) {
+ ITypedElement left = node.getLeft();
+ if(left instanceof IContentChangeNotifier) {
+ ((IContentChangeNotifier)left).addContentChangeListener(this);
+ }
+ ITypedElement right = node.getRight();
+ if(right instanceof IContentChangeNotifier) {
+ ((IContentChangeNotifier)right).addContentChangeListener(this);
+ }
+ }
+
public void contributeToToolBar(ToolBarManager tbm) {
if(nextAction != null && previousAction != null) {
tbm.appendToGroup("navigation", nextAction); //$NON-NLS-1$
@@ -193,4 +209,68 @@ public class SynchronizeCompareInput extends CompareEditorInput {
throw new InvocationTargetException(e);
}
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see CompareEditorInput#saveChanges(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void saveChanges(IProgressMonitor pm) throws CoreException {
+ super.saveChanges(pm);
+ SynchronizeModelElement root = (SynchronizeModelElement)diffViewerConfiguration.getViewer().getInput();
+ if (root != null) {
+ try {
+ commit(pm, root);
+ } finally {
+ setDirty(false);
+ }
+ }
+ }
+
+ private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
+ ITypedElement left = node.getLeft();
+ if (left instanceof LocalResourceTypedElement)
+ ((LocalResourceTypedElement) left).commit(pm);
+
+ ITypedElement right = node.getRight();
+ if (right instanceof LocalResourceTypedElement)
+ ((LocalResourceTypedElement) right).commit(pm);
+
+ //node.getC
+ IDiffElement[] children = (IDiffElement[])node.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ commit(pm, (DiffNode)children[i]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.IContentChangeListener#contentChanged(org.eclipse.compare.IContentChangeNotifier)
+ */
+ public void contentChanged(IContentChangeNotifier source) {
+ try {
+ if (isBuffered()) {
+ setDirty(true);
+ } else if (source instanceof DiffNode) {
+ commit(new NullProgressMonitor(), (DiffNode) source);
+ } else if (source instanceof LocalResourceTypedElement) {
+ ((LocalResourceTypedElement) source).commit(new NullProgressMonitor());
+ }
+ } catch (CoreException e) {
+ Utils.handle(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return TeamImages.getImageDescriptor(ISharedImages.IMG_COMPARE_VIEW);
+ }
+
+ /**
+ * Returns <code>true</code> if this compare input will buffer node content changes until the input is saved,
+ * otherwise content changes are saved to disk immediatly when each node is saved in the content merge viewer.
+ */
+ public boolean isBuffered() {
+ return buffered;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeDialog.java
new file mode 100644
index 000000000..5e291e6b0
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeDialog.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * 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.CompareEditorInput;
+import org.eclipse.compare.internal.ResizableDialog;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.*;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.util.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.*;
+
+/**
+ * A dialog that displays a synchronize participant. There are some cases when it
+ * is more appropriate to display synchronization information in a dialog instead of
+ * in the Synchronize View. This class provides a modal context in which to show
+ * this.
+ * <p>
+ * To allow a user to transfer this synchronization state to the Synchronize View simply
+ * set the participant.
+ * </p><p>
+ * The dialog tracks changes made in the content merge viewers, displays a change
+ * indication and will ensure that changes are saved when the dialog is closed.
+ * </p><p>
+ * Buffered or un-buffered compare editor inputs are supported.
+ * </p>
+ * @see SynchronizeCompareInput
+ * @since 3.0
+ */
+public class SynchronizeDialog extends ResizableDialog implements IPropertyChangeListener {
+
+ private CompareEditorInput fCompareEditorInput;
+ private ISynchronizeParticipant participant;
+ private Button saveButton;
+ private Button rememberParticipantButton;
+ private String title;
+ private boolean isDirty = false;
+
+ /**
+ * Creates a dialog with the given title and input. The input is not created until the dialog
+ * is opened.
+ *
+ * @param shell the parent shell or <code>null</code> to create a top level shell.
+ * @param title the shell's title
+ * @param input the compare input to show in the dialog
+ */
+ public SynchronizeDialog(Shell shell, String title, CompareEditorInput input) {
+ super(shell, null);
+ this.title = title;
+ Assert.isNotNull(input);
+ fCompareEditorInput= input;
+ fCompareEditorInput.addPropertyChangeListener(this);
+ }
+
+ public void setSynchronizeParticipant(ISynchronizeParticipant participant) {
+ this.participant = participant;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on Dialog.
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ /* (non-Javadoc)
+ * Method declared on Dialog.
+ */
+ protected Control createDialogArea(Composite parent2) {
+ Composite parent = (Composite) super.createDialogArea(parent2);
+ Control c = fCompareEditorInput.createContents(parent);
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ if (participant != null) {
+ rememberParticipantButton = new Button(parent, SWT.CHECK);
+ rememberParticipantButton.setText(Policy.bind("ParticipantCompareDialog.1")); //$NON-NLS-1$
+ }
+ Shell shell = c.getShell();
+ shell.setText(title);
+ shell.setImage(fCompareEditorInput.getTitleImage());
+ Dialog.applyDialogFont(parent2);
+ return parent;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
+ protected void buttonPressed(int buttonId) {
+ if (fCompareEditorInput.isSaveNeeded() && MessageDialog.openConfirm(getShell(), Policy.bind("ParticipantCompareDialog.2"), Policy.bind("ParticipantCompareDialog.3"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+ try {
+ fCompareEditorInput.saveChanges(new NullProgressMonitor());
+ } catch (CoreException e) {
+ Utils.handle(e);
+ }
+ }
+ });
+ }
+ if(buttonId == IDialogConstants.OK_ID && isRememberParticipant()) {
+ rememberParticipant();
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ protected boolean isRememberParticipant() {
+ return getParticipant() != null && rememberParticipantButton != null && rememberParticipantButton.getSelection();
+ }
+
+ protected void rememberParticipant() {
+ if(getParticipant() != null) {
+ ISynchronizeManager mgr = TeamUI.getSynchronizeManager();
+ ISynchronizeView view = mgr.showSynchronizeViewInActivePage();
+ mgr.addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
+ view.display(participant);
+ }
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ if (fCompareEditorInput != null) {
+ if(fCompareEditorInput.isSaveNeeded()) {
+ // the dirty flag is required because there is a compare bug that causes the dirty bit to be reset sometimes
+ // although the underlying compare editor input is still dirty.
+ isDirty = true;
+ getShell().setText(title + " *"); //$NON-NLS-1$
+ } else {
+ getShell().setText(title);
+ }
+ }
+ }
+
+ protected Object getParticipant() {
+ return participant;
+ }
+
+ protected CompareEditorInput getCompareEditorInput() {
+ return fCompareEditorInput;
+ }
+} \ No newline at end of file
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 eba4fbc78..db098cf29 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
@@ -14,23 +14,12 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfoTree;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
@@ -172,7 +161,6 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor implements IPrope
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#getDiffNodeController()
*/
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
index 2d4d6421d..56a4e8b8f 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
@@ -17,8 +17,8 @@ import junit.framework.Test;
import org.eclipse.core.resources.*;
import org.eclipse.team.core.synchronize.SyncInfoTree;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider;
-import org.eclipse.team.ui.synchronize.viewers.CompressedFoldersModelProvider;
+import org.eclipse.team.internal.ui.synchronize.CompressedFoldersModelProvider;
+import org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider;
/**
* Tests for the SyncInfoSet content providers.
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 f05562b70..d881e83df 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
@@ -22,6 +22,7 @@ import org.eclipse.swt.widgets.Item;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.tests.core.TeamTest;
import org.eclipse.team.tests.ui.views.ContentProviderTestView;
import org.eclipse.team.tests.ui.views.TestTreeViewer;
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00008.html b/tests/org.eclipse.team.tests.cvs.core/html/00008.html
index da57e72b0..6a7d80430 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00008.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00008.html
@@ -4,6 +4,6 @@
<meta NAME="since" content="">
</head><body><h2>Comparing</h2>
-Answer comes here.
+The CVS plugin supports comparing of resources in the workspace with revision in the repository. You can also compare between two remote elements.
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00039.html b/tests/org.eclipse.team.tests.cvs.core/html/00039.html
index b9035d03f..455428b7a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00039.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00039.html
@@ -1,10 +1,10 @@
-<html><head><title>Local resources with a repository</title>
+<html><head><title>Compare with another branch or version</title>
<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
<meta NAME="keywords" content="">
<meta NAME="since" content="">
-</head><h2>Local resources with a repository</h2>
+</head><h2>Compare with another branch or version</h2>
<p>Since: M8<br>
-Last Modified: $Date: 2003/11/27 22:04:58 $</p><body>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
<p>
You should be able to select a project/folder/resource and compare againts
another branch or version. Multi-select should work across projects in
@@ -13,16 +13,27 @@ merge changes into the local workspace.</p>
<p>
We should support multi-selection of files, but I'm not sure what should be
shown to the user in those cases.</p>
-<h3>Comparing with another branch or version</h3>
+<h3>On file selected</h3>
<ul>
-<li>
-</ul>
-<h3>Multi-select files</h3>
-<ul>
-<li>
+<li>If the file has differences open a compare editor and show otherwise a message is shown to indicate that the file is the same.
+<li>should be able to open the history view and link in to the opened compare editor
+<li>the compare editor should update when changes are made to the local file in some other context (e.g other editor, refactoring).
</ul>
+
+<h3>Multiple selection</h3>
+<p>Entire contents of the folder are compared deep. If changes are found the user is notified and they are
+shown in a dialog. If no changes are found the user is notified. The dialog should allow the user to browse
+the changes and merge anything into his workspace. If the user wants to keep the comparison non-model, he
+can add it to the synchronize view. There is a button to do so on the compare dialog.</p>
+
<h3>Merging changes</h3>
+<p>
+When the compare dialog is showing several changes you should be able to selectively merge anything into the local workspace. Specific attention should
+be made to the following cases:
+</p>
<ul>
-<li>
+<li>Edit the local then press ok. You should be prompted to save the changes and the changes should be correctly updated in the corresponding resource.
+<li>Edit the local and browse to another file. You should be prompted to save the changes.
+<li>Press the cancel button with changes, you should be prompted.
</ul>
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00040.html b/tests/org.eclipse.team.tests.cvs.core/html/00040.html
index 64163316f..88a49f905 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00040.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00040.html
@@ -3,9 +3,9 @@
<meta NAME="keywords" content="">
<meta NAME="since" content="">
</head><h2>Reverting deleted resources</h2>
-<p>Since: <br>
-Last Modified: $Date: 2003/11/27 22:04:58 $</p><body>
+<p>Since: M8<br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
-Answer comes here.
+You should be able to restore a deleted revision from the CVS server.
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00041.html b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
new file mode 100644
index 000000000..1b01a511a
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
@@ -0,0 +1,16 @@
+<html><head><title>File Revisions</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>File Revisions</h2>
+<p>Since: M8<br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+<h3>Compare the local resource with other revisions</h3>
+<ul>
+<li>If the file isn't managed the action should no appear.
+<li>If the file doesn't have any revisions you should be prompted
+<li>If the file has revisions you should be prompted with the list of revisions in a compare dialog
+<li>In the compare dialog you can select any revision and mreges changes into the local copy
+<li>If you edit the local resource then chose OK, you will be prompted to save changes. Ensure that the changes are saved correctly to the underlying resource.
+<li>Ensure that the titles are ok (e.g. dialog title, structure pane title...) \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00042.html b/tests/org.eclipse.team.tests.cvs.core/html/00042.html
new file mode 100644
index 000000000..c975656b4
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00042.html
@@ -0,0 +1,11 @@
+<html><head><title>CVS Console</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>CVS Console</h2>
+<p>Since: <br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+Answer comes here.
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00043.html b/tests/org.eclipse.team.tests.cvs.core/html/00043.html
new file mode 100644
index 000000000..e618f1876
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00043.html
@@ -0,0 +1,14 @@
+<html><head><title>Preferences</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>Preferences</h2>
+<p>Since: M8<br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+There are a couple of preferences that controls the behavior and presentation of the console. These are:
+<ul>
+<li>font color: message color, error color, command line. Changing these should immediatly update the console view.
+</ul>
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00044.html b/tests/org.eclipse.team.tests.cvs.core/html/00044.html
new file mode 100644
index 000000000..b5362520f
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00044.html
@@ -0,0 +1,11 @@
+<html><head><title>Replacing</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>Replacing</h2>
+<p>Since: <br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+Answer comes here.
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00045.html b/tests/org.eclipse.team.tests.cvs.core/html/00045.html
new file mode 100644
index 000000000..33122972c
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00045.html
@@ -0,0 +1,11 @@
+<html><head><title>With latest</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>With latest</h2>
+<p>Since: <br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+Answer comes here.
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00046.html b/tests/org.eclipse.team.tests.cvs.core/html/00046.html
new file mode 100644
index 000000000..951e23110
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00046.html
@@ -0,0 +1,11 @@
+<html><head><title>With another branch of version</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>With another branch of version</h2>
+<p>Since: <br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+Answer comes here.
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00047.html b/tests/org.eclipse.team.tests.cvs.core/html/00047.html
new file mode 100644
index 000000000..7fbd26bf0
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00047.html
@@ -0,0 +1,20 @@
+<html><head><title>With file revision</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>With file revision</h2>
+<p>Since: <br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+<h3>Replace the local resource with other revisions</h3>
+<ul>
+<li>If the file isn't managed the action should no appear.
+<li>If the file doesn't have any revisions you should be prompted
+<li>If the file has revisions you should be prompted with the list of revisions in a compare dialog
+<li>In the compare dialog you can select any revision and mreges changes into the local copy
+<li>If you edit the local resource then chose OK, you will be prompted to save changes. Ensure that the changes are saved correctly to the underlying resource.
+<li>If a revision is selected the Replace button should be enabled. Otherwise it should be disabled
+<li>If you selected the replace button the file should contain the contents of the revision selected. The dialog will also close.
+<li>Ensure that the titles are ok (e.g. dialog title, structure pane title...)
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00048.html b/tests/org.eclipse.team.tests.cvs.core/html/00048.html
new file mode 100644
index 000000000..516f56fd2
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00048.html
@@ -0,0 +1,50 @@
+<html><head><title>Refreshing with Remote</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>Refreshing with Remote</h2>
+<p>Since: M8<br>
+Last Modified: $Date: 2004/03/05 17:12:22 $</p><body>
+
+
+<p>
+Synchronizing means ???
+</p>
+
+<h3>After a Synchronize has completed</h3>
+<p>Generally the sync view is shown AFTER the synchronize operation has completed. This way we don't interrupt the user's context. Why do
+people like to be prompted after? For some the synchronize operation can be very long, and they want to be told when they can view the
+results.</p>
+ <ul>
+ <li>1st time and no changes, then simply prompt that there are no changes.
+ <li>1st time and there are changes in the workspace, then prompt asking about perspective switch next enumerate the types of changes in the workspace, and open sync view.
+ <li>other times and no changes, then simply prompt.
+ <li>other times and changes, then prompt enumerating the types of changes in the workspace, and open sync view.
+ <li>other times and changes and option to not prompt, open sync view.
+ </ul>
+
+<p>
+There are a couple of reasons someone may want to synchronize with the remote. There are currently
+two ways of running the refresh operation:
+<ul>
+<li>Directly from the synchronize view
+<li>From Team > Synchronize with Repository
+</ul>
+</p>
+<h3>Notice a file is out-of-sync in another view (e.g. packages explorer, types) and want to see the changes</h3>
+<p>In case you can select a file, it will be refreshed with the server, and if changes are found the compare editor is opened
+that will allow browsing the changes. If no changes are found, you will be prompted.</p>
+
+<h3>From another view would like to browse the outgoing/incoming changes for several resources</h3>
+<p>Select a folder or group of files and Team > Synchronize will open the sync view and automatically refresh with
+the remote repository.</p>
+
+<h3>In the sync view and would like to refresh to see if there are new changes from the server</h3>
+<p>
+
+</p>
+
+Assumption, the sync view may or may not be open when the synchronize is performed. Maybe we need a different prompt
+each case. One for Team > Sync and another for refresh from the sync view.
+
+</body></html> \ No newline at end of file
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 bcdb06441..0277dff55 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
@@ -22,11 +22,14 @@ 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.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.*;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
/**
* SyncInfoSource that obtains SyncInfo from the SynchronizeView's SyncSet.
@@ -34,7 +37,12 @@ import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
public class SynchronizeViewTestAdapter extends SyncInfoSource {
public SynchronizeViewTestAdapter() {
- TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
+ IWorkbenchPage activePage = TeamUIPlugin.getActivePage();
+ try {
+ activePage.showView(ISynchronizeView.VIEW_ID);
+ } catch (PartInitException e) {
+ throw new AssertionFailedError("Cannot show sync view in active page");
+ }
}
public SyncInfo getSyncInfo(Subscriber subscriber, IResource resource) throws TeamException {
@@ -96,8 +104,13 @@ public class SynchronizeViewTestAdapter extends SyncInfoSource {
ISynchronizeParticipant participant = new MergeSynchronizeParticipant(mergeSubscriber);
synchronizeManager.addSynchronizeParticipants(
new ISynchronizeParticipant[] {participant});
- ISynchronizeView view = synchronizeManager.showSynchronizeViewInActivePage(null);
- view.display(participant);
+ IWorkbenchPage activePage = TeamUIPlugin.getActivePage();
+ try {
+ ISynchronizeView view = (ISynchronizeView)activePage.showView(ISynchronizeView.VIEW_ID);
+ view.display(participant);
+ } catch (PartInitException e) {
+ throw new AssertionFailedError("Cannot show sync view in active page");
+ }
return mergeSubscriber;
}
@@ -110,9 +123,14 @@ public class SynchronizeViewTestAdapter extends SyncInfoSource {
ISynchronizeManager synchronizeManager = TeamUI.getSynchronizeManager();
ISynchronizeParticipant participant = new CompareParticipant(s);
synchronizeManager.addSynchronizeParticipants(
- new ISynchronizeParticipant[] {participant});
- ISynchronizeView view = synchronizeManager.showSynchronizeViewInActivePage(null);
- view.display(participant);
+ new ISynchronizeParticipant[] {participant});
+ IWorkbenchPage activePage = TeamUIPlugin.getActivePage();
+ try {
+ ISynchronizeView view = (ISynchronizeView)activePage.showView(ISynchronizeView.VIEW_ID);
+ view.display(participant);
+ } catch (PartInitException e) {
+ throw new AssertionFailedError("Cannot show sync view in active page");
+ }
return s;
}
@@ -123,7 +141,7 @@ public class SynchronizeViewTestAdapter extends SyncInfoSource {
ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
for (int i = 0; i < participants.length; i++) {
ISynchronizeParticipant participant = participants[i];
- if(participant.getId().equals(CVSMergeSubscriber.QUALIFIED_NAME)) {
+ if(participant.getId().equals(CVSMergeSubscriber.ID)) {
TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/toc.xml b/tests/org.eclipse.team.tests.cvs.core/toc.xml
index 9ce6036d7..6dbd45ca4 100644
--- a/tests/org.eclipse.team.tests.cvs.core/toc.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/toc.xml
@@ -11,16 +11,20 @@
<topic label="Comparing" href="html/00008.html">
<topic label="Remote resources" href="html/00009.html">
</topic>
- <topic label="Local resources with a repository" href="html/00039.html">
+ <topic label="Compare with another branch or version" href="html/00039.html">
</topic>
<topic label="Reverting deleted resources" href="html/00040.html">
</topic>
+ <topic label="File Revisions" href="html/00041.html">
+ </topic>
</topic>
<topic label="Synchronizing" href="html/00010.html">
<topic label="Sync View operations and selection" href="html/00011.html">
</topic>
<topic label="Sync View modes and working sets" href="html/00016.html">
</topic>
+ <topic label="Refreshing with Remote" href="html/00048.html">
+ </topic>
</topic>
<topic label="Merging" href="html/00012.html">
<topic label="Sync View operations and selection" href="html/00013.html">
@@ -76,5 +80,17 @@
<topic label="Decorations in the Synchronize pages" href="html/00038.html">
</topic>
</topic>
+ <topic label="CVS Console" href="html/00042.html">
+ <topic label="Preferences" href="html/00043.html">
+ </topic>
+ </topic>
+ <topic label="Replacing" href="html/00044.html">
+ <topic label="With latest" href="html/00045.html">
+ </topic>
+ <topic label="With another branch of version" href="html/00046.html">
+ </topic>
+ <topic label="With file revision" href="html/00047.html">
+ </topic>
+ </topic>
</topic>
</toc>

Back to the top