Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2007-10-15 10:44:35 -0400
committerTomasz Zarna2007-10-15 10:44:35 -0400
commitcb086225847c6abf1890a540af8d16e03f2f56be (patch)
tree0dd68a3ffe26d86ce385f61b7a875d1950bc7abf
parent0a4d9299bc5aa20f744a3e2c9710d3a15422a52c (diff)
downloadeclipse.platform.team-bug_193324.tar.gz
eclipse.platform.team-bug_193324.tar.xz
eclipse.platform.team-bug_193324.zip
sync with HEADbug_193324
-rw-r--r--bundles/org.eclipse.team.ui/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties4
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml29
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java37
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ConfigureProjectAction.java37
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenRevisionAction.java68
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CommonViewerAdvisor.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/StreamMergerDelegate.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/ResourceModelPreferencePage.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractTreeViewerAdvisor.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractViewerAdvisor.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ImageManager.java66
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StartupPreferencePage.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java82
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigurationWizardElement.java67
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureMultipleProjectsWizard.java52
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizard.java157
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java47
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSelectionPage.java140
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizardExtension.java44
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java6
41 files changed, 735 insertions, 318 deletions
diff --git a/bundles/org.eclipse.team.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.team.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 000000000..cc9538672
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,15 @@
+#Mon Aug 06 13:03:58 CEST 2007
+compilers.incompatible-environment=1
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.missing-packages=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
index 5db655790..7406697d2 100644
--- a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.ui; singleton:=true
-Bundle-Version: 3.3.100.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: org.eclipse.team.internal.ui.TeamUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index ee665d6af..2b6db79c0 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -80,4 +80,6 @@ CompareLocalHistory.tooltip= Compare the Selected Resource with Local History
ReplaceLocalHistory.label= &Local History...
ReplaceLocalHistory.tooltip= Replace the Selected Resource with Local History
CompareWithEachOtherAction.label= &Each Other
-CompareWithEachOtherAction.tooltip= Compare the Selected Resources \ No newline at end of file
+CompareWithEachOtherAction.tooltip= Compare the Selected Resources
+
+ignoresTransferName= Team Ignored Resources Transfer \ 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 a2a3a1211..f2c154db1 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -174,6 +174,7 @@
class="org.eclipse.team.internal.ui.actions.ApplyPatchAction"
menubarPath="team.main/group1"
enablesFor="*"
+ definitionId="org.eclipse.team.ui.applyPatch"
id="org.eclipse.team.ui.applyPatch">
</action>
</objectContribution>
@@ -337,12 +338,34 @@
<extension
point="org.eclipse.ui.bindings">
<key
- sequence="M3+M2+Q Y"
+ sequence="M2+M3+Q Y"
+ contextId="org.eclipse.ui.globalScope"
+ commandId="org.eclipse.team.sync.views.SynchronizeView"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key
+ platform="carbon"
+ sequence="M2+M3+Q Y"
+ contextId="org.eclipse.ui.globalScope"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key
+ platform="carbon"
+ sequence="M1+M3+Q Y"
contextId="org.eclipse.ui.globalScope"
commandId="org.eclipse.team.sync.views.SynchronizeView"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
<key
- sequence="M3+M2+Q Z"
+ sequence="M2+M3+Q Z"
+ contextId="org.eclipse.ui.globalScope"
+ commandId="org.eclipse.team.ui.GenericHistoryView"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key
+ platform="carbon"
+ sequence="M2+M3+Q Z"
+ contextId="org.eclipse.ui.globalScope"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key
+ platform="carbon"
+ sequence="M1+M3+Q Z"
contextId="org.eclipse.ui.globalScope"
commandId="org.eclipse.team.ui.GenericHistoryView"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
@@ -522,7 +545,7 @@
<transfer
id="org.eclipse.team.transfer.ignores"
icon="$nl$/icons/full/obj/ignoreprefs.gif"
- name="Team Ignored Resources Transfer ">
+ name="%ignoresTransferName">
<mapping
scope="instance">
<entry
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
index d2623998e..ed2c6d44b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
@@ -21,6 +21,8 @@ public interface IHelpContextIds {
public static final String MODEL_PREFERENCE_PAGE = PREFIX + "model_preference_page_context"; //$NON-NLS-1$
public static final String FILE_TYPE_PREFERENCE_PAGE = PREFIX + "file_type_preference_page_context"; //$NON-NLS-1$
public static final String SYNC_PREFERENCE_PAGE = PREFIX + "sync_preference_page_context"; //$NON-NLS-1$
+ public static final String SYNC_STARTUP_PREFERENCE_PAGE = PREFIX + "sync_startup_preference_page_context"; //$NON-NLS-1$
+ public static final String RESOURCE_MODEL_PREFERENCE_PAGE = PREFIX + "resource_model_preference_page_context"; //$NON-NLS-1$
// Wizard Pages
public static final String SHARE_PROJECT_PAGE = PREFIX + "share_project_page_context"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
index db3782fb7..ed39608ec 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java
@@ -21,6 +21,16 @@ public class TeamUIMessages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, TeamUIMessages.class);
}
+ public static String ConfigureMultipleProjectsWizard_0;
+
+ public static String ConfigureMultipleProjectsWizard_1;
+
+ public static String ProjectSelectionPage_0;
+
+ public static String ProjectSelectionPage_1;
+
+ public static String ProjectSelectionPage_2;
+
public static String TextPreferencePage_ExtensionNotCompleted;
public static String CompareInputChangeNotifier_0;
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 7c295b544..2563b90dc 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
@@ -55,11 +55,28 @@ import org.eclipse.ui.*;
import org.eclipse.ui.ide.IContributorResourceAdapter2;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ErrorEditorPart;
+import org.eclipse.ui.internal.registry.EditorDescriptor;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
public class Utils {
/**
+ * Constant used to indicate that tests are being run. This field
+ * should be the same as the corresponding field on
+ * org.eclipse.compare.internal.Utilities
+ */
+ public static boolean RUNNING_TESTS = false;
+
+ /**
+ * Constant used while testing the indicate that changes should be flushed
+ * when the compare input changes and a viewer is dirty. This field
+ * should be the same as the corresponding field on
+ * org.eclipse.compare.internal.Utilities
+ */
+ public static boolean TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE = false;
+
+ /**
* The SortOperation takes a collection of objects and returns a sorted
* collection of these objects. Concrete instances of this class provide
* the criteria for the sorting of the objects based on the type of the
@@ -963,6 +980,25 @@ public class Utils {
return traversal.asTraversals();
}
+ /**
+ * Return whether the editor associated with a descriptor is a text editor
+ * (i.e. an instance of AbstractDecoratedTextEditor).
+ * See bug 99568 for a request to move the createEditor method to IEditorDescriptor.
+ * @param descriptor
+ * @return whether the editor associated with a descriptor is a text editor
+ * @throws CoreException
+ */
+ public static boolean isTextEditor(IEditorDescriptor descriptor)
+ throws CoreException {
+ if (descriptor instanceof EditorDescriptor) {
+ EditorDescriptor desc = (EditorDescriptor) descriptor;
+ IEditorPart editor= desc.createEditor();
+ editor.dispose();
+ return editor instanceof AbstractDecoratedTextEditor;
+ }
+ return false;
+ }
+
public static IEditorPart openEditor(IWorkbenchPage page, IFileRevision revision, IProgressMonitor monitor) throws CoreException {
IStorage file = revision.getStorage(monitor);
if (file instanceof IFile) {
@@ -981,6 +1017,7 @@ public class Utils {
String id = getEditorId(editorInput);
try {
IEditorPart part = page.openEditor(editorInput, id);
+ // See bug 90582 for the reasons behind this discouraged access
if (part instanceof ErrorEditorPart) {
page.closeEditor(part, false);
part = null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java
index 0b78a20cc..0a7debb55 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.patch.ApplyPatchOperation;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -21,6 +20,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
public class ApplyPatchAction extends TeamAction {
@@ -40,7 +40,7 @@ public class ApplyPatchAction extends TeamAction {
try {
isPatch = ApplyPatchOperation.isPatch((IFile)resource);
} catch (CoreException e) {
- CompareUIPlugin.log(e);
+ TeamUIPlugin.log(e);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java
index 139e36bd5..f78ac5fa2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/CompareRevisionAction.java
@@ -35,16 +35,21 @@ public class CompareRevisionAction extends BaseSelectionListenerAction {
IStructuredSelection selection;
IFileRevision currentFileRevision;
- public CompareRevisionAction(String text) {
+ public CompareRevisionAction(String text, HistoryPage page) {
super(text);
+ this.page = page;
}
- public CompareRevisionAction() {
- this(TeamUIMessages.LocalHistoryPage_CompareAction);
+ public CompareRevisionAction(HistoryPage page) {
+ this(TeamUIMessages.LocalHistoryPage_CompareAction, page);
}
public void run() {
IStructuredSelection structSel = selection;
+
+ if (structSel == null)
+ return;
+
Object[] objArray = structSel.toArray();
IFileRevision file1 = null;
@@ -198,9 +203,6 @@ public class CompareRevisionAction extends BaseSelectionListenerAction {
return false;
}
- public void setPage(HistoryPage page) {
- this.page = page;
- }
private boolean shouldShow() {
IStructuredSelection structSel = selection;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ConfigureProjectAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ConfigureProjectAction.java
index 5d3674591..3f2d8d936 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ConfigureProjectAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ConfigureProjectAction.java
@@ -17,28 +17,16 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
/**
* Action for configuring a project. Configuring involves associating
* the project with a Team provider and performing any provider-specific
* configuration that is necessary.
*/
-public class ConfigureProjectAction extends TeamAction implements IWorkbenchWindowActionDelegate {
- private static class ResizeWizardDialog extends WizardDialog {
- public ResizeWizardDialog(Shell parentShell, IWizard newWizard) {
- super(parentShell, newWizard);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
- }
+public class ConfigureProjectAction extends TeamAction {
protected void execute(IAction action) throws InvocationTargetException,
InterruptedException {
@@ -47,11 +35,8 @@ public class ConfigureProjectAction extends TeamAction implements IWorkbenchWind
try {
if (!isEnabled())
return;
- IProject project = getSelectedProjects()[0];
- ConfigureProjectWizard wizard = new ConfigureProjectWizard();
- wizard.init(null, project);
- WizardDialog dialog = new ResizeWizardDialog(getShell(), wizard);
- dialog.open();
+ IProject[] projects = getSelectedProjects();
+ ConfigureProjectWizard.shareProjects(getShell(), projects);
} catch (Exception e) {
throw new InvocationTargetException(e);
}
@@ -64,15 +49,11 @@ public class ConfigureProjectAction extends TeamAction implements IWorkbenchWind
*/
public boolean isEnabled() {
IProject[] selectedProjects = getSelectedProjects();
- if (selectedProjects.length != 1) return false;
- if (!selectedProjects[0].isAccessible()) return false;
- if (!RepositoryProvider.isShared(selectedProjects[0])) return true;
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
+ for (int i = 0; i < selectedProjects.length; i++) {
+ IProject project = selectedProjects[i];
+ if (!project.isAccessible()) return false;
+ if (RepositoryProvider.isShared(project)) return false;
+ }
+ return selectedProjects.length > 0;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenRevisionAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenRevisionAction.java
index 8eadf2512..04d53a5d9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenRevisionAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/OpenRevisionAction.java
@@ -32,46 +32,50 @@ public class OpenRevisionAction extends BaseSelectionListenerAction {
private IStructuredSelection selection;
private HistoryPage page;
- public OpenRevisionAction(String text) {
+ public OpenRevisionAction(String text, HistoryPage page) {
super(text);
+ this.page = page;
}
public void run() {
- IStructuredSelection structSel = selection;
+ IStructuredSelection structSel = selection;
- Object[] objArray = structSel.toArray();
+ if (structSel == null)
+ return;
+
+ Object[] objArray = structSel.toArray();
- for (int i = 0; i < objArray.length; i++) {
- Object tempRevision = objArray[i];
- //If not a revision, don't try opening
- if (tempRevision instanceof AbstractHistoryCategory)
- continue;
-
- final IFileRevision revision = (IFileRevision) tempRevision;
- if (revision == null || !revision.exists()) {
- MessageDialog.openError(page.getSite().getShell(), TeamUIMessages.OpenRevisionAction_DeletedRevTitle, TeamUIMessages.OpenRevisionAction_DeletedRevMessage);
- } else {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- Utils.openEditor(page.getSite().getPage(), revision, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
-
+ for (int i = 0; i < objArray.length; i++) {
+ Object tempRevision = objArray[i];
+ //If not a revision, don't try opening
+ if (tempRevision instanceof AbstractHistoryCategory)
+ continue;
+
+ final IFileRevision revision = (IFileRevision) tempRevision;
+ if (revision == null || !revision.exists()) {
+ MessageDialog.openError(page.getSite().getShell(), TeamUIMessages.OpenRevisionAction_DeletedRevTitle, TeamUIMessages.OpenRevisionAction_DeletedRevMessage);
+ } else {
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ Utils.openEditor(page.getSite().getPage(), revision, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
}
- };
-
- IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
- try {
- progressService.run(false, false, runnable);
- } catch (InvocationTargetException e) {
- Utils.handleError(page.getSite().getShell(), e, TeamUIMessages.OpenRevisionAction_ErrorTitle, TeamUIMessages.OpenRevisionAction_ErrorMessage);
- } catch (InterruptedException e) {
+
}
- }
+ };
+ IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
+ try {
+ progressService.run(false, false, runnable);
+ } catch (InvocationTargetException e) {
+ Utils.handleError(page.getSite().getShell(), e, TeamUIMessages.OpenRevisionAction_ErrorTitle, TeamUIMessages.OpenRevisionAction_ErrorMessage);
+ } catch (InterruptedException e) {
+ }
}
+
+ }
}
protected boolean updateSelection(IStructuredSelection selection) {
@@ -79,10 +83,6 @@ public class OpenRevisionAction extends BaseSelectionListenerAction {
return shouldShow();
}
- public void setPage(HistoryPage page) {
- this.page = page;
- }
-
private boolean shouldShow() {
IStructuredSelection structSel = selection;
Object[] objArray = structSel.toArray();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
index ca9e3f846..6c215a396 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
@@ -15,7 +15,6 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.compare.internal.TabFolderLayout;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
@@ -141,7 +140,6 @@ public class PreferencePageContainerDialog extends TrayDialog
private void createMultiplePageArea(Composite composite) {
// create a tab folder for the page
tabFolder = new TabFolder(composite, SWT.NONE);
- tabFolder.setLayout(new TabFolderLayout());
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
for (int i = 0; i < pages.length; i++) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
index 957f93bd5..42d3d86aa 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/EditionHistoryPage.java
@@ -12,9 +12,8 @@ package org.eclipse.team.internal.ui.history;
import java.util.*;
+import org.eclipse.compare.CompareUI;
import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.StructureCreatorDescriptor;
import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -27,8 +26,7 @@ import org.eclipse.team.internal.core.history.LocalFileHistory;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.actions.CompareRevisionAction;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
-import org.eclipse.team.ui.history.IHistoryPage;
-import org.eclipse.team.ui.history.IHistoryPageSite;
+import org.eclipse.team.ui.history.*;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -51,6 +49,10 @@ public class EditionHistoryPage extends LocalHistoryPage {
class CompareEditionAction extends CompareRevisionAction {
+ public CompareEditionAction(HistoryPage page) {
+ super(page);
+ }
+
protected ITypedElement getElementFor(IResource resource) {
if (resource.equals(file))
return localFileElement;
@@ -130,7 +132,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
public static ITypedElement getPreviousState(IFile file, Object element) throws TeamException {
LocalResourceTypedElement localFileElement= new LocalResourceTypedElement(file);
- IStructureCreator structureCreator = getStructureCreator(localFileElement);
+ IStructureCreator structureCreator = CompareUI.createStructureCreator(localFileElement);
if (structureCreator == null)
return null;
LocalFileHistory history = new LocalFileHistory(file, false);
@@ -155,14 +157,6 @@ public class EditionHistoryPage extends LocalHistoryPage {
}
return null;
}
-
- private static IStructureCreator getStructureCreator(ITypedElement element) {
- StructureCreatorDescriptor scd= CompareUIPlugin.getDefault().getStructureCreator(element.getType());
- if (scd != null) {
- return scd.createStructureCreator();
- }
- return null;
- }
public EditionHistoryPage(IFile file, Object element) {
super(ON | ALWAYS);
@@ -171,7 +165,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
this.file = file;
this.element = element;
this.localFileElement= new LocalResourceTypedElement(getFile());
- structureCreator = getStructureCreator(localFileElement);
+ structureCreator = CompareUI.createStructureCreator(localFileElement);
}
public void setSite(IHistoryPageSite site) {
@@ -407,7 +401,7 @@ public class EditionHistoryPage extends LocalHistoryPage {
* @see org.eclipse.team.internal.ui.history.LocalHistoryPage#createCompareAction()
*/
protected CompareRevisionAction createCompareAction() {
- return new CompareEditionAction();
+ return new CompareEditionAction(this);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
index 663d562fd..6df698bb5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/FileRevisionEditorInput.java
@@ -11,6 +11,7 @@
package org.eclipse.team.internal.ui.history;
import java.io.InputStream;
+import java.net.URI;
import java.util.Date;
import org.eclipse.core.resources.*;
@@ -20,8 +21,7 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.*;
import org.eclipse.ui.model.IWorkbenchAdapter;
import com.ibm.icu.text.DateFormat;
@@ -169,4 +169,12 @@ public class FileRevisionEditorInput extends PlatformObject implements IWorkbenc
return null;
}
+ public URI getURI() {
+ if (fileRevision instanceof IFileRevision) {
+ IFileRevision fr = (IFileRevision) fileRevision;
+ return fr.getURI();
+ }
+ return null;
+ }
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
index 1c49e9e5b..272c62a0e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/LocalHistoryPage.java
@@ -367,23 +367,23 @@ public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdap
// Click Compare action
compareAction = createCompareAction();
+ compareAction.setEnabled(!treeViewer.getSelection().isEmpty());
treeViewer.getTree().addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
compareAction.setCurrentFileRevision(getCurrentFileRevision());
compareAction.selectionChanged((IStructuredSelection) treeViewer.getSelection());
}
});
- compareAction.setPage(this);
// Only add the open action if compare mode is not always on
if (!((compareMode & (ALWAYS | ON)) == (ALWAYS | ON))) {
- openAction = new OpenRevisionAction(TeamUIMessages.LocalHistoryPage_OpenAction);
+ openAction = new OpenRevisionAction(TeamUIMessages.LocalHistoryPage_OpenAction, this);
+ openAction.setEnabled(!treeViewer.getSelection().isEmpty());
treeViewer.getTree().addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
openAction.selectionChanged((IStructuredSelection) treeViewer.getSelection());
}
});
- openAction.setPage(this);
}
OpenStrategy handler = new OpenStrategy(treeViewer.getTree());
@@ -453,7 +453,7 @@ public class LocalHistoryPage extends HistoryPage implements IHistoryCompareAdap
}
protected CompareRevisionAction createCompareAction() {
- return new CompareRevisionAction();
+ return new CompareRevisionAction(this);
}
private String getFileNameQualifier() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CommonViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CommonViewerAdvisor.java
index 8db6c10d7..df9131b36 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CommonViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/CommonViewerAdvisor.java
@@ -309,6 +309,10 @@ public class CommonViewerAdvisor extends AbstractTreeViewerAdvisor implements IN
});
dlp.setDecorationContext(decorationContext);
}
+ }
+
+ public void setInitialInput() {
+ CommonViewer viewer = (CommonViewer)getViewer();
viewer.setInput(getInitialInput());
viewer.expandToLevel(2);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
index 7897eea31..859675eeb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelContentProvider.java
@@ -112,7 +112,8 @@ public class ResourceModelContentProvider extends SynchronizationContentProvider
* @see org.eclipse.team.internal.ui.mapping.AbstractTeamAwareContentProvider#dispose()
*/
public void dispose() {
- provider.dispose();
+ if (provider != null)
+ provider.dispose();
super.dispose();
TeamUIPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(this);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
index c6b6300dd..c137ea85b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ResourceModelLabelProvider.java
@@ -223,7 +223,7 @@ public class ResourceModelLabelProvider extends
protected ImageManager getImageManager() {
ISynchronizationContext context = getContext();
if (context != null) {
- return ImageManager.getImageManager(context);
+ return ImageManager.getImageManager(context, getConfiguration());
}
if (localImageManager == null) {
localImageManager = new ImageManager();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/StreamMergerDelegate.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/StreamMergerDelegate.java
index 054f7527f..b1ad40e32 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/StreamMergerDelegate.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/StreamMergerDelegate.java
@@ -15,15 +15,16 @@ import org.eclipse.compare.IStreamMerger;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.team.core.mapping.DelegatingStorageMerger;
import org.eclipse.team.core.mapping.IStorageMerger;
-import org.eclipse.team.internal.core.mapping.DelegatingStorageMerger;
+import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.mapping.IStreamMergerDelegate;
import org.eclipse.team.internal.ui.TeamUIPlugin;
public class StreamMergerDelegate implements IStreamMergerDelegate {
public static void start() {
- DelegatingStorageMerger.setMergerDelegate(new StreamMergerDelegate());
+ TeamPlugin.getPlugin().setMergerDelegate(new StreamMergerDelegate());
}
public IStorageMerger findMerger(IStorage target) {
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 541309b2f..cde2980ee 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
@@ -25,8 +25,8 @@ ConfigureProjectWizardMainPage_selectRepository=Select a repository type:
IgnorePreferencePage_description=Use this page to specify a list of resource name patterns to exclude from version control.
IgnorePreferencePage_add=Add &Pattern...
-IgnorePreferencePage_enterPatternLong=Please enter a pattern:
-IgnorePreferencePage_enterPatternShort=Enter Ignore Pattern
+IgnorePreferencePage_enterPatternLong=Enter a name or path pattern (* = any string, ? = any character):
+IgnorePreferencePage_enterPatternShort=Add Ignore Pattern
IgnorePreferencePage_ignorePatterns=&Ignore Patterns:
IgnorePreferencePage_patternExistsLong=The entered pattern already exists.
IgnorePreferencePage_patternExistsShort=Pattern Already Exists
@@ -98,7 +98,7 @@ ImportProjectSetMainPage_workingSetNameEmpty=The working set name must not be em
ImportProjectSetMainPage_createWorkingSetLabel=&Create a working set containing the imported projects
ImportProjectSetMainPage_workingSetLabel=&Working Set Name:
ImportProjectSetMainPage_AddToWorkingSet=&Add the imported team project set to a working set
-ImportProjectSetMainPage_runInBackground=Run Project Set import in the &background
+ImportProjectSetMainPage_runInBackground=Run the import in the bac&kground
ImportProjectSetMainPage_jobName=Importing project set...
ImportProjectSetDialog_duplicatedWorkingSet_title=Working Set Exists
ImportProjectSetDialog_duplicatedWorkingSet_message=Working Set ''{0}'' already exists. What would you like to do?
@@ -122,6 +122,9 @@ ProjectSetImportWizard_0=Projects for repository type {0} could not be loaded as
ProjectSetImportWizard_2=An error occurred while parsing the project set file: {0}
ProjectSetImportWizard_1=The following errors occurred while importing projects. Some projects may not be loaded.
ProjectSetImportWizard_3=An error occurred while performing the project set import: {0}
+ProjectSelectionPage_0={0} does not directly support multiple project sharing. Select a project and click Share Project to share each project individually
+ProjectSelectionPage_1={0} Project Selection Page
+ProjectSelectionPage_2=&Share Project...
ProjectSetImportWizard_Import_a_Project_Set_3=Import a Team Project Set
ProjectSetImportWizard_workingSetExistsTitle=Working Set Exists
ProjectSetImportWizard_workingSetExistsMessage=Working set ''{0}'' already exists. Overwrite?
@@ -224,6 +227,8 @@ RefreshCompleteDialog_6={0}: No changes found.
ConfigureRefreshScheduleDialog_0=Configure Synchronize Schedule - {0}
ConfigureRefreshScheduleDialog_1=You can allow ''{0}'' to periodically synchronize in the background.
ConfigureRefreshScheduleDialog_1a=The last synchronize occurred at: {0}
+ConfigureMultipleProjectsWizard_0=Unshared Projects
+ConfigureMultipleProjectsWizard_1=There are still projects that have not been shared. Finishing the wizard now will leave them in that state.
ConfigureRefreshScheduleDialog_2=Do not schedule the synchronize operation to run periodically.
ConfigureRefreshScheduleDialog_3=Using the following schedule:
ConfigureRefreshScheduleDialog_4=Every:
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
index c4f67dfec..305a6c68f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/IgnorePreferencePage.java
@@ -141,7 +141,15 @@ public class IgnorePreferencePage extends PreferencePage implements IWorkbenchPr
}
private void addIgnore() {
- InputDialog dialog = new InputDialog(getShell(), TeamUIMessages.IgnorePreferencePage_enterPatternShort, TeamUIMessages.IgnorePreferencePage_enterPatternLong, null, null); //
+
+ InputDialog dialog = new InputDialog(getShell(), TeamUIMessages.IgnorePreferencePage_enterPatternShort, TeamUIMessages.IgnorePreferencePage_enterPatternLong, null, null) {
+ protected Control createDialogArea(Composite parent) {
+ Control control = super.createDialogArea(parent);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IHelpContextIds.IGNORE_PREFERENCE_PAGE);
+ return control;
+ }
+ };
+
dialog.open();
if (dialog.getReturnCode() != Window.OK) return;
String pattern = dialog.getValue();
@@ -150,7 +158,7 @@ public class IgnorePreferencePage extends PreferencePage implements IWorkbenchPr
TableItem[] items = ignoreTable.getItems();
for (int i = 0; i < items.length; i++) {
if (items[i].getText().equals(pattern)) {
- MessageDialog.openWarning(getShell(), TeamUIMessages.IgnorePreferencePage_patternExistsShort, TeamUIMessages.IgnorePreferencePage_patternExistsLong); //
+ MessageDialog.openWarning(getShell(), TeamUIMessages.IgnorePreferencePage_patternExistsShort, TeamUIMessages.IgnorePreferencePage_patternExistsLong);
return;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/ResourceModelPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/ResourceModelPreferencePage.java
index b13d4fd3f..c770bd412 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/ResourceModelPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/ResourceModelPreferencePage.java
@@ -12,9 +12,9 @@ package org.eclipse.team.internal.ui.preferences;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.*;
public class ResourceModelPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceIds {
@@ -28,6 +28,15 @@ public class ResourceModelPreferencePage extends FieldEditorPreferencePage imple
}
/* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ // set F1 help
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.RESOURCE_MODEL_PREFERENCE_PAGE);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
protected void createFieldEditors() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
index f04f1c3f6..1000160b1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizePage.java
@@ -110,7 +110,7 @@ public abstract class AbstractSynchronizePage extends Page implements ISynchroni
// Create the changes section which, in turn, creates the changes viewer and its configuration
this.changesSection = createChangesSection(composite);
- this.changesViewer = createChangesViewer(changesSection.getContainer());
+ createChangesViewer(changesSection.getContainer());
changesSection.setViewer(changesViewer);
}
@@ -125,11 +125,11 @@ public abstract class AbstractSynchronizePage extends Page implements ISynchroni
* with the page.
*
* @param parent the parent of the viewer
- * @return the changes viewer control
*/
- protected Viewer createChangesViewer(Composite parent) {
+ private void createChangesViewer(Composite parent) {
viewerAdvisor = createViewerAdvisor(parent);
- return viewerAdvisor.getViewer();
+ changesViewer = viewerAdvisor.getViewer();
+ viewerAdvisor.setInitialInput();
}
protected abstract AbstractViewerAdvisor createViewerAdvisor(Composite parent);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractTreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractTreeViewerAdvisor.java
index 837ffeb39..9e2f7e3c6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractTreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractTreeViewerAdvisor.java
@@ -24,7 +24,7 @@ import org.eclipse.ui.*;
/**
* Abstract superclass for tree viewer advisors
*/
-public class AbstractTreeViewerAdvisor extends StructuredViewerAdvisor implements IAdaptable {
+public abstract class AbstractTreeViewerAdvisor extends StructuredViewerAdvisor implements IAdaptable {
private ICompareNavigator nav;
private INavigatable navigatable;
@@ -308,9 +308,6 @@ public class AbstractTreeViewerAdvisor extends StructuredViewerAdvisor implement
children = tree.getItems();
if (children != null && children.length > 0) {
item = children[0];
- if (item != null && item.getItemCount() <= 0) {
- return item;
- }
}
}
return item;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractViewerAdvisor.java
index b137ebe4e..3a0b94406 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractViewerAdvisor.java
@@ -65,4 +65,6 @@ public abstract class AbstractViewerAdvisor {
}
public abstract void setActionBars(IActionBars actionBars);
+
+ public abstract void setInitialInput();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ImageManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ImageManager.java
index ab24e67db..70423adb9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ImageManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ImageManager.java
@@ -10,63 +10,81 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import java.util.*;
-
import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.*;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.core.ICache;
import org.eclipse.team.core.ICacheListener;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
public class ImageManager {
private static final String PROP_IMAGE_MANAGER = TeamUIPlugin.ID + ".imageManager"; //$NON-NLS-1$
- // Cache for images that have been overlayed
- private Map fgImageCache = new HashMap(10);
-
+ private LocalResourceManager imageManager;
// Contains direction images
private CompareConfiguration compareConfig = new CompareConfiguration();
-
private boolean disposed = false;
- public synchronized static ImageManager getImageManager(ISynchronizationContext context) {
+ public synchronized static ImageManager getImageManager(ISynchronizationContext context, ISynchronizePageConfiguration configuration) {
ImageManager manager = (ImageManager)context.getCache().get(PROP_IMAGE_MANAGER);
if (manager == null) {
final ImageManager newRegistry = new ImageManager();
context.getCache().put(PROP_IMAGE_MANAGER, newRegistry);
- context.getCache().addCacheListener(new ICacheListener() {
- public void cacheDisposed(ICache cache) {
- newRegistry.dispose();
- }
- });
+ Viewer v = getViewer(configuration);
+ if (v != null) {
+ // It is best to dispose the images when the view is disposed (see bug 198383)
+ v.getControl().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ newRegistry.dispose();
+ }
+ });
+ } else {
+ // The viewer wasn't available so we'll dispose when the context is disposed
+ context.getCache().addCacheListener(new ICacheListener() {
+ public void cacheDisposed(ICache cache) {
+ newRegistry.dispose();
+ }
+ });
+ }
manager = newRegistry;
}
return manager;
}
+
+ private static Viewer getViewer(ISynchronizePageConfiguration configuration) {
+ if (configuration == null)
+ return null;
+ if (configuration.getPage() == null)
+ return null;
+ return configuration.getPage().getViewer();
+ }
public Image getImage(ImageDescriptor descriptor) {
if (descriptor == null || disposed)
return null;
- Image image = (Image)fgImageCache.get(descriptor);
- if (image == null) {
- image = descriptor.createImage();
- fgImageCache.put(descriptor, image);
- }
+ ResourceManager manager = getResourceManager();
+ Image image = manager.createImage(descriptor);
return image;
}
+ private synchronized ResourceManager getResourceManager() {
+ if (imageManager == null) {
+ imageManager = new LocalResourceManager(JFaceResources.getResources());
+ }
+ return imageManager;
+ }
+
public void dispose() {
disposed = true;
compareConfig.dispose();
- if (fgImageCache != null) {
- Iterator it = fgImageCache.values().iterator();
- while (it.hasNext()) {
- Image element = (Image) it.next();
- element.dispose();
- }
+ if (imageManager != null) {
+ imageManager.dispose();
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
index dad86864c..1ccc1c7e8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
@@ -11,7 +11,6 @@
package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.*;
-import org.eclipse.compare.internal.Utilities;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -167,8 +166,8 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison
*/
private boolean checkForUpdateConflicts() {
if(hasSaveConflict()) {
- if (Utilities.RUNNING_TESTS)
- return !Utilities.TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE;
+ if (Utils.RUNNING_TESTS)
+ return !Utils.TESTING_FLUSH_ON_COMPARE_INPUT_CHANGE;
final MessageDialog dialog =
new MessageDialog(TeamUIPlugin.getStandardDisplay().getActiveShell(),
TeamUIMessages.SyncInfoCompareInput_0,
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StartupPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StartupPreferencePage.java
index e6cf3e23a..20593514b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StartupPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StartupPreferencePage.java
@@ -11,9 +11,10 @@
package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.jface.preference.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.team.internal.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.TeamUIMessages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.*;
public class StartupPreferencePage extends FieldEditorPreferencePage implements
IWorkbenchPreferencePage {
@@ -36,6 +37,15 @@ public class StartupPreferencePage extends FieldEditorPreferencePage implements
public void init(IWorkbench workbench) {
// Nothing to do
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ // set F1 help
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.SYNC_STARTUP_PREFERENCE_PAGE);
+ }
protected void createFieldEditors() {
addField(new RadioGroupFieldEditor(PROP_STARTUP_ACTION,
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
index cdf53f16d..37947ece2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TreeViewerAdvisor.java
@@ -137,6 +137,10 @@ public class TreeViewerAdvisor extends AbstractTreeViewerAdvisor {
viewer.getControl().setLayoutData(data);
initializeViewer(viewer);
}
+
+ public void setInitialInput() {
+ // The input will be set later
+ }
/**
* Create the model manager to be used by this advisor
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
index 2874744fd..5c93a28f0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/ChangeSetActionGroup.java
@@ -11,8 +11,8 @@
package org.eclipse.team.internal.ui.synchronize.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
+import java.text.Collator;
+import java.util.*;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -352,7 +352,13 @@ public class ChangeSetActionGroup extends SynchronizePageActionGroup {
}
protected void addChangeSets(IMenuManager manager) {
- ChangeSet[] sets = getActiveChangeSetManager().getSortedSets();
+ ChangeSet[] sets = getActiveChangeSetManager().getSets();
+ Arrays.sort(sets, new Comparator() {
+ private Collator collator = Collator.getInstance();
+ public int compare(Object o1, Object o2) {
+ return collator.compare(((ChangeSet) o1).getName(), ((ChangeSet) o2).getName());
+ }
+ });
ISelection selection = getContext().getSelection();
createChangeSet.selectionChanged(selection);
addToChangeSet.add(createChangeSet);
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 3fdb6f82e..b4ada85e5 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize.actions;
+import org.eclipse.core.commands.*;
import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.IWizard;
@@ -23,8 +24,10 @@ import org.eclipse.team.internal.ui.wizards.GlobalSynchronizeWizard;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.commands.*;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.ui.handlers.IHandlerActivation;
+import org.eclipse.ui.handlers.IHandlerService;
/**
* A global refresh action that allows the user to select the participant to refresh
@@ -44,8 +47,8 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
private Action synchronizeAction;
private IWorkbenchWindow window;
private IAction actionProxy;
- private HandlerSubmission syncAll;
- private HandlerSubmission syncLatest;
+ private IHandlerActivation syncAll;
+ private IHandlerActivation syncLatest;
class RefreshParticipantAction extends Action {
private ISynchronizeParticipantReference participant;
@@ -64,29 +67,7 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
}
public GlobalRefreshAction() {
- synchronizeAction = new Action(TeamUIMessages.GlobalRefreshAction_4) {
- public void run() {
- IWizard wizard = new GlobalSynchronizeWizard();
- WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
- dialog.open();
- }
- };
- synchronizeAction.setImageDescriptor(TeamImages.getImageDescriptor(ITeamUIImages.IMG_SYNC_VIEW));
- synchronizeAction.setActionDefinitionId("org.eclipse.team.ui.synchronizeAll"); //$NON-NLS-1$
-
- // hook up actions to the commands
- IHandler handler = new ActionHandler(synchronizeAction);
- syncAll = new HandlerSubmission(null,
- null, null, "org.eclipse.team.ui.synchronizeAll", handler, Priority.LOW); //$NON-NLS-1$
- PlatformUI.getWorkbench().getCommandSupport().addHandlerSubmission(syncAll);
-
- handler = new ActionHandler(this);
- syncLatest = new HandlerSubmission(null,
- null, null, "org.eclipse.team.ui.synchronizeLast", handler, Priority.MEDIUM); //$NON-NLS-1$
- PlatformUI.getWorkbench().getCommandSupport().addHandlerSubmission(syncLatest);
-
- setMenuCreator(this);
- TeamUI.getSynchronizeManager().addSynchronizeParticipantListener(this);
+ // Nothing to do
}
/*
@@ -102,10 +83,15 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
// handlers
- PlatformUI.getWorkbench().getCommandSupport().removeHandlerSubmission(syncAll);
- syncAll.getHandler().dispose();
- PlatformUI.getWorkbench().getCommandSupport().removeHandlerSubmission(syncLatest);
- syncLatest.getHandler().dispose();
+ if (window != null) {
+ IHandlerService hs = (IHandlerService)window.getService(IHandlerService.class);
+ if (hs != null) {
+ if (syncAll != null)
+ hs.deactivateHandler(syncAll);
+ if (syncLatest != null)
+ hs.deactivateHandler(syncLatest);
+ }
+ }
}
/*
@@ -147,6 +133,40 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
*/
public void init(IWorkbenchWindow window) {
this.window = window;
+
+ synchronizeAction = new Action(TeamUIMessages.GlobalRefreshAction_4) {
+ public void run() {
+ IWizard wizard = new GlobalSynchronizeWizard();
+ WizardDialog dialog = new WizardDialog(GlobalRefreshAction.this.window.getShell(), wizard);
+ dialog.open();
+ }
+ };
+ synchronizeAction.setImageDescriptor(TeamImages.getImageDescriptor(ITeamUIImages.IMG_SYNC_VIEW));
+ synchronizeAction.setActionDefinitionId("org.eclipse.team.ui.synchronizeAll"); //$NON-NLS-1$
+
+ IHandlerService hs = (IHandlerService)window.getService(IHandlerService.class);
+ if (hs != null) {
+ // hook up actions to the commands
+ IHandler handler = new AbstractHandler() {
+ public Object execute(ExecutionEvent event)
+ throws ExecutionException {
+ synchronizeAction.run();
+ return null;
+ }
+ };
+ syncAll = hs.activateHandler("org.eclipse.team.ui.synchronizeAll", handler); //$NON-NLS-1$
+
+ handler = new AbstractHandler() {
+ public Object execute(ExecutionEvent event)
+ throws ExecutionException {
+ run();
+ return null;
+ }
+ };
+ syncLatest = hs.activateHandler("org.eclipse.team.ui.synchronizeLast", handler); //$NON-NLS-1$
+ }
+ setMenuCreator(this);
+ TeamUI.getSynchronizeManager().addSynchronizeParticipantListener(this);
}
public void run() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigurationWizardElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigurationWizardElement.java
index 7fcd9f9df..d2d089e41 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigurationWizardElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigurationWizardElement.java
@@ -11,10 +11,15 @@
package org.eclipse.team.internal.ui.wizards;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.*;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.IPluginContribution;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.IConfigurationWizard;
+import org.eclipse.team.ui.IConfigurationWizardExtension;
+import org.eclipse.ui.*;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.WorkbenchAdapter;
@@ -40,12 +45,44 @@ public class ConfigurationWizardElement extends WorkbenchAdapter implements IAda
* Create an the instance of the object described by the configuration
* element. That is, create the instance of the class the isv supplied in
* the extension point.
+ * @return the instance of the configuration wizard of type {@link IConfigurationWizard}
*
* @throws CoreException if an error occurs creating the extension
*/
public Object createExecutableExtension() throws CoreException {
return TeamUIPlugin.createExtension(configurationElement, ConfigureProjectWizard.ATT_CLASS);
}
+
+ /**
+ * Creates the instance of the wizard and initializes with the given input.
+ * @param projects the projects being shared by this wizard
+ * @return the wizard instance of type {@link IConfigurationWizard}
+ * @throws CoreException if an error occurs creating the extension
+ */
+ public IWizard createExecutableExtension(IProject[] projects) throws CoreException {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IConfigurationWizard wizard = (IConfigurationWizard)createExecutableExtension();
+ IConfigurationWizardExtension extension = (IConfigurationWizardExtension)Utils.getAdapter(wizard, IConfigurationWizardExtension.class);
+ if (extension == null) {
+ if (projects.length == 1) {
+ wizard.init(workbench, projects[0]);
+ } else {
+ // Dispose of the created wizard, just in case
+ try {
+ wizard.dispose();
+ } catch (RuntimeException e) {
+ // If a general exception occurred here, log it and continue
+ TeamUIPlugin.log(IStatus.ERROR, "An internal error occurred", e); //$NON-NLS-1$
+ }
+ IWizard multiWizard = new ConfigureMultipleProjectsWizard(projects, this);
+ return multiWizard;
+ }
+ } else {
+ extension.init(workbench, projects);
+ }
+ return wizard;
+ }
+
/*
* Method declared on IAdaptable.
*/
@@ -108,7 +145,7 @@ public class ConfigurationWizardElement extends WorkbenchAdapter implements IAda
/**
* Set the description parameter of this element
*
- * @param value the new desrciption
+ * @param value the new description
*/
public void setDescription(String value) {
// Not used
@@ -141,6 +178,30 @@ public class ConfigurationWizardElement extends WorkbenchAdapter implements IAda
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
public String getPluginId() {
- return configurationElement.getNamespace();
+ return configurationElement.getNamespaceIdentifier();
+ }
+
+ /**
+ * Return whether the wizard created for this element has pages.
+ * Unfortunately, the only way to find this out is to create the wizard.
+ * @param projects the projects being shared
+ * @return whether the resulting wizard has pages
+ */
+ public boolean wizardHasPages(IProject[] projects) {
+ try {
+ IWizard wizard = (IWizard)createExecutableExtension(projects);
+ try {
+ wizard.addPages();
+ return (wizard.getPageCount() > 0);
+ } finally {
+ wizard.dispose();
+ }
+ } catch (CoreException e) {
+ TeamUIPlugin.log(e);
+ } catch (RuntimeException e) {
+ // If a general exception occurred here, log it and continue
+ TeamUIPlugin.log(IStatus.ERROR, "An internal error occurred", e); //$NON-NLS-1$
+ }
+ return false;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureMultipleProjectsWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureMultipleProjectsWizard.java
new file mode 100644
index 000000000..107cc421e
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureMultipleProjectsWizard.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.wizards;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.team.internal.ui.TeamUIMessages;
+import org.eclipse.team.ui.IConfigurationWizard;
+import org.eclipse.team.ui.IConfigurationWizardExtension;
+
+/**
+ * Wizard that supports the sharing of multiple projects for those repository providers
+ * that have not adapted their {@link IConfigurationWizard} to {@link IConfigurationWizardExtension}.
+ */
+public class ConfigureMultipleProjectsWizard extends Wizard {
+
+ private final IProject[] projects;
+ private final ConfigurationWizardElement element;
+ private ProjectSelectionPage projectSelectionPage;
+
+ public ConfigureMultipleProjectsWizard(IProject[] projects, ConfigurationWizardElement element) {
+ this.projects = projects;
+ this.element = element;
+ }
+
+
+ public void addPages() {
+ projectSelectionPage = new ProjectSelectionPage(projects, element);
+ addPage(projectSelectionPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ // Prompt if there are still unshared projects
+ if (projectSelectionPage.hasUnsharedProjects()) {
+ return MessageDialog.openConfirm(getShell(), TeamUIMessages.ConfigureMultipleProjectsWizard_0, TeamUIMessages.ConfigureMultipleProjectsWizard_1);
+ }
+ return true;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizard.java
index a78431d45..ce4b3370e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,12 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.wizards;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.*;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.activities.IActivityManager;
import org.eclipse.ui.activities.IIdentifier;
@@ -26,13 +24,9 @@ import org.eclipse.ui.model.AdaptableList;
/**
* The wizard for associating projects with team providers
*/
-public class ConfigureProjectWizard extends Wizard implements IConfigurationWizard {
- protected IWorkbench workbench;
- protected IProject project;
- protected IConfigurationWizard wizard;
-
+public class ConfigureProjectWizard extends Wizard {
+ protected IProject[] projects;
protected ConfigureProjectWizardMainPage mainPage;
- private String pluginId = TeamUIPlugin.PLUGIN_ID;
protected final static String PT_CONFIGURATION ="configurationWizards"; //$NON-NLS-1$
protected final static String TAG_WIZARD = "wizard"; //$NON-NLS-1$
@@ -42,66 +36,27 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
protected final static String ATT_ICON = "icon"; //$NON-NLS-1$
protected final static String ATT_ID = "id"; //$NON-NLS-1$
- public ConfigureProjectWizard() {
+ private ConfigureProjectWizard(IProject[] projects) {
+ this.projects = projects;
setNeedsProgressMonitor(true);
- setWindowTitle(getWizardWindowTitle());
- }
-
- protected String getExtensionPoint() {
- return PT_CONFIGURATION;
- }
-
- protected String getWizardWindowTitle() {
- return TeamUIMessages.ConfigureProjectWizard_title;
+ setWindowTitle(TeamUIMessages.ConfigureProjectWizard_title);
}
- protected String getWizardLabel() {
- return TeamUIMessages.ConfigureProjectWizard_configureProject;
- }
-
- protected String getWizardDescription() {
- return TeamUIMessages.ConfigureProjectWizard_description;
- }
-
- /*
- * @see Wizard#addPages
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
*/
public void addPages() {
AdaptableList disabledWizards = new AdaptableList();
- AdaptableList wizards = getAvailableWizards(disabledWizards);
- if (wizards.size() == 1 && disabledWizards.size() == 0) {
- // If there is only one wizard, skip the first page.
- // Only skip the first page if the one wizard has at least one page.
- ConfigurationWizardElement element = (ConfigurationWizardElement)wizards.getChildren()[0];
- try {
- this.wizard = (IConfigurationWizard)element.createExecutableExtension();
- wizard.init(workbench, project);
- 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;
- }
- } catch (CoreException e) {
- TeamUIPlugin.log(e);
- return;
- }
- }
- mainPage = new ConfigureProjectWizardMainPage("configurePage1", getWizardLabel(), TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_WIZBAN_SHARE), wizards, disabledWizards); //$NON-NLS-1$
- mainPage.setDescription(getWizardDescription());
- mainPage.setProject(project);
- mainPage.setWorkbench(workbench);
+ AdaptableList wizards = getAvailableWizards(disabledWizards);
+ mainPage = new ConfigureProjectWizardMainPage("configurePage1", TeamUIMessages.ConfigureProjectWizard_configureProject, TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_WIZBAN_SHARE), wizards, disabledWizards); //$NON-NLS-1$
+ mainPage.setDescription(TeamUIMessages.ConfigureProjectWizard_description);
+ mainPage.setProjects(projects);
addPage(mainPage);
}
- public IWizardPage getNextPage(IWizardPage page) {
- if (wizard != null) {
- return wizard.getNextPage(page);
- }
- return super.getNextPage(page);
- }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#canFinish()
+ */
public boolean canFinish() {
// If we are on the first page, never allow finish unless the selected wizard has no pages.
if (getContainer().getCurrentPage() == mainPage) {
@@ -110,44 +65,59 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
}
return false;
}
- if (wizard != null) {
- return wizard.canFinish();
- }
return super.canFinish();
}
- /*
- * @see Wizard#performFinish
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
public boolean performFinish() {
- // 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) {
- IConfigurationWizard noPageWizard = mainPage.getSelectedWizard();
+ 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;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performCancel()
- */
- public boolean performCancel() {
- if (wizard != null) {
- return wizard.performCancel();
+ private static class ResizeWizardDialog extends WizardDialog {
+ public ResizeWizardDialog(Shell parentShell, IWizard newWizard) {
+ super(parentShell, newWizard);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+ }
+
+ public static void shareProjects(Shell shell, IProject[] projects) {
+ IWizard wizard = null;
+ // If we only have one wizard registered, we'll just use that wizard
+ // unless it doesn't have any pages
+ AdaptableList disabledWizards = new AdaptableList();
+ AdaptableList wizards = getAvailableWizards(disabledWizards);
+ if (wizards.size() == 1 && disabledWizards.size() == 0) {
+ ConfigurationWizardElement element = (ConfigurationWizardElement)wizards.getChildren()[0];
+ if (element.wizardHasPages(projects)) {
+ try {
+ wizard = (IWizard)element.createExecutableExtension(projects);
+ } catch (CoreException e) {
+ // Log the exception and fall through to show the wizard
+ TeamUIPlugin.log(e);
+ }
+ }
+ }
+ if (wizard == null) {
+ wizard = new ConfigureProjectWizard(projects);
+ ((ConfigureProjectWizard)wizard).setForcePreviousAndNextButtons(true);
}
- return super.performCancel();
+ openWizard(shell, wizard);
}
/**
@@ -155,10 +125,10 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
*
* @return the available wizards
*/
- protected AdaptableList getAvailableWizards(AdaptableList disabledWizards) {
+ private static AdaptableList getAvailableWizards(AdaptableList disabledWizards) {
AdaptableList result = new AdaptableList();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint point = registry.getExtensionPoint(pluginId, getExtensionPoint());
+ IExtensionPoint point = registry.getExtensionPoint(TeamUIPlugin.PLUGIN_ID, PT_CONFIGURATION);
if (point != null) {
IExtension[] extensions = point.getExtensions();
for (int i = 0; i < extensions.length; i++) {
@@ -179,9 +149,9 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
return result;
}
- private boolean filterItem(IConfigurationElement element) {
+ private static boolean filterItem(IConfigurationElement element) {
String extensionId = element.getAttribute(ATT_ID);
- String extensionPluginId = element.getNamespace();
+ String extensionPluginId = element.getNamespaceIdentifier();
IActivityManager activityMgr = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
IIdentifier id = activityMgr.getIdentifier(extensionPluginId + "/" + extensionId); //$NON-NLS-1$
return (!id.isEnabled());
@@ -197,7 +167,7 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
* @param element the element for which to create a wizard element
* @return the wizard element for the given element
*/
- protected ConfigurationWizardElement createWizardElement(IConfigurationElement element) {
+ private static ConfigurationWizardElement createWizardElement(IConfigurationElement element) {
// WizardElements must have a name attribute
String nameString = element.getAttribute(ATT_NAME);
if (nameString == null) {
@@ -220,7 +190,7 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
* @param config the registry to get properties from
* @return whether initialization was successful
*/
- protected boolean initializeWizard(ConfigurationWizardElement element, IConfigurationElement config) {
+ private static boolean initializeWizard(ConfigurationWizardElement element, IConfigurationElement config) {
element.setID(config.getAttribute(ATT_ID));
String description = ""; //$NON-NLS-1$
IConfigurationElement [] children = config.getChildren(TAG_DESCRIPTION);
@@ -242,14 +212,11 @@ public class ConfigureProjectWizard extends Wizard implements IConfigurationWiza
// Missing attribute
return false;
}
- setForcePreviousAndNextButtons(true);
return true;
}
- /*
- * Method declared on IConfigurationWizard
- */
- public void init(IWorkbench workbench, IProject project) {
- this.workbench = workbench;
- this.project = project;
+
+ public static void openWizard(Shell shell, IWizard wizard) {
+ WizardDialog dialog = new ResizeWizardDialog(shell, wizard);
+ dialog.open();
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
index 33138b127..d7385288b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ConfigureProjectWizardMainPage.java
@@ -20,17 +20,15 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jface.wizard.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
+import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.activities.ITriggerPoint;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
@@ -48,11 +46,10 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
private TableViewer viewer;
private AdaptableList wizards;
private AdaptableList disabledWizards;
- private IWorkbench workbench;
- private IProject project;
+ private IProject[] projects;
private String description;
- private IConfigurationWizard selectedWizard;
+ private IWizard selectedWizard;
/**
* Create a new ConfigureProjectWizardMainPage
@@ -84,7 +81,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
this.description = description;
}
- public IConfigurationWizard getSelectedWizard() {
+ public IWizard getSelectedWizard() {
return selectedWizard;
}
/*
@@ -136,8 +133,7 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
}
ConfigurationWizardElement selectedElement = (ConfigurationWizardElement)ss.getFirstElement();
try {
- selectedWizard = (IConfigurationWizard)selectedElement.createExecutableExtension();
- selectedWizard.init(workbench, project);
+ selectedWizard = (IWizard)selectedElement.createExecutableExtension(getUnsharedProjects());
} catch (CoreException e) {
return;
}
@@ -187,6 +183,17 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
}
Dialog.applyDialogFont(parent);
}
+
+ /* package */ IProject[] getUnsharedProjects() {
+ java.util.List unshared = new ArrayList();
+ for (int i = 0; i < projects.length; i++) {
+ IProject project = projects[i];
+ if (!RepositoryProvider.isShared(project))
+ unshared.add(project);
+ }
+ return (IProject[]) unshared.toArray(new IProject[unshared.size()]);
+ }
+
/**
* The <code>WizardSelectionPage</code> implementation of
* this <code>IWizardPage</code> method returns the first page
@@ -205,23 +212,11 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
.getActivitySupport().getTriggerPointManager()
.getTriggerPoint(TeamUIPlugin.TRIGGER_POINT_ID);
}
-
- /**
- * Set the workbench to the argument
- *
- * @param workbench the workbench to set
- */
- public void setWorkbench(IWorkbench workbench) {
- this.workbench = workbench;
- }
- /**
- * Set the project to the argument
- *
- * @param project the project to set
- */
- public void setProject(IProject project) {
- this.project = project;
+
+ public void setProjects(IProject[] projects) {
+ this.projects = projects;
}
+
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSelectionPage.java
new file mode 100644
index 000000000..5c6fdd4e1
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSelectionPage.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.wizards;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.ui.IConfigurationWizard;
+import org.eclipse.team.ui.IConfigurationWizardExtension;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.model.*;
+import org.eclipse.ui.views.navigator.ResourceComparator;
+
+/**
+ * Page that supports the sharing of multiple projects for those repository providers
+ * that have not adapted their {@link IConfigurationWizard} to {@link IConfigurationWizardExtension}.
+ */
+public class ProjectSelectionPage extends WizardPage {
+
+ private final IProject[] projects;
+ private final ConfigurationWizardElement element;
+ private Button shareButton;
+ private TableViewer projectViewer;
+ private AdaptableList projectList;
+
+ protected ProjectSelectionPage(IProject[] projects, ConfigurationWizardElement element) {
+ super("projectSelectionPage", //$NON-NLS-1$
+ NLS.bind(TeamUIMessages.ProjectSelectionPage_1, element.getLabel(null)),
+ TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_WIZBAN_SHARE));
+ setDescription(NLS.bind(TeamUIMessages.ProjectSelectionPage_0, element.getLabel(null)));
+ this.projects = projects;
+ this.element = element;
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = SWTUtils.createHVFillComposite(parent, SWTUtils.MARGINS_DIALOG, 2);
+ createProjectList(composite);
+ createShareButton(composite);
+ updateEnablements();
+ setControl(composite);
+ }
+
+ private void createProjectList(Composite composite) {
+ projectViewer = new TableViewer(composite, SWT.SINGLE | SWT.BORDER);
+ projectViewer.getControl().setLayoutData(SWTUtils.createHVFillGridData());
+ projectList = new AdaptableList(projects);
+ projectViewer.setContentProvider(new WorkbenchContentProvider());
+ projectViewer.setLabelProvider(new WorkbenchLabelProvider());
+ projectViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
+ projectViewer.setInput(projectList);
+ projectViewer.getTable().select(0);
+ projectViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateEnablements();
+ }
+ });
+ }
+
+ private void createShareButton(Composite composite) {
+ shareButton = new Button(composite, SWT.PUSH);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = SWT.END;
+ gridData.verticalAlignment = SWT.TOP;
+ shareButton.setLayoutData(gridData);
+ shareButton.setText(TeamUIMessages.ProjectSelectionPage_2);
+ shareButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ shareSelectedProject();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // Ignore
+ }
+ });
+ }
+
+ /* package */ void shareSelectedProject() {
+ IProject project = getSelectedProject();
+ if (project != null) {
+ try {
+ IConfigurationWizard wizard = (IConfigurationWizard)element.createExecutableExtension();
+ wizard.init(PlatformUI.getWorkbench(), project);
+ ConfigureProjectWizard.openWizard(getShell(), wizard);
+ updateProjectList(project);
+ if (projectList.size() == 0) {
+ // TODO: Can we close the outer wizard from here?
+ }
+ } catch (CoreException e) {
+ ErrorDialog.openError(getShell(), null, null, e.getStatus());
+ }
+ }
+ }
+
+ private void updateProjectList(IProject project) {
+ if (RepositoryProvider.isShared(project)) {
+ projectList.remove(project);
+ projectViewer.refresh();
+ if (hasUnsharedProjects()) {
+ projectViewer.getTable().select(0);
+ }
+ updateEnablements();
+ }
+ }
+
+ /* package */ void updateEnablements() {
+ shareButton.setEnabled(getSelectedProject() != null);
+ }
+
+ private IProject getSelectedProject() {
+ ISelection selection = projectViewer.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ return (IProject)ss.getFirstElement();
+ }
+ return null;
+ }
+
+ public boolean hasUnsharedProjects() {
+ return projectList.size() > 0;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
index 0f164caae..eafbf8a27 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
@@ -24,7 +24,7 @@ import org.eclipse.ui.IWorkbench;
public interface IConfigurationWizard extends IWizard {
/**
* Initializes this creation wizard using the passed workbench and
- * object selection.
+ * the selected project.
* <p>
* This method is called after the no argument constructor and
* before other methods are called.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizardExtension.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizardExtension.java
new file mode 100644
index 000000000..657f14244
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizardExtension.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * Extends {@link IConfigurationWizard} to support the sharing of multiple projects.
+ * The Share Project wizard uses the "adaptable" mechanism (see {@link IAdapterManager} to obtain an
+ * <code>IConfigurationWizardExtension</code> for an <code>IConfigurationWizard</code>
+ * class so clients may choose to have their <code>IConfigurationWizard</code> class implement this
+ * interface as well or may choose to use the adaptable mechanism to provide the extension.
+ * <p>
+ * Clients may implement this interface.
+ *
+ * @see IConfigurationWizard
+ * @since 3.4
+ */
+public interface IConfigurationWizardExtension {
+
+ /**
+ * Initializes this creation wizard using the passed workbench and
+ * selected projects.
+ * <p>
+ * This method is called after the no argument constructor and
+ * before other methods are called.
+ * </p>
+ *
+ * @param workbench the current workbench
+ * TODO This parameter is useless. Should we pass the active page or part?
+ * @param projects the selected projects
+ */
+ void init(IWorkbench workbench, IProject[] projects);
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
index fb4d0338e..5d7a12aef 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/RevisionAnnotationController.java
@@ -28,7 +28,6 @@ import org.eclipse.team.internal.ui.history.FileRevisionEditorInput;
import org.eclipse.ui.*;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.internal.registry.EditorDescriptor;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
@@ -179,7 +178,7 @@ public abstract class RevisionAnnotationController {
id = EditorsUI.DEFAULT_TEXT_EDITOR_ID;
} else {
try {
- if (isTextEditor(descriptor)) {
+ if (Utils.isTextEditor(descriptor)) {
id = descriptor.getId();
} else {
id = EditorsUI.DEFAULT_TEXT_EDITOR_ID;
@@ -191,14 +190,7 @@ public abstract class RevisionAnnotationController {
return id;
}
- private static boolean isTextEditor(IEditorDescriptor descriptor)
- throws CoreException {
- if (descriptor instanceof EditorDescriptor) {
- EditorDescriptor desc = (EditorDescriptor) descriptor;
- return desc.createEditor() instanceof AbstractDecoratedTextEditor;
- }
- return false;
- }
+
private static AbstractDecoratedTextEditor findOpenTextEditorForFile(IWorkbenchPage page, IFile file) {
if (file == null)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java
index 6449b25b7..a8b7bde24 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java
@@ -379,7 +379,7 @@ public abstract class AbstractSynchronizeLabelProvider implements ILabelProvider
private ImageManager getImageManager() {
ISynchronizationContext context = getContext();
if (context != null) {
- return ImageManager.getImageManager(context);
+ return ImageManager.getImageManager(context, getConfiguration());
}
if (localImageManager == null) {
localImageManager = new ImageManager();
@@ -387,6 +387,14 @@ public abstract class AbstractSynchronizeLabelProvider implements ILabelProvider
return localImageManager;
}
+ private ISynchronizePageConfiguration getConfiguration() {
+ if (this instanceof SynchronizationLabelProvider) {
+ SynchronizationLabelProvider slp = (SynchronizationLabelProvider) this;
+ return (ISynchronizePageConfiguration)slp.getExtensionSite().getExtensionStateModel().getProperty(ITeamContentProviderManager.P_SYNCHRONIZATION_PAGE_CONFIGURATION);
+ }
+ return null;
+ }
+
private ISynchronizationContext getContext() {
if (this instanceof SynchronizationLabelProvider) {
SynchronizationLabelProvider slp = (SynchronizationLabelProvider) this;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
index 7d1535fb5..cf410b967 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ModelParticipantAction.java
@@ -22,8 +22,7 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.core.diff.IDiff;
-import org.eclipse.team.core.diff.IThreeWayDiff;
+import org.eclipse.team.core.diff.*;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.ui.mapping.*;
@@ -135,6 +134,9 @@ public abstract class ModelParticipantAction extends BaseSelectionListenerAction
case ISynchronizePageConfiguration.BOTH_MODE:
return true;
}
+ } else if (configuration.getComparisonType() == ISynchronizePageConfiguration.TWO_WAY
+ && node instanceof ITwoWayDiff) {
+ return true;
}
return false;
}

Back to the top