Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-12 20:39:03 +0000
committerJean Michel-Lemieux2004-03-12 20:39:03 +0000
commit63374c3200e725bdae72759de3fb7b2e25ab17ed (patch)
tree5cbc5d6a0e82135a99d3f250aea913e9ee415d85 /bundles
parent7178a060534b68a62430a540b8459a7b202457c3 (diff)
downloadeclipse.platform.team-63374c3200e725bdae72759de3fb7b2e25ab17ed.tar.gz
eclipse.platform.team-63374c3200e725bdae72759de3fb7b2e25ab17ed.tar.xz
eclipse.platform.team-63374c3200e725bdae72759de3fb7b2e25ab17ed.zip
Adding changes for compare in dialog and global sync action.
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java36
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java41
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReconcileProjectOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java108
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java2
-rw-r--r--bundles/org.eclipse.team.ui/DESIGN.TXT93
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt173
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java)9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java)12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java111
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java11
-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/ui/TeamOperation.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/TeamOperation.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java339
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListenerFactory.java36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java95
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshCompleteDialog.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java)58
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshSubscriberJob.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java)42
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java62
-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.java32
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshWizard.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/SubscriberRefreshWizard.java)24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java20
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeDialog.java12
34 files changed, 726 insertions, 1019 deletions
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
index f36c5a974..190e50920 100644
--- 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
@@ -13,12 +13,16 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
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.team.core.subscribers.FilteredSyncInfoCollector;
+import org.eclipse.team.core.synchronize.*;
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.Policy;
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
@@ -27,15 +31,37 @@ import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
* @since 3.0
*/
public class CompareWithRemoteAction extends WorkspaceAction {
-
+
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
final IResource[] resources = getSelectedResources();
+ SyncInfoFilter contentComparison = new SyncInfoFilter() {
+ private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter();
+ public boolean select(SyncInfo info, IProgressMonitor monitor) {
+ // Want to select infos whose contents do not match
+ boolean different = !contentCompare.select(info, monitor);
+ if(different) {
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ if (resource.getFullPath().isPrefixOf(info.getLocal().getFullPath())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ };
+
// 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();
+ SyncInfoTree syncInfoSet = new SyncInfoTree();
+
+ FilteredSyncInfoCollector collector = new FilteredSyncInfoCollector(
+ participant.getSubscriberSyncInfoCollector().getSubscriberSyncInfoSet(),
+ syncInfoSet,
+ contentComparison);
+ collector.start(new NullProgressMonitor());
+ participant.refresh(resources, participant.getRefreshListeners().createModalDialogListener(participant.getId(), participant, syncInfoSet), Policy.bind("Participant.comparing"), null);
}
/*
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 3dfd3c3e8..cc6f9ef36 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
@@ -17,9 +17,9 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
public class CompareWithTagAction extends WorkspaceAction {
@@ -32,8 +32,10 @@ public class CompareWithTagAction extends WorkspaceAction {
// Run the comparison
CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag);
CompareParticipant participant = new CompareParticipant(s);
- SubscriberParticipantDialog openCompare = new SubscriberParticipantDialog(getShell(), CVSCompareSubscriber.ID_MODAL, participant, resources);
- openCompare.run();
+ participant.refresh(resources,
+ participant.getRefreshListeners().createModalDialogListener(CVSCompareSubscriber.ID_MODAL, participant, participant.getSubscriberSyncInfoCollector().getSyncInfoTree()),
+ Policy.bind("Participant.comparing"), //$NON-NLS-1$
+ null);
}
protected CVSTag promptForTag(IResource[] resources) {
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 0e5688de6..6bf107d27 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
@@ -14,13 +14,15 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
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.
+ * Action to initiate a CVS workspace synchronize
*/
public class SyncAction extends WorkspaceAction {
@@ -30,7 +32,9 @@ public class SyncAction extends WorkspaceAction {
WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
if(participant != null) {
- participant.refresh(resources);
+ IWizard wizard = participant.createSynchronizeWizard();
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.open();
}
}
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 f6a553be7..df8ddb41b 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,22 +11,16 @@
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.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantDialog;
+import org.eclipse.team.ui.synchronize.subscriber.IRefreshSubscriberListener;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeDialog;
import org.eclipse.ui.*;
public class MergeWizard extends Wizard {
@@ -68,36 +62,9 @@ public class MergeWizard extends Wizard {
MergeSynchronizeParticipant participant = (MergeSynchronizeParticipant)SubscriberParticipant.find(s);
if(participant == null) {
participant = new MergeSynchronizeParticipant(s);
- }
-
- 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();
+ }
+ IRefreshSubscriberListener listener = participant.getRefreshListeners().createModalDialogListener(CVSMergeSubscriber.ID_MODAL, participant, participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
+ participant.refresh(s.roots(), listener, Policy.bind("Participant.merging"), null); //$NON-NLS-1$
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 660e25e87..0f5612bf7 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
@@ -1071,3 +1071,6 @@ CompareRevertAction.0=Reverting {0} resources
FileModificationValidator.3=Perform Edit?
FileModificationValidator.4=A CVS edit notification is required to be sent to the server in order to allow editing of one or more selected files. Continue?
CVSSynchronizeViewPage.0=Show incoming grouped by comment
+Participant.comparing=Comparing
+Participant.merging=Merging
+Participant.synchronizing=Synchronizing
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
index 3e0f522cd..748c06c7e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
@@ -22,7 +22,7 @@ import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.util.Assert;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.ui.synchronize.subscriber.TeamOperation;
+import org.eclipse.team.ui.TeamOperation;
import org.eclipse.ui.IWorkbenchPart;
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 c7f8f7e29..b1c03eb99 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
@@ -54,7 +54,7 @@ public class ReconcileProjectOperation extends CVSOperation {
public void run() {
WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
if(participant != null) {
- participant.refresh(new IResource[] {project});
+ participant.refresh(new IResource[] {project}, participant.getRefreshListeners().createSynchronizeViewListener(participant), Policy.bind("Participant.synchronizing"), null); //$NON-NLS-1$
}
}
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
deleted file mode 100644
index 70304c78a..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
+++ /dev/null
@@ -1,108 +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.ccvs.ui.subscriber;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
-import org.eclipse.team.core.synchronize.*;
-import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.ui.synchronize.subscriber.RefreshAction;
-import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
-
-/**
- * Provides compare specific support
- */
-public class CVSLocalCompareConfiguration extends TreeViewerAdvisor {
-
- private CVSCompareSubscriber subscriber;
- private SubscriberSyncInfoCollector collector;
- private RefreshAction refreshAction;
- private RefreshAction refreshAllAction;
-
- /**
- * Return a <code>SyncInfoSetCompareConfiguration</code> that can be used in a
- * <code>SynchronizeCompareInput</code> to show the comparsion between the local
- * workspace resources and their tagged counterparts on the server.
- * @param resources the resources to be compared
- * @param tag the tag to be compared with
- * @return a configuration for a <code>SynchronizeCompareInput</code>
- */
- public static CVSLocalCompareConfiguration create(IResource[] resources, CVSTag tag) {
- CVSCompareSubscriber subscriber = new CVSCompareSubscriber(resources, tag);
- SubscriberSyncInfoCollector collector = new SubscriberSyncInfoCollector(subscriber);
- collector.setFilter(new SyncInfoFilter() {
- private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter();
- public boolean select(SyncInfo info, IProgressMonitor monitor) {
- if (info.getLocal().getType() == IResource.FILE) {
- // Want to select infos whose contents do not match
- return !contentCompare.select(info, monitor);
- } else {
- return true;
- }
- }
- });
- collector.start();
- return new CVSLocalCompareConfiguration(subscriber, collector);
- }
-
- private CVSLocalCompareConfiguration(CVSCompareSubscriber subscriber, SubscriberSyncInfoCollector collector) {
- super("org.eclipse.team.cvs.ui.compare-participant", null, collector.getSyncInfoTree()); //$NON-NLS-1$
- this.subscriber = subscriber;
- this.collector = collector;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#dispose()
- */
- public void dispose() {
- collector.dispose();
- subscriber.dispose();
- super.dispose();
- }
-
- public Object prepareInput(IProgressMonitor monitor) throws TeamException {
- subscriber.refresh(subscriber.roots(), IResource.DEPTH_INFINITE, monitor);
- collector.waitForCollector(monitor);
- return super.prepareInput(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#fillContextMenu(org.eclipse.jface.viewers.StructuredViewer, org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
- manager.add(refreshAction);
- manager.add(new Separator());
- super.fillContextMenu(viewer, manager);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.TreeViewerAdvisor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- public void contributeToToolBar(IToolBarManager tbm) {
- tbm.add(refreshAllAction);
- }
-
- protected void initializeActions(StructuredViewer viewer) {
- super.initializeActions(viewer);
- refreshAction = new RefreshAction(viewer, ((CVSSyncTreeSubscriber)collector.getSubscriber()).getName(), collector, null /* no listener */, false);
- refreshAllAction = new RefreshAction(viewer, ((CVSSyncTreeSubscriber)collector.getSubscriber()).getName(), collector, null /* no listener */, true);
- }
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#getSyncSet()
- */
- public SyncInfoTree getSyncInfoTree() {
- return collector.getSyncInfoTree();
- }
-}
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 32e0a0688..5d60cd05d 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
@@ -289,7 +289,7 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
}
WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
if(participant != null) {
- participant.refresh(new IResource[] {project});
+ participant.refresh(new IResource[] {project}, participant.getRefreshListeners().createSynchronizeViewListener(participant), Policy.bind("Participant.synchronizing"), null);
}
}
} catch (InterruptedException e) {
diff --git a/bundles/org.eclipse.team.ui/DESIGN.TXT b/bundles/org.eclipse.team.ui/DESIGN.TXT
deleted file mode 100644
index 91dffbe4a..000000000
--- a/bundles/org.eclipse.team.ui/DESIGN.TXT
+++ /dev/null
@@ -1,93 +0,0 @@
-
-======================
- core
-======================
-SyncInfo
-- represents relative sync of local and remote gives access to resources
-
-TeamSubscriber
-- creates sync infos
-
-SyncInfoSet/MutableSyncInfoSet (optimized collection of sync infos - immutable)
-
-SyncInfoFilter (filtering of sync sets used by actions and creation of sync sets)
-
-SyncInfoCollector (collects sync infos from subscriber, and optionally from workspace. Uses background thread to collect and calculate changes. Is updated automatically with changes)
-
-FilteredSyncInfoSet (filters a provided sync info set with a given filter and possible roots)
-
-======================
- ui
-======================
-
-ISynchronizeManager (manages the lifesycle of synchronize participants)
-
-ISynchronizeView
-
-ISynchronizeParticipant (shows in the sync view, has a mode, working set, and creates a page with the UI pieces)
-
-Modes in sync view (DirectionFilterActionGroup)
-
-SyncInfoSetCompareConfiguration (encapsulates navigation, menus, content, label providers)this
- is used to configure a viewer in different ways based on it's use.
-
-SyncInfoDiffTreeViewer/SyncInfoDiffCheckboxViewer (shows diff nodes)
-
-SyncInfoDiffNode -> DiffNode
-
-SyncInfoSetCompareInput
-
-
-
-DiffNode
-SyncInfoDiffNode
-
-Viewer
-ContentProvider
-Sorter
-LabelProvider
-ViewerInput
-
-1. sync set is created
-2. decide how to model the sync set (hierachy, compressed, change log...) sorter...
-3. hook up chagnen listener
-4. ensure model doesn't change while building it?
-5. update model dynamically
-6. dispose of listener when input changes
-
-SuperCharged MVC
-================
-
-Sync Set Compare Input (displays a diff tree viewer with the compare panes)
-
-Sync Info Compare Input (displays a compare pane for one sync info)
-
-Viewer (viewers) -> view configurators (menus, content provider, label provider, controller)
-
-Viewer Model (diff nodes) logical structure of sync info
-
-Viewer Input (creates viewer model, keeps it up-to-date, sorter)
-
-Data (sync info, sync info set)
-
-1. when does the viewer model get created, it is implementation dependant
-2. why is creating the viewer model takes a while.
-
-How is progress shown?
-======================
-
-1. actions that run jobs that affect a view's content should schedule in the view
- - object contributions, or delegates get this for free via SubscriberAction which
- has a schedule which will schedule via the associated IWorkbenchPart.
- - actions programatically added to a view should be initialized with the view part or view site
- so that it can run the job in the view's context.
- - this will get you (1) the view icon change hint, (2) the half-busy cursor
-2. jobs should provide meaningful progress shown in progress view
- - this will get you (1) a job listed in the progress support showing that something is happening
-3. if working on syncinfodiffnodes in the background you can mark the nodes as working as a hint
- to the UI to display them differently (e.g. should make this adapter specific)
- - this will get you (1) nodes in the sync view showing that they are being worked on
-4. Use progress groups in refresh to show remote refresh and sync calculation as one work item.
- - this will get you (1) one entry in the progress view for both the remote refresh and background
- processing of sync states. no more updating sync view message.
-
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
deleted file mode 100644
index 523df08b3..000000000
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ /dev/null
@@ -1,173 +0,0 @@
-======================================================================
- EXAMPLE TEAM UI API USAGES
-======================================================================
-1. embeding sync viewer in dialog/wizard
-2. added a new content provider (logical views of sync info changes)
-3. adding custom label decorations
-4. actions/menus
-5. fetching sync info set without instantiating a participant
-6. fetch and wait for the event collector to finish processing the changes
-7. showing in a diff viewer either a static model (doesn't update when changes occur) or dynamic
-
-======================================================================
- PR LIST (07-01-2004)
-======================================================================
-
-x P3 schedule support by participant.
- this requires changing the refresh jobs to accept scheduling different jobs. Essentially being able to have an
- ordered *queue of refreshes. Also, participant will need a schedule object to encapsulate the schedule logic.
-
-x P3 status message could be more precise instead of simply "Working". But to do this we need access to the job progress monitor
- and it isn't available API from the UI. (removed status in sync view, progress will be shown in the progress shell).
-
-x P1 end of refresh prompt should be a property change notice, and let the participant decide what to do!
-
-x P2 decide overview page contents and how it should be used
-
-x remove duplicated tree/table viewers classes. the orignial ones simply have the INavigable behavior.
-
-x P1 make changes section only be a pagebook. this would easily allow adding any number of composites to the page?
- should look at memory consuption and ensure that we are disposing properly!
-
-- compareeditorinput fetcheds remote content outside of a progress monitor
-
-x decorations for SyncInfoDiffElements (of which type.. project persistent property setting?)
-x labels for compare editors (text merge viewers and title for diff viewer)
-
-x generic navigate support for SyncInfoDiffTreeViewer, PRd compare for API support
-
-x readonly state for compare panes
-
-- progress support added when fetching (e.g. caching contents in ITypedElement). This will require compare to add some API.
-
-x INavigable in compare needs to be made API.
-
-- details dialog needs to create composites once then display them. Or only create once!!!!
-
-x sync set filtering creation must be more precise. For example you should be able to specify a root and a direction.
-
-x cvs update/commit action in sync view toolbar are not updating their state anymore :(
-
-x P3 mode switching at the end of a refresh to ensure that changes are shown if available
-
-x P2 need an event for adding roots to a subscriber to update the list shown
-
-x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
-
-- overiding outgoing/incoming doesn't show the changes in the commit dialog because the filter is only configured to show in one direction.
-
-======================================================================
- PR LIST (16-01-2004)
-======================================================================
-x progress monitoring in SyncSet.reset and such. there are many places where null progress monitors are passed along.
-- showing sync view in commit dialog is complicated because there is no easy way of finding out exactly which resources will be committed at the
- point the commit comment dialog is shown. Need to provide new API on the commit dialog for this.
-- convert details dialogs that show sync view into wizards, this allows more room to browse the changes. almost like the refactoring. Preview >> button instead of Next >>.
-x job status handler API or not??
-
-======================================================================
- PR LIST (26-01-2004)
-======================================================================
-x navigable APIs must be consolidated, sync view navigation
-x compare configuration review
-x logical view extensions [not going to do this in 3.0]
-x content provider should not assume diff nodes have associated resources
- - content provider input? Is it a diff node or sync set? diff node hack required for getting the
- compare editor input working.
-x viewer input as a diffnode with a sync set seems wrong?
-- share reconciling with existing (e.g. using compare contents to resolve)
-x comment grouping logical view
-- target migration
-
-======================================================================
- PR LIST (30-01-2004) MV
-======================================================================
-x actions in sync view all assume that selection will have a resource (e.g refresh action).
- - how would a refresh know what to select if a change comment node was selected, for example
- - could first attempt to obtain resource and, if that fails, visit children to obtain resources
- [jm] I think that actions will have to know about DiffNodes and we need the helper to
- get the list of children nodes.
- [jm] added Utils.getResources(Iselection) does all the logic for retreiving resources
-x sorter is related to input so may need to change when input does
- - there does not appear to be a clean way to change the sorter and input without causing two refreshes
-x SyncInfoSet##getOutOfSyncDescendants(IResource) is speced to include the resource itself if it is out-of-sync
- - this is a bit confusing as the name implies otherwise
- - should either consider a name change or a spec change
- [jm] I never understood why is was spec'd like that :) You can decide...
-x compare input requires root node to have children or diff viewer is not added
- - this is problematic when creating a wizard page that is dynamically populated
- - not sure if there's problems caused by returning true when there are no children
- [jm] I think this it's fine to have root nodes return true to hasChildren. I don't like
- compares subtle way of determining is the diff viewer should be shown, but in our case a
- root node can safely always have children.
-x several places require a resource
- - e.g. conflict propogation requires a resource but shouldn't (modified to work without a resource)
- x conflicts do not propogate in comment view [jm] fixed
- [jm] we have to change this assumption everywhere! Actions, label decorators... and such.
- [jm] does sync info diff node require a resource? currently it does. But I still don't like
- the SyncSet methods that take IResource.ROOT to return first level children.
-x there are times when the sync set changes but the input hasn't yet and the given input
- doesn't handle outgoing changes. For example, when changing from incoming to outgoing with
- the change log root, the change log root gets a reset from the sync set then the input
- is changed. this can cause an NPE. Must look into the ordering here.
- [mv] I think we have to make the statement that the content provider must handle all sync types
- in some fashion. I recall that we discussed the restriction that a sync diff root node must
- show all elements in it's sync set. Could the comment builder place all outgoing changes in
- an additional section. The user would never see this but it would fulfill the contract.
- [jm] yes, this is what i ended up doing.
- [mv] for efficiency, we should still try to couple the mode change with the content provider
- change so that the diff node tree is not built and displayed twice during a change
-- the test cases starve the subscriber event handler such that an event has additions and removals for the same resources
- - this causes failures in the diff tree builders
- - although less likely in UI, can still happen
- - need tests for these scenarios to ensure generated event is correct after addition and removal
-x there are several places in SyncInfoSet and in the DiffNodes where we must use the workspace root
- as the input resource to imply get all members? Maybe this should be cleaned up a bit.
-x SyncInfoSet must be cleaned up a lot, the API is vague and method names are not clear.
- x we need a way to ensure that the sync set does not change while we are building a diff tree
- x events are only fired from endInput(). It should work in both batching and non-batching mode
-x SyncInfoDiffNode doesn't have to return a resource or a syncinfo. By definition a diff node already has API
- for returning a sync kind getKind() and access to all three resources getRight(), getLeft(), getAncestor().
-
-======================================================================
- PR LIST (02-02-2004) MV
-======================================================================
-x sync view title says "Summary" when first opened
-- would like to show subscriber roots as compressed folders at root of sync view
- - sync set needs to have the concept of roots
-x How is a reset propogated through the sync set chain.
- - I'm concerned that this is adhoc at the moment. we need to make it explicit.
-x why must clearModelObjects go deep? Can't you just disconnect from the parent?
-
-======================================================================
- PR LIST (05-02-2004) MV
-======================================================================
-x I notice that SyncInfoDiffNode requires a resource (via assert) and sync info is only obtained from
-SyncInfoDiffNodes (in Util). This is problematic as now the diff tree cannot contain diff nodes that
-do not map to a resource but parent nodes that do. The selection determination for SubscriberAction
-needs to walk the diff node tree for this case.
-
-======================================================================
- PR LIST (05-02-2004) Jm
-======================================================================
-- cvs merge participant doesn't get view progress support because participant is added before
-viewer is created. But this should be solvable by ensuring that showInActivePerspective forces
-viewer creation in a sync exec.
-
-==============================
-x initialize case doesn't work because main page is shown as empty but mode is correct
-x how do we handle changes to sync: re-create new nodes or update the nodes with new sync kind?
-x new projects don't show up?
-- how does our APIs support moves/renames? Do we need another sync state?
-
-=====
-x status line doesn't show?
-- there's a bunch of non-NLSd strings?
-- performance scalability with large sets
-- initialization feedback when set is populating?
-- scenarios/user doc
- - most sync state stuff must be tested by automated tests
- - progress should have scenarios (expected feedback, init case)
- - errors
-- resource filtering as seen in Refreshcompletedialog is very ineficient
-- can you call start on the collector multiple times? \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 78affbe5e..a74af6921 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -230,6 +230,7 @@
icon="icons/full/cview16/synch_synch.gif"
class="org.eclipse.team.internal.ui.synchronize.actions.GlobalRefreshAction"
toolbarPath="Normal/Team"
+ tooltip="%Command.syncAll.name"
id="org.eclipse.team.ui.synchronizeAll">
</action>
</actionSet>
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 1a942e1c2..61ebefdb7 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
@@ -465,8 +465,7 @@ public class Utils {
if (site != null) {
IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService) site.getAdapter(IWorkbenchSiteProgressService.class);
if (siteProgress != null) {
- siteProgress.useHalfBusyCursor(job);
- siteProgress.schedule(job);
+ siteProgress.schedule(job, 0, true /* use half-busy cursor */);
return;
}
}
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 d70efa8ab..9ff439c43 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
@@ -300,6 +300,7 @@ SyncViewerPreferencePage.15=Perspective Switching
RefreshSubscriberInputJob.1=Synchronizing ''{0}'' with remote: {1} resources
RefreshSubscriberJob.1=Team refresh {0} folders for {1}
RefreshSubscriberJob.0=An error occured while synchronizing with remote contents.
+RefreshSubscriberJob.2=Synchronizing {1}
CopyAction.title=&Copy
CopyAction.toolTip=Copy
@@ -343,6 +344,7 @@ Utils.25=Conflicting
Utils.26=unknown mode
RefreshCompleteDialog.4=Team Resfresh Complete - {0}
RefreshCompleteDialog.5=Synchronize has completed and you have changes to synchronize. {0} currently has {1} outgoing, {2} incoming, and {3} conflicting changes.
+RefreshCompleteDialog.5a=Synchronize has completed and found {0} new changes. {1} currently has {2} outgoing, {3} incoming, and {4} conflicting changes.
RefreshCompleteDialog.6=No changes to synchronize.
RefreshCompleteDialog.17=Details >>
RefreshCompleteDialog.18=<< Details
@@ -391,3 +393,6 @@ 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}
+Participant.comparing=Comparing
+Participant.merging=Merging
+Participant.synchronizing=Synchronizing
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
index d5a3d1723..4fd79b309 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshChangeListener.java
@@ -1,16 +1,17 @@
-package org.eclipse.team.internal.ui.jobs;
+package org.eclipse.team.internal.ui.synchronize;
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.synchronize.SyncInfoSet;
-class RefreshChangeListener implements ISubscriberChangeListener {
+public class RefreshChangeListener implements ISubscriberChangeListener {
private List changes = new ArrayList();
private SubscriberSyncInfoCollector collector;
- RefreshChangeListener(SubscriberSyncInfoCollector collector) {
+ public RefreshChangeListener(SubscriberSyncInfoCollector collector) {
this.collector = collector;
}
public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas) {
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/synchronize/RefreshUserNotificationPolicy.java
index 1c7fa1542..4d7793edc 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/synchronize/RefreshUserNotificationPolicy.java
@@ -1,4 +1,4 @@
-package org.eclipse.team.internal.ui.jobs;
+package org.eclipse.team.internal.ui.synchronize;
import java.util.*;
@@ -8,7 +8,6 @@ import org.eclipse.core.runtime.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.synchronize.SyncInfo;
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.subscriber.*;
import org.eclipse.team.ui.synchronize.viewers.SyncInfoCompareInput;
@@ -41,9 +40,9 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
*/
public void refreshDone(final IRefreshEvent event) {
// Ensure that this event was generated for this participant
- if (event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber())
- return;
-
+ if (event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber()) return;
+ // If the event is for a cancelled operation, there's nothing to do
+ if(! event.getStatus().isOK()) return;
// Decide on what action to take after the refresh is completed
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() {
@@ -77,7 +76,6 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
}
}
});
- RefreshSubscriberJob.removeRefreshListener(this);
}
private void notifyIfNeededModal(final IRefreshEvent event) {
@@ -101,6 +99,4 @@ 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/synchronize/RefreshUserNotificationPolicyInModalDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
new file mode 100644
index 000000000..cbafdbd29
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareUI;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.synchronize.SyncInfoTree;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.ui.synchronize.subscriber.*;
+import org.eclipse.team.ui.synchronize.viewers.*;
+
+public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubscriberListener {
+
+ private SubscriberParticipant participant;
+ private Shell shell;
+ private boolean rememberInSyncView;
+ private String targetId;
+ private SyncInfoTree syncInfoSet;
+
+ public RefreshUserNotificationPolicyInModalDialog(String targetId, SubscriberParticipant participant, SyncInfoTree syncInfoSet) {
+ this.targetId = targetId;
+ this.participant = participant;
+ this.syncInfoSet = syncInfoSet;
+ }
+
+ public void refreshStarted(IRefreshEvent event) {
+ }
+
+ public void refreshDone(final IRefreshEvent event) {
+ // Ensure that this event was generated for this participant
+ if (event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber()) return;
+ // Operation cancelled, there is no reason to prompt the user
+ if(! event.getStatus().isOK()) return;
+ TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ if (! areChanges()) {
+ MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Policy.bind("OpenComparedDialog.noChangeTitle"), Policy.bind("OpenComparedDialog.noChangesMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ if (isSingleFileCompare(event.getResources())) {
+ compareAndOpenEditors(event, participant);
+ } else {
+ compareAndOpenDialog(event, participant);
+ }
+ }
+ });
+ }
+
+ private boolean areChanges() {
+ return ! syncInfoSet.isEmpty();
+ }
+
+ protected boolean isSingleFileCompare(IResource[] resources) {
+ return resources.length == 1 && resources[0].getType() == IResource.FILE;
+ }
+
+ protected void compareAndOpenEditors(IRefreshEvent event, SubscriberParticipant participant) {
+ IResource[] resources = event.getResources();
+ 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, syncInfoSet);
+ 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 = new SynchronizeDialog(Display.getCurrent().getActiveShell(), participant.getName(), input);
+ dialog.setSynchronizeParticipant(participant);
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+ }
+} \ No newline at end of file
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
index ce43c6c6d..6c95898fd 100644
--- 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
@@ -44,7 +44,7 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
SynchronizeWizardDialog(Shell parent, IWizard wizard) {
super(parent, wizard);
setShellStyle(getShellStyle());
- setMinimumPageSize(500, 300);
+ //setMinimumPageSize(500, 300);
}
}
@@ -54,7 +54,7 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
public void run() {
TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCHRONIZING_DEFAULT_PARTICIPANT, participant.getId());
IWizard wizard = participant.createSynchronizeWizard();
- SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
dialog.open();
GlobalRefreshAction.this.updateTooltipMessage();
}
@@ -80,13 +80,12 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
synchronizeAction = new Action(Policy.bind("GlobalRefreshAction.4")) { //$NON-NLS-1$
public void run() {
IWizard wizard = new GlobalSynchronizeWizard();
- SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
dialog.open();
}
};
setMenuCreator(this);
- setToolTipText("this is a test");
- //updateTooltipMessage();
+ updateTooltipMessage();
}
/*
@@ -159,7 +158,7 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
wizard = participants[0].createSynchronizeWizard();
}
}
- SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
+ WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
dialog.open();
updateTooltipMessage();
}
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
deleted file mode 100644
index e269f03b3..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/GlobalRefreshResourceSelectionPage.java
+++ /dev/null
@@ -1,240 +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.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/ui/synchronize/subscriber/TeamOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
index 2bdb9dc1d..9393842e0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/TeamOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.subscriber;
+package org.eclipse.team.ui;
import java.lang.reflect.InvocationTargetException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java
new file mode 100644
index 000000000..5c18c855d
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java
@@ -0,0 +1,339 @@
+/*******************************************************************************
+ * 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.util.*;
+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.internal.ui.Policy;
+import org.eclipse.team.internal.ui.Utils;
+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.
+ *
+ * @since 3.0
+ */
+public class GlobalRefreshResourceSelectionPage extends WizardPage {
+
+ private SubscriberParticipant participant;
+ private Button participantScope;
+ private Button selectedResourcesScope;
+ private Button workingSetScope;
+ private Button enclosingProjectsScope;
+ private Button selectWorkingSetButton;
+ private ContainerCheckedTreeViewer fViewer;
+ private Text workingSetLabel;
+ private IWorkingSet workingSet;
+ private int scopeHint;
+
+ 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) && c.getType() != IResource.PROJECT) {
+ return c.getFullPath().toString();
+ }
+ }
+ return workbenchProvider.getText(element);
+ }
+ public Image getImage(Object element) {
+ return workbenchProvider.getImage(element);
+ }
+ }
+
+ public GlobalRefreshResourceSelectionPage(SubscriberParticipant participant, int scopeHint) {
+ super("Synchronize");
+ this.scopeHint = scopeHint;
+ 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);
+ data.widthHint = 250;
+ data.heightHint = 200;
+ fViewer.getControl().setLayoutData(data);
+ fViewer.setContentProvider(new MyContentProvider());
+ fViewer.setLabelProvider( new DecoratingLabelProvider(
+ new MyLabelProvider(),
+ PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
+ fViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateOKStatus();
+ }
+ });
+ fViewer.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ fViewer.setInput(participant);
+
+ // Scopes
+ Group scopeGroup = new Group(top, SWT.NULL);
+ scopeGroup.setText("Scope");
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 4;
+ layout.makeColumnsEqualWidth = false;
+ scopeGroup.setLayout(layout);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ scopeGroup.setLayoutData(data);
+
+ participantScope = new Button(scopeGroup, SWT.RADIO);
+ participantScope.setText("W&orkspace");
+ participantScope.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateParticipantScope();
+ }
+ });
+
+ selectedResourcesScope = new Button(scopeGroup, SWT.RADIO);
+ selectedResourcesScope.setText("&Selected Resources");
+ selectedResourcesScope.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateSelectedResourcesScope();
+ }
+ });
+
+ enclosingProjectsScope = new Button(scopeGroup, SWT.RADIO);
+ enclosingProjectsScope.setText("&Enclosing Projects");
+ enclosingProjectsScope.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateEnclosingProjectScope();
+ }
+ });
+ data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ data.horizontalIndent = 15;
+ data.horizontalSpan = 2;
+ enclosingProjectsScope.setLayoutData(data);
+
+ workingSetScope = new Button(scopeGroup, SWT.RADIO);
+ workingSetScope.setText("&Working Set: ");
+ workingSetScope.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(workingSetScope.getSelection()) {
+ updateWorkingSetScope();
+ }
+ }
+ });
+
+ workingSetLabel = new Text(scopeGroup, SWT.BORDER);
+ workingSetLabel.setEditable(false);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ workingSetLabel.setLayoutData(data);
+
+ Button selectWorkingSetButton = new Button(scopeGroup, SWT.NULL);
+ selectWorkingSetButton.setText("&Choose...");
+ selectWorkingSetButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ selectWorkingSetAction();
+ workingSetScope.setSelection(true);
+ updateWorkingSetScope();
+ }
+
+
+ });
+ data = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ selectWorkingSetButton.setLayoutData(data);
+ Dialog.applyDialogFont(selectWorkingSetButton);
+
+ workingSet = participant.getWorkingSet();
+ updateWorkingSetLabel();
+ initializeScopingHint();
+ }
+
+ updateOKStatus();
+ Dialog.applyDialogFont(top);
+ }
+
+ private void initializeScopingHint() {
+ switch(scopeHint) {
+ case SubscriberRefreshWizard.SCOPE_PARTICIPANT_ROOTS:
+ participantScope.setSelection(true);
+ updateParticipantScope();
+ break;
+ case SubscriberRefreshWizard.SCOPE_WORKING_SET:
+ workingSetScope.setSelection(true);
+ updateWorkingSetScope();
+ break;
+ default:
+ if(getResourcesFromSelection().length == 0) {
+ participantScope.setSelection(true);
+ updateParticipantScope();
+ } else {
+ selectedResourcesScope.setSelection(true);
+ updateSelectedResourcesScope();
+ }
+ }
+ }
+
+ private void updateEnclosingProjectScope() {
+ if(enclosingProjectsScope.getSelection()) {
+ IResource[] selectedResources = getSelectedResources();
+ List projects = new ArrayList();
+ for (int i = 0; i < selectedResources.length; i++) {
+ projects.add(selectedResources[i].getProject());
+ }
+ fViewer.setCheckedElements(projects.toArray());
+ updateOKStatus();
+ }
+ }
+
+ private void updateParticipantScope() {
+ if(participantScope.getSelection()) {
+ fViewer.setCheckedElements(participant.getSubscriber().roots());
+ updateOKStatus();
+ }
+ }
+
+ private void updateSelectedResourcesScope() {
+ if(selectedResourcesScope.getSelection()) {
+ fViewer.setCheckedElements(getResourcesFromSelection());
+ updateOKStatus();
+ }
+ }
+
+ private void selectWorkingSetAction() {
+ IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
+ IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(getShell(), false);
+ dialog.open();
+ IWorkingSet[] sets = dialog.getSelection();
+ if(sets != null) {
+ workingSet = sets[0];
+ } else {
+ workingSet = null;
+ }
+ workingSetScope.setSelection(true);
+ updateWorkingSetScope();
+ updateWorkingSetLabel();
+ }
+
+ private void updateWorkingSetScope() {
+ if(workingSet != null) {
+ List resources = IDE.computeSelectedResources(new StructuredSelection(workingSet.getElements()));
+ if(! resources.isEmpty()) {
+ fViewer.setCheckedElements((IResource[])resources.toArray(new IResource[resources.size()]));
+ }
+ } else {
+ fViewer.setCheckedElements(new Object[0]);
+ }
+ updateOKStatus();
+ }
+
+ private IResource[] getResourcesFromSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().getActivePart().getSite().getSelectionProvider().getSelection();
+ if(selection instanceof IStructuredSelection) {
+ return Utils.getResources(((IStructuredSelection)selection).toArray());
+ }
+ return new IResource[0];
+ }
+
+ protected void updateOKStatus() {
+ if(fViewer != null) {
+ setPageComplete(fViewer.getCheckedElements().length > 0);
+ } else {
+ setPageComplete(true);
+ }
+ }
+
+ /**
+ * Return the set of root resources selected.
+ */
+ public IResource[] getSelectedResources() {
+ if(fViewer != null) {
+ // Checked elements are ordered top-down.
+ // Note: n^2!!!
+ List resources = IDE.computeSelectedResources(new StructuredSelection(fViewer.getCheckedElements()));
+ Map rootResources = new HashMap();
+ for (Iterator it = resources.iterator(); it.hasNext();) {
+ IResource element = (IResource) it.next();
+ if(! rootResources.containsKey(element.getProject())) {
+ List roots = new ArrayList();
+ roots.add(element);
+ rootResources.put(element.getProject(), roots);
+ } else {
+ List r = (List)rootResources.get(element.getProject());
+ boolean toAdd = true;
+ for (Iterator it2 = r.iterator(); it2.hasNext();) {
+ IResource e = (IResource) it2.next();
+ if(e.getFullPath().isPrefixOf(element.getFullPath()))
+ toAdd = false;
+ break;
+ }
+ if(toAdd) {
+ r.add(element);
+ }
+ }
+ }
+ return (IResource[]) rootResources.keySet().toArray(new IResource[rootResources.size()]);
+ } else {
+ return new IResource[0];
+ }
+ }
+
+ private void updateWorkingSetLabel() {
+ if (workingSet == null) {
+ workingSetLabel.setText(Policy.bind("StatisticsPanel.noWorkingSet")); //$NON-NLS-1$
+ } else {
+ workingSetLabel.setText(workingSet.getName());
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
index 995db2767..a0acb6167 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
@@ -15,6 +15,10 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
+/**
+ *
+ * @since 3.0
+ */
public interface IRefreshEvent {
public static final int SCHEDULED_REFRESH = 1;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListenerFactory.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListenerFactory.java
new file mode 100644
index 000000000..3a4658506
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListenerFactory.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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 org.eclipse.team.core.synchronize.SyncInfoTree;
+
+/**
+ * A factory which provides standard listeners to subscriber refresh operations. These
+ * can be used to add common behavior to refresh operations run via a
+ * {@link SubscriberParticipant}.
+ *
+ * @since 3.0
+ */
+public interface IRefreshSubscriberListenerFactory {
+ /**
+ * Returns a listener that will prompt with the resuts of the refresh in a dialog. You
+ * can configure the set of synchronization information that will be shown by specifying
+ * a {@link SyncInfoSet} that is different than the default one maintained by
+ * the given participant.
+ */
+ public IRefreshSubscriberListener createModalDialogListener(String targetId, SubscriberParticipant participant, SyncInfoTree syncInfoSet);
+
+ /**
+ * Returns a listener that will prompt at the end of the refresh indicating if changes are
+ * found and indicate
+ */
+ public IRefreshSubscriberListener createSynchronizeViewListener(SubscriberParticipant participant);
+}
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
deleted file mode 100644
index 5ff05a326..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
+++ /dev/null
@@ -1,95 +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.ui.synchronize.subscriber;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
-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 {
-
- private ISelectionProvider selectionProvider;
- private boolean refreshAll;
- private SubscriberSyncInfoCollector collector;
- private IRefreshSubscriberListener listener;
- private String description;
- private IWorkbenchSite workbenchSite;
-
- public RefreshAction(ISelectionProvider page, String description, SubscriberSyncInfoCollector collector, IRefreshSubscriberListener listener, boolean refreshAll) {
- this.selectionProvider = page;
- this.description = description;
- this.collector = collector;
- this.listener = listener;
- this.refreshAll = refreshAll;
- Utils.initAction(this, "action.refreshWithRemote."); //$NON-NLS-1$
- }
-
- public void run() {
- ISelection selection = selectionProvider.getSelection();
- if(selection instanceof IStructuredSelection) {
- IResource[] resources = Utils.getResources(((IStructuredSelection)selection).toArray());
- if (refreshAll || resources.length == 0) {
- // If no resources are selected, refresh all the subscriber roots
- resources = collector.getRoots();
- }
- run(getWorkbenchSite(), description, resources, collector, listener);
- }
- }
-
- /**
- * 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(autoListener);
- }
- Utils.schedule(job, site);
- }
-
- public void setWorkbenchSite(IWorkbenchSite part) {
- this.workbenchSite = part;
- }
-
- public IWorkbenchSite getWorkbenchSite() {
- return workbenchSite;
- }
-}
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/ui/synchronize/subscriber/RefreshCompleteDialog.java
index 5d96ae5de..ec3b3f4ba 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/ui/synchronize/subscriber/RefreshCompleteDialog.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 java.lang.reflect.InvocationTargetException;
@@ -16,12 +16,13 @@ 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.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
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.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
@@ -29,16 +30,10 @@ 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.SynchronizeCompareInput;
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 static final String WIDTH_KEY = "height-key"; //$NON-NLS-1$
-
private SyncInfoFilter filter;
private FilteredSyncInfoCollector collector;
private SynchronizeCompareInput compareEditorInput;
@@ -90,17 +85,6 @@ public class RefreshCompleteDialog extends DetailsDialog {
}
/* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
- collector.dispose();
- Rectangle bounds = getShell().getBounds();
- settings.put(HEIGHT_KEY, bounds.height);
- settings.put(WIDTH_KEY, bounds.width);
- return super.close();
- }
-
- /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
protected void createButtonsForButtonBar(Composite parent) {
@@ -183,7 +167,12 @@ public class RefreshCompleteDialog extends DetailsDialog {
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$
+ if(event.getChanges().length > 0) {
+ String numNewChanges = Integer.toString(event.getChanges().length);
+ text.append(Policy.bind("RefreshCompleteDialog.5a", new Object[] {numNewChanges, participant.getName(), outgoing, incoming, conflicting})); //$NON-NLS-1$
+ } else {
+ 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$
@@ -208,21 +197,6 @@ public class RefreshCompleteDialog extends DetailsDialog {
}
/* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#getInitialSize()
- */
- protected Point getInitialSize() {
- int width, height;
- try {
- height = settings.getInt(HEIGHT_KEY);
- width = settings.getInt(WIDTH_KEY);
- } catch (NumberFormatException e) {
- return super.getInitialSize();
- }
- Point p = super.getInitialSize();
- return new Point(width, p.y);
- }
-
- /* (non-Javadoc)
* @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeCancelButton()
*/
protected boolean includeCancelButton() {
@@ -233,7 +207,7 @@ public class RefreshCompleteDialog extends DetailsDialog {
* @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton()
*/
protected boolean includeDetailsButton() {
- return ! getSubscriberSyncInfoSet().isEmpty();
+ return event.getChanges().length > 0;
}
/* (non-Javadoc)
@@ -263,9 +237,15 @@ public class RefreshCompleteDialog extends DetailsDialog {
private Label createLabel(Composite parent, String text, int columns) {
Label label = new Label(parent, SWT.WRAP);
label.setText(text);
- GridData data = new GridData();
+ GridData data =
+ new GridData(
+ GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_BEGINNING);
+ data.widthHint =
+ convertHorizontalDLUsToPixels(
+ IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
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/jobs/RefreshSubscriberJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshSubscriberJob.java
index 393936537..d17d28142 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshSubscriberJob.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.jobs;
+package org.eclipse.team.ui.synchronize.subscriber;
import java.util.ArrayList;
import java.util.List;
@@ -21,10 +21,9 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.ui.synchronize.subscriber.IRefreshEvent;
-import org.eclipse.team.ui.synchronize.subscriber.IRefreshSubscriberListener;
+import org.eclipse.team.internal.core.Policy;
+import org.eclipse.team.internal.core.TeamPlugin;
+import org.eclipse.team.internal.ui.synchronize.RefreshChangeListener;
/**
* Job to refresh a subscriber with its remote state.
@@ -34,7 +33,7 @@ import org.eclipse.team.ui.synchronize.subscriber.IRefreshSubscriberListener;
* important that no scheduling rules are used for the job in order to
* avoid possible deadlock.
*/
-public class RefreshSubscriberJob extends WorkspaceJob {
+public final class RefreshSubscriberJob extends WorkspaceJob {
/**
* Uniquely identifies this type of job. This is used for cancellation.
@@ -67,6 +66,8 @@ public class RefreshSubscriberJob extends WorkspaceJob {
* Refresh started/completed listener for every refresh
*/
private static List listeners = new ArrayList(1);
+ private static final int STARTED = 1;
+ private static final int DONE = 2;
protected static class RefreshEvent implements IRefreshEvent {
int type;
@@ -161,7 +162,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
public RefreshSubscriberJob(String name, IResource[] resources, SubscriberSyncInfoCollector collector) {
- this(name, collector);
+ this(collector.getSubscriber().getName(), collector); //$NON-NLS-1$
this.resources = resources;
}
@@ -191,7 +192,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
boolean shouldRun = collector != null && getSubscriber() != null;
if(shouldRun) {
IProgressMonitor group = Platform.getJobManager().createProgressGroup();
- group.beginTask(Policy.bind("RefreshSubscriberJob.2", getSubscriber().getName()), 100); //$NON-NLS-1$
+ group.beginTask(getName(), 100); //$NON-NLS-1$
setProgressGroup(group, 80);
collector.setProgressGroup(group, 20);
}
@@ -213,7 +214,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
public IStatus runInWorkspace(IProgressMonitor monitor) {
// Synchronized to ensure only one refresh job is running at a particular time
synchronized (getFamily()) {
- MultiStatus status = new MultiStatus(TeamUIPlugin.ID, TeamException.UNABLE, Policy.bind("RefreshSubscriberJob.0"), null); //$NON-NLS-1$
+ MultiStatus status = new MultiStatus(TeamPlugin.ID, TeamException.UNABLE, Policy.bind("RefreshSubscriberJob.0"), null); //$NON-NLS-1$
Subscriber subscriber = getSubscriber();
IResource[] roots = getResources();
@@ -239,13 +240,17 @@ public class RefreshSubscriberJob extends WorkspaceJob {
// during this refresh.
subscriber.addListener(changeListener);
// Pre-Notify
- notifyListeners(true, event);
+ notifyListeners(STARTED, event);
// Perform the refresh
subscriber.refresh(roots, IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 100));
} catch(TeamException e) {
status.merge(e.getStatus());
}
} catch(OperationCanceledException e2) {
+ subscriber.removeListener(changeListener);
+ event.setStatus(Status.CANCEL_STATUS);
+ event.setStopTime(System.currentTimeMillis());
+ notifyListeners(DONE, event);
return Status.CANCEL_STATUS;
} finally {
monitor.done();
@@ -255,7 +260,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
event.setChanges(changeListener.getChanges());
event.setStopTime(System.currentTimeMillis());
event.setStatus(status.isOK() ? Status.OK_STATUS : (IStatus) status);
- notifyListeners(false, event);
+ notifyListeners(DONE, event);
changeListener.clear();
return event.getStatus();
@@ -336,7 +341,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
}
}
- protected void notifyListeners(final boolean started, final IRefreshEvent event) {
+ protected void notifyListeners(final int state, final IRefreshEvent event) {
// Get a snapshot of the listeners so the list doesn't change while we're firing
IRefreshSubscriberListener[] listenerArray;
synchronized (listeners) {
@@ -347,10 +352,15 @@ public class RefreshSubscriberJob extends WorkspaceJob {
IRefreshSubscriberListener listener = listenerArray[i];
Notification notification = new Notification() {
protected void notify(IRefreshSubscriberListener listener) {
- if(started) {
- listener.refreshStarted(event);
- } else {
- listener.refreshDone(event);
+ switch (state) {
+ case STARTED:
+ listener.refreshStarted(event);
+ break;
+ case DONE:
+ listener.refreshDone(event);
+ break;
+ default:
+ break;
}
}
};
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java
index 5786b23f3..462d431d3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberOperation.java
@@ -17,6 +17,7 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
+import org.eclipse.team.ui.*;
import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
import org.eclipse.ui.IWorkbenchPart;
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 1f503660e..d03dd631b 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
@@ -16,11 +16,10 @@ 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.core.synchronize.*;
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.internal.ui.synchronize.RefreshUserNotificationPolicy;
+import org.eclipse.team.internal.ui.synchronize.RefreshUserNotificationPolicyInModalDialog;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
import org.eclipse.ui.*;
@@ -84,10 +83,20 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
public final static int[] OUTGOING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING};
public final static int[] BOTH_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.INCOMING, SyncInfo.OUTGOING};
public final static int[] CONFLICTING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING};
+
+ private IRefreshSubscriberListenerFactory refreshListenerFactory;
public SubscriberParticipant() {
super();
refreshSchedule = new SubscriberRefreshSchedule(this);
+ refreshListenerFactory = new IRefreshSubscriberListenerFactory() {
+ public IRefreshSubscriberListener createModalDialogListener(String targetId, SubscriberParticipant participant, SyncInfoTree syncInfoSet) {
+ return new RefreshUserNotificationPolicyInModalDialog(targetId, participant, syncInfoSet);
+ }
+ public IRefreshSubscriberListener createSynchronizeViewListener(SubscriberParticipant participant) {
+ return new RefreshUserNotificationPolicy(participant);
+ }
+ };
}
/* (non-Javadoc)
@@ -157,16 +166,17 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
return collector.getSubscriber().roots();
}
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#refresh(org.eclipse.core.resources.IResource[])
+ /**
+ * Will refresh a participant in the background.
+ *
+ * @param resources the resources to be refreshed.
*/
- public void refresh(IResource[] resources) {
- IWorkbenchSite site = view != null ? view.getSite() : null;
- IResource[] resourcesToRefresh = resources;
- if((resources == null || resources.length == 0)) {
- resourcesToRefresh = collector.getWorkingSet();
- }
- RefreshAction.run(site, getName(), resourcesToRefresh, getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(this));
+ public void refresh(IResource[] resources, IRefreshSubscriberListener listener, String taskName, IWorkbenchSite site) {
+ refreshHelper(site, taskName, resources, getSubscriberSyncInfoCollector(), listener);
+ }
+
+ public IRefreshSubscriberListenerFactory getRefreshListeners() {
+ return getRefreshListenerFactory();
}
/* (non-Javadoc)
@@ -204,6 +214,10 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
}
}
+ protected IRefreshSubscriberListenerFactory getRefreshListenerFactory() {
+ return refreshListenerFactory;
+ }
+
/**
* This method is invoked just before the collector is started.
* This gives an oportunity to configure the collector parameters
@@ -325,4 +339,26 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
}
return null;
}
+
+ private void refreshHelper(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(autoListener);
+ }
+ Utils.schedule(job, site);
+ }
} \ No newline at end of file
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
deleted file mode 100644
index e0f581e07..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantDialog.java
+++ /dev/null
@@ -1,149 +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.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 fe705c96b..9d549e62c 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
@@ -17,12 +17,12 @@ import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
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.*;
@@ -61,7 +61,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
private NavigateAction gotoPrevious;
private Action configureSchedule;
private SyncViewerShowPreferencesAction showPreferences;
- private RefreshAction refreshAllAction;
+ private Action refreshAllAction;
private Action collapseAll;
private WorkingSetFilterActionGroup workingSetGroup;
private StatusLineContributionGroup statusLine;
@@ -104,8 +104,25 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
};
gotoNext = new NavigateAction(view, nav, true /*next*/);
gotoPrevious = new NavigateAction(view, nav, false /*previous*/);
- refreshAllAction = new RefreshAction(getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
- refreshAllAction.setWorkbenchSite(view.getSite());
+
+ if(participant.doesSupportSynchronize()) {
+ refreshAllAction = new Action() {
+ public void run() {
+ // Prime the refresh wizard with an appropriate initial selection
+ SubscriberRefreshWizard wizard = new SubscriberRefreshWizard(participant);
+ int scopeHint = SubscriberRefreshWizard.SCOPE_PARTICIPANT_ROOTS;
+ IWorkingSet set = participant.getWorkingSet();
+ if(set != null) {
+ scopeHint = SubscriberRefreshWizard.SCOPE_WORKING_SET;
+ }
+ wizard.setScopeHint(scopeHint);
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.open();
+ }
+ };
+ Utils.initAction(refreshAllAction, "action.refreshWithRemote."); //$NON-NLS-1$
+ }
+
collapseAll = new Action() {
public void run() {
if (changesViewer == null || !(changesViewer instanceof AbstractTreeViewer)) return;
@@ -213,7 +230,9 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
IToolBarManager manager = actionBars.getToolBarManager();
// toolbar
- manager.add(refreshAllAction);
+ if(refreshAllAction != null) {
+ manager.add(refreshAllAction);
+ }
manager.add(new Separator());
if(gotoNext != null) {
manager.add(gotoNext);
@@ -224,9 +243,6 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
// view menu
IMenuManager menu = actionBars.getMenuManager();
- MenuManager layoutMenu = new MenuManager(Policy.bind("action.layout.label")); //$NON-NLS-1$
- MenuManager comparisonCriteria = new MenuManager(Policy.bind("action.comparisonCriteria.label")); //$NON-NLS-1$
- //comparisonCriteriaGroup.addActionsToMenuMgr(comparisonCriteria);
workingSetGroup.fillActionBars(actionBars);
menu.add(new Separator());
menu.add(new Separator());
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 17acfd648..f34d46c91 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
@@ -8,7 +8,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
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.ui.IMemento;
public class SubscriberRefreshSchedule {
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/ui/synchronize/subscriber/SubscriberRefreshWizard.java
index fdc4fafa7..70b7d7e40 100644
--- 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/ui/synchronize/subscriber/SubscriberRefreshWizard.java
@@ -8,31 +8,40 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.wizards;
+package org.eclipse.team.ui.synchronize.subscriber;
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 {
+
+ public final static int SCOPE_WORKING_SET = 1;
+ public final static int SCOPE_SELECTED_RESOURCES = 2;
+ public final static int SCOPE_ENCLOSING_PROJECT = 3;
+ public final static int SCOPE_PARTICIPANT_ROOTS = 4;
private SubscriberParticipant participant;
private GlobalRefreshResourceSelectionPage selectionPage;
+ private int scopeHint;
public SubscriberRefreshWizard(SubscriberParticipant participant) {
- this.participant = participant;
+ this.participant = participant;
setWindowTitle(Policy.bind("SubscriberRefreshWizard.0") + participant.getName()); //$NON-NLS-1$
setDefaultPageImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_WIZBAN_SHARE));
}
+ public void setScopeHint(int scopeHint) {
+ this.scopeHint = scopeHint;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
public void addPages() {
- selectionPage = new GlobalRefreshResourceSelectionPage(participant);
+ selectionPage = new GlobalRefreshResourceSelectionPage(participant, scopeHint);
addPage(selectionPage);
}
@@ -41,8 +50,11 @@ public class SubscriberRefreshWizard extends Wizard {
*/
public boolean performFinish() {
IResource[] resources = selectionPage.getSelectedResources();
- if(resources != null) {
- participant.refresh(resources);
+ if(resources != null && resources.length > 0) {
+ IRefreshSubscriberListener listener = participant.getRefreshListeners().createSynchronizeViewListener(participant);
+
+ // We don't know in which site to show progress because a participant could actually be shown in multiple sites.
+ participant.refresh(resources, listener, Policy.bind("Participant.synchronizing"), null); //$NON-NLS-1$
}
return true;
}
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 b3b00ce68..8750680ea 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
@@ -12,11 +12,10 @@ package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
+import org.eclipse.team.internal.ui.Utils;
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;
@@ -33,7 +32,7 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
private SubscriberParticipant participant;
private OpenWithActionGroup openWithActions;
private RefactorActionGroup refactorActions;
- private RefreshAction refreshSelectionAction;
+ private Action refreshSelectionAction;
public SynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(participant.getId(), view.getViewSite(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
@@ -49,8 +48,17 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
super.initializeActions(treeViewer);
openWithActions = new OpenWithActionGroup(view, participant);
refactorActions = new RefactorActionGroup(view);
- refreshSelectionAction = new RefreshAction(view.getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
- refreshSelectionAction.setWorkbenchSite(view.getSite());
+ refreshSelectionAction = new Action() {
+ public void run() {
+ StructuredViewer viewer = getViewer();
+ if(viewer != null && ! viewer.getControl().isDisposed()) {
+ IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+ IResource[] resources = Utils.getResources(selection.toArray());
+ participant.refresh(resources, participant.getRefreshListeners().createSynchronizeViewListener(participant), Policy.bind("Participant.synchronizing"), view.getSite()); //$NON-NLS-1$
+ }
+ }
+ };
+ Utils.initAction(refreshSelectionAction, "action.refreshWithRemote."); //$NON-NLS-1$
}
protected void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
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
index 5e291e6b0..d43bc3429 100644
--- 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
@@ -86,7 +86,10 @@ public class SynchronizeDialog extends ResizableDialog implements IPropertyChang
Composite parent = (Composite) super.createDialogArea(parent2);
Control c = fCompareEditorInput.createContents(parent);
c.setLayoutData(new GridData(GridData.FILL_BOTH));
- if (participant != null) {
+
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+
+ if (participant != null && ! particantRegisteredWithSynchronizeManager(participant)) {
rememberParticipantButton = new Button(parent, SWT.CHECK);
rememberParticipantButton.setText(Policy.bind("ParticipantCompareDialog.1")); //$NON-NLS-1$
}
@@ -97,6 +100,13 @@ public class SynchronizeDialog extends ResizableDialog implements IPropertyChang
return parent;
}
+ private boolean particantRegisteredWithSynchronizeManager(ISynchronizeParticipant participant) {
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+ for (int i = 0; i < participants.length; i++) {
+ if(participants[i] == participant) return true;
+ }
+ return false;
+ }
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)

Back to the top