diff options
2 files changed, 12 insertions, 40 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryEncodingPropertyPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryEncodingPropertyPage.java index 18aad2297..3fd4b09b1 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryEncodingPropertyPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryEncodingPropertyPage.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui.repo; -import org.osgi.service.prefs.BackingStoreException; -import org.osgi.service.prefs.Preferences; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.FieldEditor; import org.eclipse.jface.preference.IPreferenceStore; @@ -27,6 +27,8 @@ import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.ui.dialogs.PropertyPage; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.service.prefs.Preferences; /** * Repository preference page for setting the encoding of the server 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 index 646dc07d8..15146656d 100644 --- 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 @@ -10,16 +10,13 @@ *******************************************************************************/ 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.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; 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.Policy; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.ui.TeamUI; @@ -30,15 +27,12 @@ import org.eclipse.ui.actions.ActionFactory; public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubscriberListener { private SubscriberParticipant participant; - private boolean rememberInSyncView; - private String targetId; - private SyncInfoTree syncInfoSet; + private ISynchronizePageConfiguration configuration; private Shell shell; - public RefreshUserNotificationPolicyInModalDialog(Shell shell, String targetId, SubscriberParticipant participant, SyncInfoTree syncInfoSet) { - this.targetId = targetId; + public RefreshUserNotificationPolicyInModalDialog(Shell shell, ISynchronizePageConfiguration configuration, SubscriberParticipant participant) { + this.configuration = configuration; this.participant = participant; - this.syncInfoSet = syncInfoSet; this.shell = shell; } @@ -47,7 +41,7 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc public ActionFactory.IWorkbenchAction refreshDone(final IRefreshEvent event) { // Ensure that this event was generated for this participant - if (event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber()) + if (event.getSubscriber() != participant.getSubscriber()) return null; // If the event is for a cancelled operation, there's nothing to do int severity = event.getStatus().getSeverity(); @@ -57,7 +51,7 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc return new WorkbenchAction() { public void run() { // If there are no changes - if (!areChanges()) { + if (event.getStatus().getCode() == IRefreshEvent.STATUS_NO_CHANGES) { MessageDialog.openInformation(shell, Policy.bind("OpenComparedDialog.noChangeTitle"), Policy.bind("OpenComparedDialog.noChangesMessage")); //$NON-NLS-1$ //$NON-NLS-2$ return; } @@ -72,10 +66,6 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc }; } - private boolean areChanges() { - return ! syncInfoSet.isEmpty(); - } - protected boolean isSingleFileCompare(IResource[] resources) { return resources.length == 1 && resources[0].getType() == IResource.FILE; } @@ -83,7 +73,7 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc 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]); + SyncInfo info = participant.getSyncInfoSet().getSyncInfo(resources[i]); if (info != null) { SyncInfoCompareInput input = new SyncInfoCompareInput(event.getSubscriber().getName(), info); CompareUI.openCompareEditor(input); @@ -92,29 +82,9 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc } 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(shell, participant.getName(), input); - dialog.setSynchronizeParticipant(participant); + ParticipantPageSaveablePart input = new ParticipantPageSaveablePart(Utils.getShell(null), cc, configuration, participant); + ParticipantPageDialog dialog = new ParticipantPageDialog(shell, input, participant); dialog.setBlockOnOpen(true); dialog.open(); } |