Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-08 01:06:07 +0000
committerJean Michel-Lemieux2004-03-08 01:06:07 +0000
commit4e983c49fb7bbcd36a5ec7de298752697522f02b (patch)
tree2cbcee96b12e47e657a2737a9c59dafa028604fa
parent3d6baf672c070a0545c3edbd9dc6b7a6a938e3fa (diff)
downloadeclipse.platform.team-branch_20040305_compareandglobalsyncaction.tar.gz
eclipse.platform.team-branch_20040305_compareandglobalsyncaction.tar.xz
eclipse.platform.team-branch_20040305_compareandglobalsyncaction.zip
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java)3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java)3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java52
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java)5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshParticipantSelectionPage.java159
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshResourceSelectionPage.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalSynchronizeWizard.java118
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/OpenCompareDialogAction.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java67
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ParticipantCompareDialog.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java)53
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java2
23 files changed, 428 insertions, 129 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
index a769bedc3..222bd4aa3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
@@ -29,7 +29,7 @@ import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.ui.synchronize.viewers.CompareDialog;
+import org.eclipse.team.ui.synchronize.viewers.ParticipantCompareDialog;
/**
* Compare with revision will allow a user to browse the history of a file, compare with the
@@ -96,7 +96,7 @@ public class CompareWithRevisionAction extends WorkspaceAction {
CVSCompareRevisionsInput input = new CVSCompareRevisionsInput((IFile)getSelectedResources()[0], entries[0]);
// running with a null progress monitor is fine because we have already pre-fetched the log entries above.
input.run(new NullProgressMonitor());
- CompareDialog cd = createCompareDialog(getShell(), input);
+ ParticipantCompareDialog cd = createCompareDialog(getShell(), input);
cd.setBlockOnOpen(true);
cd.open();
}
@@ -106,8 +106,8 @@ public class CompareWithRevisionAction extends WorkspaceAction {
/**
* Return the compare dialog to use to show the compare input.
*/
- protected CompareDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
- return new CompareDialog(getShell(), "Compare With Revision", input);
+ protected ParticipantCompareDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
+ return new ParticipantCompareDialog(getShell(), "Compare With Revision", input);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java
index da01eb866..eebf622d9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRevisionAction.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.synchronize.viewers.CompareDialog;
+import org.eclipse.team.ui.synchronize.viewers.ParticipantCompareDialog;
/**
* Displays a compare dialog and allows the same behavior as the compare. In addition
@@ -29,7 +29,7 @@ public class ReplaceWithRevisionAction extends CompareWithRevisionAction {
protected static final int REPLACE_ID = 10;
- protected class ReplaceCompareDialog extends CompareDialog {
+ protected class ReplaceCompareDialog extends ParticipantCompareDialog {
private Button replaceButton;
public ReplaceCompareDialog(Shell shell, String title, CVSCompareRevisionsInput input) {
@@ -73,7 +73,7 @@ public class ReplaceWithRevisionAction extends CompareWithRevisionAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction#createCompareDialog(org.eclipse.swt.widgets.Shell, org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput)
*/
- protected CompareDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
+ protected ParticipantCompareDialog createCompareDialog(Shell shell, CVSCompareRevisionsInput input) {
return new ReplaceCompareDialog(shell, "Replace With Revision", input);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index bb972dac1..c91785f60 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
@@ -26,7 +26,7 @@ import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
import org.eclipse.team.ui.synchronize.subscriber.OpenCompareDialogAction;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.team.ui.synchronize.viewers.CompareDialog;
+import org.eclipse.team.ui.synchronize.viewers.ParticipantCompareDialog;
import org.eclipse.ui.*;
public class MergeWizard extends Wizard {
@@ -71,8 +71,8 @@ public class MergeWizard extends Wizard {
}
OpenCompareDialogAction compareAction = new OpenCompareDialogAction(activePage.getWorkbenchWindow().getShell(), CVSMergeSubscriber.ID_MODAL, participant, s.roots()) {
- protected CompareDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
- return new CompareDialog(shell, title, input) {
+ protected ParticipantCompareDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
+ return new ParticipantCompareDialog(shell, title, input) {
public boolean close() {
final IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
if(! isRememberParticipant() && store.getBoolean(ICVSUIConstants.PREF_PROMPT_ON_MIXED_TAGS)) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
index 01a775c3e..3ff4dd5e2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
@@ -24,6 +24,7 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.viewers.*;
import org.eclipse.ui.progress.UIJob;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
index 55d7aebb1..47e0cd2fb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipantPage.java
@@ -14,11 +14,11 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.SynchronizeModelProvider;
import org.eclipse.team.internal.ui.synchronize.actions.RemoveSynchronizeParticipantAction;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
import org.eclipse.team.ui.synchronize.subscriber.SynchronizeViewerAdvisor;
-import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider;
import org.eclipse.ui.IActionBars;
public class CompareParticipantPage extends CVSSynchronizeViewPage {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
index 0a02d8a62..786d85898 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompressedFoldersModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompressedFoldersModelProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import java.util.*;
@@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.viewers.*;
public class CompressedFoldersModelProvider extends HierarchicalModelProvider {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
index a537e8da4..7ecfb3a56 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/HierarchicalModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/HierarchicalModelProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.ui.synchronize.viewers.*;
/**
* An input that can be used with both {@link } and
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index adad5a7cd..65541050f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -10,51 +10,18 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.io.*;
+import java.util.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantDescriptor;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantRegistry;
import org.eclipse.team.ui.ITeamUIConstants;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.*;
/**
* Manages the registered synchronize participants. It handles notification of
@@ -300,13 +267,6 @@ public class SynchronizeManager implements ISynchronizeManager {
}
return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.ISynchronizeManager#getParticipantDescriptors()
- */
- public ISynchronizeParticipantDescriptor[] getParticipantDescriptors() {
- return participantRegistry.getSynchronizeParticipants();
- }
/*
* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
index e6d9a38c7..576117caf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeModelProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.viewers;
+package org.eclipse.team.internal.ui.synchronize;
import java.util.*;
@@ -27,6 +27,7 @@ import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.viewers.*;
import org.eclipse.ui.progress.UIJob;
/**
@@ -43,7 +44,7 @@ import org.eclipse.ui.progress.UIJob;
* @see CompressedFoldersModelProvider
* @since 3.0
*/
-public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeListener {
+public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeListener, ISynchronizeModelProvider {
// Flasg to indicate if tree control should be updated while
// building the model.
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 22de9ef87..8d8ed7604 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
@@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
import org.eclipse.ui.texteditor.IUpdate;
@@ -38,18 +37,18 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
}
class RefreshParticipantAction extends Action {
- private ISynchronizeParticipantDescriptor participantDescriptor;
+ private ISynchronizeParticipant participant;
public void run() {
- GlobalSynchronizeWizard wizard = new GlobalSynchronizeWizard(participantDescriptor);
+ GlobalSynchronizeWizard wizard = new GlobalSynchronizeWizard();
SynchronizeWizardDialog dialog = new SynchronizeWizardDialog(window.getShell(), wizard);
dialog.open();
}
- public RefreshParticipantAction(int prefix, ISynchronizeParticipantDescriptor participantDescriptor) {
- super("&" + prefix + " " + participantDescriptor.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- this.participantDescriptor = participantDescriptor;
- setImageDescriptor(participantDescriptor.getImageDescriptor());
+ public RefreshParticipantAction(int prefix, ISynchronizeParticipant participant) {
+ super("&" + prefix + " " + participant.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ this.participant = participant;
+ setImageDescriptor(participant.getImageDescriptor());
}
}
@@ -95,9 +94,9 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
fMenu.dispose();
}
fMenu = new Menu(parent);
- ISynchronizeParticipantDescriptor[] descriptions = TeamUI.getSynchronizeManager().getParticipantDescriptors();
- for (int i = 0; i < descriptions.length; i++) {
- ISynchronizeParticipantDescriptor description = descriptions[i];
+ ISynchronizeParticipant[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+ for (int i = 0; i < participants.length; i++) {
+ ISynchronizeParticipant description = participants[i];
if (description.doesSupportRefresh()) {
Action action = new RefreshParticipantAction(i + 1, description);
addActionToMenu(fMenu, action);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshParticipantSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshParticipantSelectionPage.java
new file mode 100644
index 000000000..ab3e73784
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshParticipantSelectionPage.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.team.ui.IConfigurationWizard;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.*;
+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 participant
+ *
+ * @since 3.0
+ */
+public class GlobalRefreshParticipantSelectionPage extends WizardPage {
+
+ private TableViewer fViewer;
+ private ISynchronizeParticipantDescriptor selectedParticipantDescriptor;
+ private IWizard wizard;
+
+ class MyContentProvider extends BaseWorkbenchContentProvider {
+ public Object[] getChildren(Object element) {
+ if(element instanceof ISynchronizeManager) {
+ List participants = new ArrayList();
+ ISynchronizeManager manager = (ISynchronizeManager)element;
+ ISynchronizeParticipant[] desciptors = manager.getSynchronizeParticipants();
+ for (int i = 0; i < desciptors.length; i++) {
+ ISynchronizeParticipant descriptor = desciptors[i];
+ if(descriptor.doesSupportRefresh()) {
+ participants.add(descriptor);
+ }
+ }
+ return (ISynchronizeParticipantDescriptor[]) participants.toArray(new ISynchronizeParticipantDescriptor[participants.size()]);
+ }
+ return super.getChildren(element);
+ }
+ }
+
+ class MyLabelProvider extends WorkbenchLabelProvider {
+ public String decorateText(Object element) {
+ if(element instanceof ISynchronizeParticipant) {
+ ISynchronizeParticipant descriptor = (ISynchronizeParticipant)element;
+ return descriptor.getName();
+ }
+ return null;
+ }
+
+ public ImageDescriptor decorateImage(Object element) {
+ if(element instanceof ISynchronizeParticipant) {
+ ISynchronizeParticipant descriptor = (ISynchronizeParticipant)element;
+ return descriptor.getImageDescriptor();
+ }
+ return null;
+ }
+ }
+
+ public GlobalRefreshParticipantSelectionPage() {
+ super("Synchronize");
+ setDescription("Select the participant to synchronize");
+ setTitle("Select a Synchronize Participant");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent2) {
+ Composite top = new Composite(parent2, SWT.NULL);
+ top.setLayout(new GridLayout());
+ setControl(top);
+
+ Label l = new Label(parent2, SWT.NULL);
+ l.setText("Available synchronize participants:");
+ fViewer = new TableViewer(top, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ fViewer.getControl().setLayoutData(data);
+ fViewer.setContentProvider(new MyContentProvider());
+ fViewer.setLabelProvider(new MyLabelProvider());
+ fViewer.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ fViewer.setInput(TeamUI.getSynchronizeManager());
+ fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Initialize the wizard so we can tell whether to enable the
+ // Next button
+ ISelection selection = event.getSelection();
+ if (selection == null || !(selection instanceof IStructuredSelection)) {
+ wizard = null;
+ setPageComplete(false);
+ return;
+ }
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() != 1) {
+ wizard = null;
+ setPageComplete(false);
+ return;
+ }
+ ISynchronizeParticipant participant = (ISynchronizeParticipant)ss.getFirstElement();
+ wizard = (IConfigurationWizard) participant.createRefreshPage();
+ wizard.addPages();
+ // Ask the container to update button enablement
+ setPageComplete(true);
+ }
+ });
+
+ fViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ getWizard().getContainer().showPage(getNextPage());
+ }
+ });
+ Dialog.applyDialogFont(parent2);
+ }
+
+ public IWizard getSelectedWizard() {
+ return this.wizard;
+ }
+
+ /**
+ * The <code>WizardSelectionPage</code> implementation of
+ * this <code>IWizardPage</code> method returns the first page
+ * of the currently selected wizard if there is one.
+ *
+ * @see WizardPage#getNextPage
+ */
+ public IWizardPage getNextPage() {
+ if (wizard == null) return null;
+ return wizard.getStartingPage();
+ }
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ fViewer.getTable().setFocus();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshResourceSelectionPage.java
index dc91c56e7..e44b9d458 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshResourceSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshResourceSelectionPage.java
@@ -73,9 +73,13 @@ public class GlobalRefreshResourceSelectionPage extends WizardPage {
public GlobalRefreshResourceSelectionPage(SubscriberParticipant participant) {
super("Synchronize");
- this.participant = participant;
setDescription("Select the resource to synchronize");
setTitle("Synchronize");
+ setParticipant(participant);
+ }
+
+ public void setParticipant(SubscriberParticipant participant) {
+ this.participant = participant;
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalSynchronizeWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalSynchronizeWizard.java
index b045e5c39..558bd9751 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalSynchronizeWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalSynchronizeWizard.java
@@ -10,36 +10,114 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize.actions;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.ui.IWorkbench;
+/**
+ * The wizard for synchronizing a synchronize participant.
+ *
+ * @since 3.0
+ */
public class GlobalSynchronizeWizard extends Wizard {
- private ISynchronizeParticipantDescriptor participantDescriptor;
- private GlobalRefreshResourceSelectionPage selectionPage;
-
- public GlobalSynchronizeWizard(ISynchronizeParticipantDescriptor participantDescriptor) {
- this.participantDescriptor = participantDescriptor;
- setWindowTitle("Team Synchronize");
+ protected IWorkbench workbench;
+ protected IWizard wizard;
+ protected GlobalRefreshParticipantSelectionPage mainPage;
+ private String pluginId = TeamUIPlugin.PLUGIN_ID;
+
+ public GlobalSynchronizeWizard() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("Synchronize"); //$NON-NLS-1$
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#addPages()
+
+ /*
+ * @see Wizard#addPages
*/
public void addPages() {
- if(participantDescriptor == null) {
- // addPage();
+ ISynchronizeParticipant[] participants = getParticipants();
+ if (participants.length == 1) {
+ // If there is only one wizard, skip the first page.
+ // Only skip the first page if the one wizard has at least one
+ // page.
+ IWizard wizard = participants[0].createRefreshPage();
+ wizard.addPages();
+ if (wizard.getPageCount() > 0) {
+ wizard.setContainer(getContainer());
+ IWizardPage[] pages = wizard.getPages();
+ for (int i = 0; i < pages.length; i++) {
+ addPage(pages[i]);
+ }
+ return;
+ }
+ }
+ mainPage = new GlobalRefreshParticipantSelectionPage();
+ addPage(mainPage);
+ }
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (wizard != null) {
+ return wizard.getNextPage(page);
+ }
+ return super.getNextPage(page);
+ }
+
+ public boolean canFinish() {
+ // If we are on the first page, never allow finish unless the selected
+ // wizard has no pages.
+ if (getContainer().getCurrentPage() == mainPage) {
+ if (mainPage.getSelectedWizard() != null && mainPage.getNextPage() == null) {
+ return true;
+ }
+ return false;
+ }
+ if (wizard != null) {
+ return wizard.canFinish();
}
- selectionPage = new GlobalRefreshResourceSelectionPage();
- addPage(selectionPage);
+ return super.canFinish();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
+
+ /*
+ * @see Wizard#performFinish
*/
public boolean performFinish() {
- // TODO Auto-generated method stub
- return false;
+ // There is only one wizard with at least one page
+ if (wizard != null) {
+ return wizard.performFinish();
+ }
+ // If we are on the first page and the selected wizard has no pages
+ // then
+ // allow it to finish.
+ if (getContainer().getCurrentPage() == mainPage) {
+ IWizard noPageWizard = mainPage.getSelectedWizard();
+ if (noPageWizard != null) {
+ if (noPageWizard.canFinish()) {
+ return noPageWizard.performFinish();
+ }
+ }
+ }
+ // If the wizard has pages and there are several
+ // wizards registered then the registered wizard
+ // will call it's own performFinish().
+ return true;
+ }
+
+ protected ISynchronizeParticipant[] getParticipants() {
+ List participants = new ArrayList();
+ ISynchronizeManager manager = (ISynchronizeManager) TeamUI.getSynchronizeManager();
+ ISynchronizeParticipant[] desciptors = manager.getSynchronizeParticipants();
+ for (int i = 0; i < desciptors.length; i++) {
+ ISynchronizeParticipant descriptor = desciptors[i];
+ if (descriptor.doesSupportRefresh()) {
+ participants.add(descriptor);
+ }
+ }
+ return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
index 7da095d8d..e47ac342c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
@@ -19,6 +19,7 @@ import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.registry.SynchronizeParticipantDescriptor;
import org.eclipse.team.ui.TeamImages;
+import org.eclipse.team.ui.TeamUI;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
@@ -118,6 +119,14 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
return true;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#doesSupportRefresh()
+ */
+ public boolean doesSupportRefresh() {
+ ISynchronizeParticipantDescriptor d = TeamUI.getSynchronizeManager().getParticipantDescriptor(getId());
+ return d == null ? false : d.doesSupportRefresh();
+ }
+
/*
* (non-Javadoc)
*
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
index d32d72620..9c5cdbebc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
@@ -87,11 +87,4 @@ public interface ISynchronizeManager {
* <code>null</code> if a descriptor is not found for that id.
*/
public ISynchronizeParticipantDescriptor getParticipantDescriptor(String id);
-
- /**
- * Returns the descriptions of the registered synchronize participants.
- *
- * @return the descriptions of the registered synchronize participants.
- */
- public ISynchronizeParticipantDescriptor[] getParticipantDescriptors();
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
index c34b7fadd..d205da6ea 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
@@ -101,7 +102,14 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* Creates and returns a wizard page used to globally refresh this participant.
*
*/
- public IWizardPage createRefreshPage();
+ public IWizard createRefreshPage();
+
+ /**
+ * Returns if this participant supports a global refresh action.
+ *
+ * @return if this participant supports a global refresh action.
+ */
+ public boolean doesSupportRefresh();
/**
* Initializes this participant with the given participant state.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/OpenCompareDialogAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/OpenCompareDialogAction.java
index fb3e1fad3..451699fda 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/OpenCompareDialogAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/OpenCompareDialogAction.java
@@ -112,13 +112,13 @@ public class OpenCompareDialogAction {
} catch (InvocationTargetException e) {
Utils.handle(e);
}
- CompareDialog dialog = createCompareDialog(getShell(), participant.getName(), input);
+ ParticipantCompareDialog dialog = createCompareDialog(getShell(), participant.getName(), input);
dialog.setSynchronizeParticipant(participant);
dialog.setBlockOnOpen(true);
dialog.open();
}
- protected CompareDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
- return new CompareDialog(shell, title, input);
+ protected ParticipantCompareDialog createCompareDialog(Shell shell, String title, CompareEditorInput input) {
+ return new ParticipantCompareDialog(shell, title, input);
}
}
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 d53c94b13..511da0b89 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
@@ -11,17 +11,15 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
-import org.eclipse.team.internal.ui.synchronize.actions.GlobalRefreshResourceSelectionPage;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
import org.eclipse.ui.*;
@@ -107,8 +105,8 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#createRefreshPage()
*/
- public IWizardPage createRefreshPage() {
- return new GlobalRefreshResourceSelectionPage(this);
+ public IWizard createRefreshPage() {
+ return null; //new GlobalRefreshResourceSelectionPage(this);
}
public void setMode(int mode) {
@@ -207,7 +205,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
/**
* This method is invoked just before the collector is started.
- * This gives an opertunity to configure the collector parameters
+ * This gives an oportunity to configure the collector parameters
* before collection starts. The default implementation sets the working
* set as returned by <code>getWorkingSet()</code> and sets the mode
* as returned by <code>getMode()</code>.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
index cbe3e8a37..189aa111f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelChangeListener.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
-
/**
- * Listener that gets informed when the <code>DiffNode</code> model created
- * by the configurator is created or updated.
+ * Listener that gets informed when the model created by the model provider is created or updated.
* <p>
* Clients may implement this interface.
* </p>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
new file mode 100644
index 000000000..63a204a80
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ISynchronizeModelProvider.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.ui.synchronize.viewers;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.team.core.synchronize.SyncInfoSet;
+
+/**
+ * This class represents provisional API. A provider is not required to
+ * implement this API. Implementers, and those who reference it, do so with the
+ * awareness that this class may be removed or substantially changed at future
+ * times without warning.
+ */
+public interface ISynchronizeModelProvider {
+
+ public abstract SyncInfoSet getSyncInfoSet();
+
+ /**
+ * Return the <code>AbstractTreeViewer</code> asociated with this content
+ * provider or <code>null</code> if the viewer is not of the proper type.
+ * @return
+ */
+ public abstract StructuredViewer getViewer();
+
+ public abstract void setViewer(StructuredViewer viewer);
+
+ /**
+ * Builds the viewer model based on the contents of the sync set.
+ */
+ public abstract SynchronizeModelElement prepareInput(IProgressMonitor monitor);
+
+ /**
+ * The provider can try and return a mapping for the provided object. Providers often use mappings
+ * to store the source of a logical element they have created. For example, when displaying resource
+ * based logical elements, a provider will cache the resource -> element mapping for quick retrieval
+ * of the element when resource based changes are made.
+ *
+ * @param object the object to query for a mapping
+ * @return an object created by this provider that would be shown in a viewer, or <code>null</code>
+ * if the provided object is not mapped by this provider.
+ */
+ public abstract Object getMapping(Object object);
+
+ /**
+ * Dispose of the builder
+ */
+ public abstract void dispose();
+
+ /**
+ * Returns the input created by this controller or <code>null</code> if
+ * {@link #prepareInput(IProgressMonitor)} hasn't been called on this object yet.
+ * @return
+ */
+ public abstract SynchronizeModelElement getModelRoot();
+
+ public abstract ViewerSorter getViewerSorter();
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ParticipantCompareDialog.java
index beef71402..b59b1ec19 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/ParticipantCompareDialog.java
@@ -26,11 +26,24 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
/**
- * A compare dialog that displays a comparison.
+ * A dialog that displays a synchronize participant. There are some cases when it
+ * is more appropriate to display synchronization information in a dialog instead of
+ * in the Synchronize View. This class provides a modal context in which to show
+ * this.
+ * <p>
+ * To allow a user to transfer this synchronization state to the Synchronize View simply
+ * set the participant.
+ * </p><p>
+ * The dialog tracks changes made in the content merge viewers, displays a change
+ * indication and will ensure that changes are saved when the dialog is closed.
+ * </p><p>
+ * Buffered or un-buffered compare editor inputs are supported.
+ * </p>
*
+ * @see SynchronizeCompareInput
* @since 3.0
*/
-public class CompareDialog extends ResizableDialog implements IPropertyChangeListener {
+public class ParticipantCompareDialog extends ResizableDialog implements IPropertyChangeListener {
private CompareEditorInput fCompareEditorInput;
private ISynchronizeParticipant participant;
@@ -39,7 +52,15 @@ public class CompareDialog extends ResizableDialog implements IPropertyChangeLis
private String title;
private boolean isDirty = false;
- public CompareDialog(Shell shell, String title, CompareEditorInput input) {
+ /**
+ * Creates a dialog with the given title and input. The input is not created until the dialog
+ * is opened.
+ *
+ * @param shell the parent shell or <code>null</code> to create a top level shell.
+ * @param title the shell's title
+ * @param input the compare input to show in the dialog
+ */
+ public ParticipantCompareDialog(Shell shell, String title, CompareEditorInput input) {
super(shell, null);
this.title = title;
Assert.isNotNull(input);
@@ -50,19 +71,6 @@ public class CompareDialog extends ResizableDialog implements IPropertyChangeLis
public void setSynchronizeParticipant(ISynchronizeParticipant participant) {
this.participant = participant;
}
-
- public void propertyChange(PropertyChangeEvent event) {
- if (fCompareEditorInput != null) {
- if(fCompareEditorInput.isSaveNeeded()) {
- // the dirty flag is required because there is a compare bug that causes the dirty bit to be reset sometimes
- // although the underlying compare editor input is still dirty.
- isDirty = true;
- getShell().setText(title + " *");
- } else {
- getShell().setText(title);
- }
- }
- }
/* (non-Javadoc)
* Method declared on Dialog.
@@ -124,6 +132,19 @@ public class CompareDialog extends ResizableDialog implements IPropertyChangeLis
}
}
+ public void propertyChange(PropertyChangeEvent event) {
+ if (fCompareEditorInput != null) {
+ if(fCompareEditorInput.isSaveNeeded()) {
+ // the dirty flag is required because there is a compare bug that causes the dirty bit to be reset sometimes
+ // although the underlying compare editor input is still dirty.
+ isDirty = true;
+ getShell().setText(title + " *"); //$NON-NLS-1$
+ } else {
+ getShell().setText(title);
+ }
+ }
+ }
+
protected Object getParticipant() {
return participant;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
index 1cf3a918e..349779458 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
@@ -30,6 +30,7 @@ import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
index eba4fbc78..a9bb02297 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/TreeViewerAdvisor.java
@@ -31,6 +31,7 @@ import org.eclipse.team.core.synchronize.SyncInfoTree;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
@@ -172,7 +173,6 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor implements IPrope
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#getDiffNodeController()
*/

Back to the top