Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-16 20:32:34 +0000
committerJean Michel-Lemieux2003-10-16 20:32:34 +0000
commiteb7c00f87aaec1f9caac332093fd5d0d0c933152 (patch)
tree74210233945c6e08feb98cd16f782cd056e9612b
parent9db0c4c4ba1c2bdd77f147282bf5d5b3afedbd86 (diff)
downloadeclipse.platform.team-eb7c00f87aaec1f9caac332093fd5d0d0c933152.tar.gz
eclipse.platform.team-eb7c00f87aaec1f9caac332093fd5d0d0c933152.tar.xz
eclipse.platform.team-eb7c00f87aaec1f9caac332093fd5d0d0c933152.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java39
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java10
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/rem_co.gifbin0 -> 97 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/dlcl16/rem_co.gifbin0 -> 66 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/elcl16/rem_co.gifbin0 -> 97 bytes
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CancelSubscription.java37
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseChangeFilterAction.java30
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseSubscriberAction.java31
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CopyAction.java209
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenInCompareAction.java199
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java102
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/PasteAction.java226
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActionGroup.java81
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerChangeFilters.java148
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java256
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerShowPreferencesAction.java35
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerSubscriberListActions.java153
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerToolbarDropDownAction.java102
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ToggleViewAction.java44
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java51
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java165
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java40
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java789
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/TeamSynchronizingPerspective.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java65
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java42
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java134
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ExpandAllAction.java65
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/OpenWithActionGroup.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RefactorActionGroup.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java)48
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerAction.java)32
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewAction.java)10
43 files changed, 517 insertions, 2742 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index 0fb4c5c68..6e3f7b70e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -43,7 +43,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.core.sync.RemoteContentsCache;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
@@ -138,7 +137,6 @@ public class CVSProviderPlugin extends Plugin {
CVS_WORKSPACE_SUBSCRIBER_ID,
Policy.bind("CVSProviderPlugin.20"), //$NON-NLS-1$
Policy.bind("CVSProviderPlugin.21")); //$NON-NLS-1$
- TeamSubscriber.getSubscriberManager().registerSubscriber(cvsWorkspaceSubscriber);
}
return cvsWorkspaceSubscriber;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 32a7f7efe..ba917698e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -51,7 +51,6 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.sync.ISynchronizeViewPage;
-import org.eclipse.team.ui.sync.SubscriberPage;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
@@ -82,6 +81,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* The repository manager
*/
private RepositoryManager repositoryManager;
+ private CVSSubscriberPage cvsWorkspaceSynchronizeViewPage;
// constants used by watch/edit as values for string preference
public static final String EDIT = "edit"; //$NON-NLS-1$
@@ -650,12 +650,16 @@ public class CVSUIPlugin extends AbstractUIPlugin {
TeamUI.addPropertyChangeListener(listener);
Console.startup();
- // Commented out until we have fully ported the CVS console to the new API
+ // Commented out until we have fully ported the CVS console to the new API
//ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {new CVSOutputConsole()});
- TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {
- new CVSSubscriberPage(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
- "CVS Workspace",
- CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO), 6)});
+
+ cvsWorkspaceSynchronizeViewPage = new CVSSubscriberPage(
+ CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
+ "CVS Workspace",
+ CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO),
+ 6);
+
+ TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {cvsWorkspaceSynchronizeViewPage});
TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {
new CVSSubscriberPage(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
"CVS Workspace - 2",
@@ -698,4 +702,10 @@ public class CVSUIPlugin extends AbstractUIPlugin {
Console.shutdown();
}
+ /**
+ * @return Returns the cvsWorkspaceSynchronizeViewPage.
+ */
+ public CVSSubscriberPage getCvsWorkspaceSynchronizeViewPage() {
+ return cvsWorkspaceSynchronizeViewPage;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index 47ca97b68..c98de0633 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -15,17 +15,16 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSWorkspaceSubscriber;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberPage;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncView;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.INewSynchronizeView;
import org.eclipse.ui.IWorkingSet;
/**
@@ -39,12 +38,12 @@ public class SyncAction extends WorkspaceAction {
if (resources == null || resources.length == 0) return;
IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(resources, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
+ INewSynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
if(view != null) {
- CVSWorkspaceSubscriber cvsWorkspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
- view.setWorkingSet(workingSet);
- view.selectSubscriber(cvsWorkspaceSubscriber);
- view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
+ CVSSubscriberPage cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage();
+ //view.setWorkingSet(workingSet);
+ view.display(cvsPage);
+ //view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
} else {
CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
}
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 582ae672e..dc72864a4 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
@@ -15,14 +15,16 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSMergeSubscriberPage;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.INewSynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeManager;
+import org.eclipse.team.ui.sync.ISynchronizeViewPage;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -63,13 +65,15 @@ public class MergeWizard extends Wizard {
CVSTag endTag = endPage.getTag();
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
- TeamSubscriber.getSubscriberManager().registerSubscriber(s);
+ CVSMergeSubscriberPage page = new CVSMergeSubscriberPage(s, s.getName(), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION));
+ ISynchronizeManager manager = TeamUI.getSynchronizeManager();
+ manager.addSynchronizePages(new ISynchronizeViewPage[] {page});
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
+ INewSynchronizeView view = manager.showSynchronizeViewInActivePage(null);
if(view != null) {
- view.setWorkingSet(null); /* show all resources in the merge */
- view.selectSubscriber(s);
- view.refreshWithRemote(s, resources);
+ //view.setWorkingSet(null); /* show all resources in the merge */
+ view.display(page);
+ //view.refreshWithRemote(s, resources);
} else {
CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
return false;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java
new file mode 100644
index 000000000..b14d1dd5e
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
+import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.actions.RemoveSynchronizeViewPageAction;
+import org.eclipse.ui.IActionBars;
+
+public class CVSMergeSubscriberPage extends SubscriberPage {
+
+ private RemoveSynchronizeViewPageAction removeAction;
+
+ public CVSMergeSubscriberPage(CVSMergeSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
+ super(subscriber, name, imageDescriptor);
+ makeActions();
+ }
+
+ private void makeActions() {
+ removeAction = new RemoveSynchronizeViewPageAction(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.sync.SubscriberPage#setActionsBars(org.eclipse.ui.IActionBars)
+ */
+ public void setActionsBars(IActionBars actionBars) {
+ super.setActionsBars(actionBars);
+ actionBars.getToolBarManager().add(removeAction);
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 29527dbe4..c560d4126 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -51,7 +51,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.ui.IConfigurationWizard;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.INewSynchronizeView;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
@@ -298,12 +298,12 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
throw new InvocationTargetException(e);
}
}
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
+ INewSynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
if(view != null) {
IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$)
- view.setWorkingSet(workingSet);
- view.selectSubscriber(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
- view.setMode(ISynchronizeView.OUTGOING_MODE);
+ //view.setWorkingSet(workingSet);
+ view.display(CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage());
+ //view.setMode(ISynchronizeView.OUTGOING_MODE);
} else {
CVSUIPlugin.openError(getContainer().getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/rem_co.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/rem_co.gif
new file mode 100644
index 000000000..12a9167c5
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/icons/full/clcl16/rem_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/dlcl16/rem_co.gif b/bundles/org.eclipse.team.ui/icons/full/dlcl16/rem_co.gif
new file mode 100644
index 000000000..7e0ad4aed
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/icons/full/dlcl16/rem_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/elcl16/rem_co.gif b/bundles/org.eclipse.team.ui/icons/full/elcl16/rem_co.gif
new file mode 100644
index 000000000..310510ee5
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/icons/full/elcl16/rem_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 048f8931b..c53793482 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -205,20 +205,12 @@
id="org.eclipse.team.ui.sync.SyncView">
</view>
<view
- name="%SyncView.name"
- icon="icons/full/cview16/synch_synch.gif"
- fastViewWidthRatio="0.25"
- category="org.eclipse.team.ui"
- class="org.eclipse.team.internal.ui.sync.views.SynchronizeView"
- id="org.eclipse.team.sync.views.SynchronizeView">
- </view>
- <view
- name="Newer Sync View"
+ name="Synchronize View"
icon="icons/full/cview16/synch_synch.gif"
fastViewWidthRatio="0.25"
category="org.eclipse.team.ui"
class="org.eclipse.team.internal.ui.sync.pages.NewSynchronizeView"
- id="org.eclipse.team.sync.views.SynchronizeView2">
+ id="org.eclipse.team.sync.views.SynchronizeView">
</view>
</extension>
<!-- **************** Synchronizing Perspective ******************* -->
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index 5deb4e0e3..0015c0823 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -37,7 +37,7 @@ import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
import org.eclipse.team.internal.ui.sync.views.SyncViewerTableSorter;
import org.eclipse.team.ui.ISharedImages;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.SubscriberPage;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -157,7 +157,7 @@ public class TeamUIPlugin extends AbstractUIPlugin implements IPropertyChangeLis
store.setDefault(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS, true);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT, SyncViewerTableSorter.COL_NAME);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT_REVERSED, false);
- store.setDefault(IPreferenceIds.SYNCVIEW_SELECTED_MODE, ISynchronizeView.BOTH_MODE);
+ store.setDefault(IPreferenceIds.SYNCVIEW_SELECTED_MODE, SubscriberPage.BOTH_MODE);
store.setDefault(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE, "org.eclipse.team.internal.ui.sync.views.TeamSynchronizingPerspective"); //$NON-NLS-1$
}
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 e2787b1d2..704f9684c 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
@@ -383,6 +383,11 @@ action.navigatePrevious.tooltip=Go to Previous Difference
action.navigatePrevious.description=Go to Next Difference
action.navigatePrevious.image=prev_nav.gif
+action.removePage.label=Remove
+action.removePage.tooltip=Remove
+action.removePage.description=Remove
+action.removePage.image=rem_co.gif
+
action.expandAll.label=Expand All
action.openInCompareEditor.label=Open In Compare Editor
action.cancelSubscriber.label=Cancel
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CancelSubscription.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CancelSubscription.java
deleted file mode 100644
index 63b7102ea..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CancelSubscription.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-
-class CancelSubscription extends Action {
- private TeamSubscriber subscriber;
- private SynchronizeView view;
-
- public CancelSubscription(SynchronizeView view, TeamSubscriber s) {
- this.subscriber = s;
- this.view = view;
- Utils.initAction(this, "action.cancelSubscriber."); //$NON-NLS-1$
- // don't enable until necessary
- setEnabled(false);
- }
-
- public void run() {
- view.removeSubscriber(subscriber);
- }
-
- public void setSubscriber(TeamSubscriber subscriber) {
- this.subscriber = subscriber;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseChangeFilterAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseChangeFilterAction.java
deleted file mode 100644
index 36fdd1916..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseChangeFilterAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Created on Jul 11, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.team.internal.ui.Utils;
-
-
-class ChooseChangeFilterAction extends SyncViewerToolbarDropDownAction {
- private final SyncViewerActions actions;
- private SyncViewerChangeFilters filters;
- public void run() {
- Action[] enabled = filters.getActiveFilters();
- Action[] actions = filters.getFilters();
- if(actions.length != enabled.length) {
- filters.setAllEnabled();
- this.actions.refreshFilters();
- }
- }
- public ChooseChangeFilterAction(SyncViewerActions actions, SyncViewerChangeFilters filters) {
- super(filters);
- this.actions = actions;
- this.filters = filters;
- Utils.initAction(this, "action.changeFilters."); //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseSubscriberAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseSubscriberAction.java
deleted file mode 100644
index c0d88b58d..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ChooseSubscriberAction.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.ui.IKeyBindingService;
-
-class ChooseSubscriberAction extends SyncViewerToolbarDropDownAction {
- private final SyncViewerActions actions;
-
- public void run() {
- RefreshAction refresh = new RefreshAction(actions, true /* refresh all */);
- refresh.run();
- }
-
- public ChooseSubscriberAction(SyncViewerActions actions, SyncViewerActionGroup[] actionGroup) {
- super(actionGroup);
- this.actions = actions;
- Utils.initAction(this, "action.refreshSubscriber."); //$NON-NLS-1$
- IKeyBindingService kbs = actions.getSyncView().getSite().getKeyBindingService();
- Utils.registerAction(kbs, this, "org.eclipse.team.ui.syncview.syncAll"); //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CopyAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CopyAction.java
deleted file mode 100644
index 5646fe56f..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/CopyAction.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.core.Assert;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.part.ResourceTransfer;
-
-/**
- * This action is a copy of the copy action in org.eclipse.ui.views.navigator
- * (which is not visible)
- */
-public class CopyAction extends SelectionListenerAction {
-
- /**
- * The id of this action.
- */
- public static final String ID = TeamUIPlugin.ID + ".CopyAction"; //$NON-NLS-1$
-
- /**
- * The shell in which to show any dialogs.
- */
- private Shell shell;
-
- /**
- * System clipboard
- */
- private Clipboard clipboard;
-
- /**
- * Associated paste action. May be <code>null</code>
- */
- private PasteAction pasteAction;
-
- /**
- * Creates a new action.
- *
- * @param shell the shell for any dialogs
- * @param clipboard a platform clipboard
- */
- public CopyAction(Shell shell, Clipboard clipboard) {
- super(Policy.bind("CopyAction.title")); //$NON-NLS-1$
- Assert.isNotNull(shell);
- Assert.isNotNull(clipboard);
- this.shell = shell;
- this.clipboard = clipboard;
- setToolTipText(Policy.bind("CopyAction.toolTip")); //$NON-NLS-1$
- setId(CopyAction.ID);
- //WorkbenchHelp.setHelp(this, INavigatorHelpContextIds.COPY_ACTION);
- }
- /**
- * Creates a new action.
- *
- * @param shell the shell for any dialogs
- * @param clipboard a platform clipboard
- * @param pasteAction a paste action
- *
- * @since 2.0
- */
- public CopyAction(Shell shell, Clipboard clipboard, PasteAction pasteAction) {
- this(shell, clipboard);
- this.pasteAction = pasteAction;
- }
- /**
- * The <code>CopyAction</code> implementation of this method defined
- * on <code>IAction</code> copies the selected resources to the
- * clipboard.
- */
- public void run(){
- List selectedResources = getSelectedResources();
- IResource[] resources = (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]);
-
- // Get the file names and a string representation
- final int length = resources.length;
- int actualLength = 0;
- String[] fileNames = new String[length];
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < length; i++) {
- IPath location = resources[i].getLocation();
- // location may be null. See bug 29491.
- if (location != null)
- fileNames[actualLength++] = location.toOSString();
- if (i > 0)
- buf.append("\n"); //$NON-NLS-1$
- buf.append(resources[i].getName());
- }
- // was one or more of the locations null?
- if (actualLength < length) {
- String[] tempFileNames = fileNames;
- fileNames = new String[actualLength];
- for (int i = 0; i < actualLength; i++)
- fileNames[i] = tempFileNames[i];
- }
- setClipboard(resources, fileNames, buf.toString());
-
- // update the enablement of the paste action
- // workaround since the clipboard does not suppot callbacks
- if (pasteAction != null && pasteAction.getStructuredSelection() != null)
- pasteAction.selectionChanged(pasteAction.getStructuredSelection());
- }
- /**
- * Set the clipboard contents. Prompt to retry if clipboard is busy.
- *
- * @param resources the resources to copy to the clipboard
- * @param fileNames file names of the resources to copy to the clipboard
- * @param names string representation of all names
- */
- private void setClipboard(IResource[] resources, String[] fileNames, String names) {
- try {
- // set the clipboard contents
- if (fileNames.length > 0) {
- clipboard.setContents(
- new Object[]{
- resources,
- fileNames,
- names},
- new Transfer[]{
- ResourceTransfer.getInstance(),
- FileTransfer.getInstance(),
- TextTransfer.getInstance()});
- } else {
- clipboard.setContents(
- new Object[]{
- resources,
- names},
- new Transfer[]{
- ResourceTransfer.getInstance(),
- TextTransfer.getInstance()});
- }
- } catch (SWTError e){
- if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD)
- throw e;
- if (MessageDialog.openQuestion(shell, Policy.bind("CopyAction.errorTitle"), Policy.bind("CopyAction.errorMessage"))) //$NON-NLS-1$ //$NON-NLS-2$
- setClipboard(resources, fileNames, names);
- }
- }
- /**
- * The <code>CopyAction</code> implementation of this
- * <code>SelectionListenerAction</code> method enables this action if
- * one or more resources of compatible types are selected.
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if (!super.updateSelection(selection))
- return false;
-
- if (getSelectedNonResources().size() > 0)
- return false;
-
- List selectedResources = getSelectedResources();
- if (selectedResources.size() == 0)
- return false;
-
- boolean projSelected = selectionIsOfType(IResource.PROJECT);
- boolean fileFoldersSelected = selectionIsOfType(IResource.FILE | IResource.FOLDER);
- if (!projSelected && !fileFoldersSelected)
- return false;
-
- // selection must be homogeneous
- if (projSelected && fileFoldersSelected)
- return false;
-
- // must have a common parent
- IContainer firstParent = ((IResource) selectedResources.get(0)).getParent();
- if (firstParent == null)
- return false;
-
- Iterator resourcesEnum = selectedResources.iterator();
- while (resourcesEnum.hasNext()) {
- IResource currentResource = (IResource) resourcesEnum.next();
- // resource must exist
- if (!currentResource.exists())
- return false;
- // ensure common parent
- if (!currentResource.getParent().equals(firstParent))
- return false;
- // resource location must exist
- if (currentResource.getLocation() == null)
- return false;
- }
-
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenInCompareAction.java
deleted file mode 100644
index bff48b9f0..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenInCompareAction.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.compare.CompareUI;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.core.sync.IRemoteResource;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.actions.TeamAction;
-import org.eclipse.team.internal.ui.sync.compare.SyncInfoCompareInput;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * Action to open a compare editor from a SyncInfo object.
- *
- * @see SyncInfoCompareInput
- * @since 3.0
- */
-public class OpenInCompareAction extends Action {
-
- private SynchronizeView viewer;
-
- public OpenInCompareAction(SynchronizeView viewer) {
- this.viewer = viewer;
- Utils.initAction(this, "action.openInCompareEditor."); //$NON-NLS-1$
- }
-
- public void run() {
- ISelection selection = viewer.getViewer().getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- SyncInfo info = getSyncInfo(obj);
- openCompareEditor(viewer, info, true /* keep focus */);
- }
-
- public static SyncInfoCompareInput openCompareEditor(SynchronizeView viewer, SyncInfo info, boolean keepFocus) {
- SyncInfoCompareInput input = getCompareInput(info);
- if(input != null) {
- IWorkbenchPage page = viewer.getSite().getPage();
- IEditorPart editor = findReusableCompareEditor(page);
-
- if(editor != null) {
- IEditorInput otherInput = editor.getEditorInput();
- if(otherInput instanceof SyncInfoCompareInput && otherInput.equals(input)) {
- // simply provide focus to editor
- page.activate(editor);
- } else {
- // if editor is currently not open on that input either re-use existing
- if (!prefetchFileContents(viewer, info)) return null;
- if(editor != null && editor instanceof IReusableEditor) {
- CompareUI.reuseCompareEditor(input, (IReusableEditor)editor);
- page.activate(editor);
- }
- }
- } else {
- CompareUI.openCompareEditor(input);
- }
-
- if(keepFocus) {
- SynchronizeView.showInActivePage(viewer.getSite().getPage(), false /* don't switch perspectives */);
- }
- return input;
- }
- return null;
- }
-
- /**
- * Prefetching the file contents will cache them for use by the compare editor
- * so that the compare editor doesn't have to perform file transfers. This will
- * make the transfer cancellable.
- */
- private static boolean prefetchFileContents(SynchronizeView viewer, SyncInfo info) {
- final IRemoteResource remote = info.getRemote();
- final IRemoteResource base = info.getBase();
- if (remote != null || base != null) {
- final boolean[] ok = new boolean[] { true };
- viewer.run(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask(null, (remote == null ? 0 : 100) + (base == null ? 0 : 100));
- if (remote != null)
- remote.getContents(Policy.subMonitorFor(monitor, 100));
- if (base != null)
- base.getContents(Policy.subMonitorFor(monitor, 100));
- } catch (TeamException e) {
- ok[0] = false;
- // The sync viewer will show the error to the user so we need only abort the action
- throw new InvocationTargetException(e);
- } finally {
- // return false if the operation was cancelled
- ok[0] = ! monitor.isCanceled();
- monitor.done();
- }
- }
- });
- return ok[0];
- }
- return true;
- }
-
- /**
- * Returns a SyncInfoCompareInput instance for the current selection.
- */
- private static SyncInfoCompareInput getCompareInput(SyncInfo info) {
- if (info != null && info.getLocal() instanceof IFile) {
- return SyncInfoCompareInput.createInput(info);
- }
- return null;
- }
-
- /**
- * Returns an editor that can be re-used. An open compare editor that
- * has un-saved changes cannot be re-used.
- */
- public static IEditorPart findReusableCompareEditor(IWorkbenchPage page) {
- IEditorReference[] editorRefs = page.getEditorReferences();
-
- for (int i = 0; i < editorRefs.length; i++) {
- IEditorPart part = editorRefs[i].getEditor(true);
- if(part != null && part.getEditorInput() instanceof SyncInfoCompareInput) {
- if(! part.isDirty()) {
- return part;
- }
- }
- }
- return null;
- }
-
- /**
- * Close a compare editor that is opened on the given IResource.
- *
- * @param site the view site in which to close the editors
- * @param resource the resource to use to find the compare editor
- */
- public static void closeCompareEditorFor(final IWorkbenchPartSite site, final IResource resource) {
- site.getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IEditorPart editor = findOpenCompareEditor(site, resource);
- if(editor != null) {
- site.getPage().closeEditor(editor, true /*save changes if required */);
- }
- }
- });
- }
-
- /**
- * Returns an editor handle if a SyncInfoCompareInput compare editor is opened on
- * the given IResource.
- *
- * @param site the view site in which to search for editors
- * @param resource the resource to use to find the compare editor
- * @return an editor handle if found and <code>null</code> otherwise
- */
- public static IEditorPart findOpenCompareEditor(IWorkbenchPartSite site, IResource resource) {
- IWorkbenchPage page = site.getPage();
- IEditorReference[] editorRefs = page.getEditorReferences();
- for (int i = 0; i < editorRefs.length; i++) {
- final IEditorPart part = editorRefs[i].getEditor(false /* don't restore editor */);
- if(part != null) {
- IEditorInput input = part.getEditorInput();
- if(part != null && input instanceof SyncInfoCompareInput) {
- SyncInfo inputInfo = ((SyncInfoCompareInput)input).getSyncInfo();
- if(inputInfo.getLocal().equals(resource)) {
- return part;
- }
- }
- }
- }
- return null;
- }
-
- public static SyncInfo getSyncInfo(Object obj) {
- return (SyncInfo)TeamAction.getAdapter(obj, SyncInfo.class);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java
deleted file mode 100644
index 3feeb9b5b..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.team.internal.ui.actions.TeamAction;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.OpenFileAction;
-import org.eclipse.ui.actions.OpenWithMenu;
-import org.eclipse.ui.views.navigator.ResourceNavigatorMessages;
-
-/**
- * This is the action group for the open actions.
- */
-public class OpenWithActionGroup extends SyncViewerActionGroup {
-
- private OpenFileAction openFileAction;
- private OpenInCompareAction openInCompareAction;
-
- public OpenWithActionGroup(SynchronizeView viewer) {
- super(viewer);
- makeActions();
- }
-
- protected void makeActions() {
- openFileAction = new OpenFileAction(getSyncView().getSite().getPage());
- openInCompareAction = new OpenInCompareAction(getSyncView());
- }
-
- public void fillContextMenu(IMenuManager menu) {
- ActionContext context = getContext();
- IStructuredSelection selection = null;
- if (context != null) {
- selection = (IStructuredSelection) context.getSelection();
- }
- fillOpenWithMenu(menu, selection);
- }
-
- /**
- * Adds the OpenWith submenu to the context menu.
- *
- * @param menu the context menu
- * @param selection the current selection
- */
- private void fillOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
-
- // Only supported if exactly one file is selected.
- if (selection == null || selection.size() != 1)
- return;
- Object element = selection.getFirstElement();
- IResource resource = getResource(element);
- if (!(resource instanceof IFile)) {
- return;
- }
-
- menu.add(openInCompareAction);
-
- if(!((resource.exists()))) {
- return;
- }
-
- openFileAction.selectionChanged(selection);
- menu.add(openFileAction);
-
- MenuManager submenu =
- new MenuManager(ResourceNavigatorMessages.getString("ResourceNavigator.openWith")); //$NON-NLS-1$
- submenu.add(new OpenWithMenu(getSyncView().getSite().getPage(), (IFile) resource));
- menu.add(submenu);
- }
-
- /**
- * Runs the default action (open file).
- */
- public void runDefaultAction(IStructuredSelection selection) {
- Object element = selection.getFirstElement();
- if (element instanceof IFile) {
- openFileAction.selectionChanged(selection);
- openFileAction.run();
- }
- }
-
- private IResource getResource(Object obj) {
- return (IResource)TeamAction.getAdapter(obj, IResource.class);
- }
-
- public void openInCompareEditor() {
- openInCompareAction.run();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/PasteAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/PasteAction.java
deleted file mode 100644
index 11d865121..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/PasteAction.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.core.Assert;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.actions.CopyFilesAndFoldersOperation;
-import org.eclipse.ui.actions.CopyProjectOperation;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.part.ResourceTransfer;
-
-/**
- * This action is a copy of the paste action in org.eclipse.ui.views.navigator
- * (which is not visible)
- */
-public class PasteAction extends SelectionListenerAction {
-
- /**
- * The id of this action.
- */
- public static final String ID = TeamUIPlugin.ID + ".PasteAction";//$NON-NLS-1$
-
- /**
- * The shell in which to show any dialogs.
- */
- private Shell shell;
-
- /**
- * System clipboard
- */
- private Clipboard clipboard;
-
- /**
- * Creates a new action.
- *
- * @param shell the shell for any dialogs
- */
- public PasteAction(Shell shell, Clipboard clipboard) {
- super(Policy.bind("PasteAction.title")); //$NON-NLS-1$
- Assert.isNotNull(shell);
- Assert.isNotNull(clipboard);
- this.shell = shell;
- this.clipboard = clipboard;
- setToolTipText(Policy.bind("PasteAction.toolTip")); //$NON-NLS-1$
- setId(PasteAction.ID);
- // WorkbenchHelp.setHelp(this, INavigatorHelpContextIds.PASTE_ACTION);
- }
- /**
- * Returns the actual target of the paste action. Returns null
- * if no valid target is selected.
- *
- * @return the actual target of the paste action
- */
- private IResource getTarget() {
- List selectedResources = getSelectedResources();
-
- for (int i = 0; i < selectedResources.size(); i++) {
- IResource resource = (IResource)selectedResources.get(i);
-
- if (resource instanceof IProject && !((IProject)resource).isOpen())
- return null;
- if (resource.getType() == IResource.FILE)
- resource = resource.getParent();
- if (resource != null)
- return resource;
- }
- return null;
- }
- /**
- * Returns whether any of the given resources are linked resources.
- *
- * @param resources resource to check for linked type. may be null
- * @return true=one or more resources are linked. false=none of the
- * resources are linked
- */
- private boolean isLinked(IResource[] resources) {
- for (int i = 0; i < resources.length; i++) {
- if (resources[i].isLinked())
- return true;
- }
- return false;
- }
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- // try a resource transfer
- ResourceTransfer resTransfer = ResourceTransfer.getInstance();
- IResource[] resourceData = (IResource[])clipboard.getContents(resTransfer);
-
- if (resourceData != null && resourceData.length > 0) {
- if (resourceData[0].getType() == IResource.PROJECT) {
- // enablement checks for all projects
- for (int i = 0; i < resourceData.length; i++) {
- CopyProjectOperation operation = new CopyProjectOperation(this.shell);
- operation.copyProject((IProject) resourceData[i]);
- }
- } else {
- // enablement should ensure that we always have access to a container
- IContainer container = getContainer();
-
- CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(this.shell);
- operation.copyResources(resourceData, container);
- }
- return;
- }
-
- // try a file transfer
- FileTransfer fileTransfer = FileTransfer.getInstance();
- String[] fileData = (String[])clipboard.getContents(fileTransfer);
-
- if (fileData != null) {
- // enablement should ensure that we always have access to a container
- IContainer container = getContainer();
-
- CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(this.shell);
- operation.copyFiles(fileData, container);
- }
- }
- /**
- * Returns the container to hold the pasted resources.
- */
- private IContainer getContainer() {
- List selection = getSelectedResources();
- if (selection.get(0) instanceof IFile)
- return ((IFile)selection.get(0)).getParent();
- else
- return (IContainer)selection.get(0);
- }
- /**
- * The <code>PasteAction</code> implementation of this
- * <code>SelectionListenerAction</code> method enables this action if
- * a resource compatible with what is on the clipboard is selected.
- *
- * -Clipboard must have IResource or java.io.File
- * -Projects can always be pasted if they are open
- * -Workspace folder may not be copied into itself
- * -Files and folders may be pasted to a single selected folder in open
- * project or multiple selected files in the same folder
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if (!super.updateSelection(selection))
- return false;
-
- // clipboard must have resources or files
- ResourceTransfer resTransfer = ResourceTransfer.getInstance();
- IResource[] resourceData = (IResource[])clipboard.getContents(resTransfer);
- boolean isProjectRes = resourceData != null
- && resourceData.length > 0
- && resourceData[0].getType() == IResource.PROJECT;
-
- if (isProjectRes) {
- for (int i = 0; i < resourceData.length; i++) {
- // make sure all resource data are open projects
- // can paste open projects regardless of selection
- if (resourceData[i].getType() != IResource.PROJECT || ((IProject) resourceData[i]).isOpen() == false)
- return false;
- }
- return true;
- }
-
- if (getSelectedNonResources().size() > 0)
- return false;
-
- IResource targetResource = getTarget();
- // targetResource is null if no valid target is selected (e.g., open project)
- // or selection is empty
- if (targetResource == null)
- return false;
-
- // can paste files and folders to a single selection (file, folder,
- // open project) or multiple file selection with the same parent
- List selectedResources = getSelectedResources();
- if (selectedResources.size() > 1) {
- for (int i = 0; i < selectedResources.size(); i++) {
- IResource resource = (IResource)selectedResources.get(i);
- if (resource.getType() != IResource.FILE)
- return false;
- if (!targetResource.equals(resource.getParent()))
- return false;
- }
- }
- if (resourceData != null) {
- // linked resources can only be pasted into projects
- if (isLinked(resourceData) && targetResource.getType() != IResource.PROJECT)
- return false;
-
- if (targetResource.getType() == IResource.FOLDER) {
- // don't try to copy folder to self
- for (int i = 0; i < resourceData.length; i++) {
- if (targetResource.equals(resourceData[i]))
- return false;
- }
- }
- return true;
- }
- TransferData[] transfers = clipboard.getAvailableTypes();
- FileTransfer fileTransfer = FileTransfer.getInstance();
- for (int i = 0; i < transfers.length; i++) {
- if (fileTransfer.isSupportedType(transfers[i]))
- return true;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActionGroup.java
deleted file mode 100644
index 3bbbf08d4..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActionGroup.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-
-/**
- * This class acts as the superclass fo all action groups that appear in the SynchronizeView
- */
-public abstract class SyncViewerActionGroup extends ActionGroup {
-
- private SynchronizeView syncView;
-
- protected SyncViewerActionGroup(SynchronizeView syncView) {
- this.syncView = syncView;
- }
-
- /**
- * Return the SynchronizeView for this action group
- * @return
- */
- public SynchronizeView getSyncView() {
- return syncView;
- }
-
- /**
- * Save the state of the action group into the given IMemento
- * @param memento
- */
- public void save(IMemento memento) {
- }
-
- /**
- * Restore the state of the action group from the IMemento
- * @param memento
- */
- public void restore(IMemento memento) {
- }
-
- public void setContext(ActionContext context) {
- super.setContext(context);
- initializeActions();
- }
-
- public void addContext(ActionContext context) {
- }
-
- public void removeContext(ActionContext context) {
- }
-
- protected void initializeActions() {
- }
-
- protected SubscriberInput getSubscriberContext() {
- ActionContext input = getContext();
- if(input != null) {
- return (SubscriberInput)input.getInput();
- }
- return null;
- }
-
- /**
- * Method invoked from a SyncViewerToolbarDropDownAction
- *
- * @param menu
- */
- public void fillMenu(SyncViewerToolbarDropDownAction action) {
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
index 17784d42e..bf542b34b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
@@ -97,8 +97,8 @@ public class SyncViewerActions extends SyncViewerActionGroup {
expandAll = new ExpandAllAction(this);
- toggleLayoutFlatAction = new ToggleViewAction(getSyncView(), SynchronizeView.TABLE_VIEW);
- toggleLayoutHierarchicalAction = new ToggleViewAction(getSyncView(), SynchronizeView.TREE_VIEW);
+ toggleLayoutFlatAction = new ToggleViewLayoutAction(getSyncView(), SynchronizeView.TABLE_VIEW);
+ toggleLayoutHierarchicalAction = new ToggleViewLayoutAction(getSyncView(), SynchronizeView.TREE_VIEW);
collapseAll = new Action() {
public void run() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerChangeFilters.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerChangeFilters.java
deleted file mode 100644
index 9feee20b2..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerChangeFilters.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-
-/**
- * This class provides a set of actions that support sync set filtering by
- * change type. Changing the change type only requires setting a new
- * filter on the sync set.
- */
-public class SyncViewerChangeFilters extends SyncViewerActionGroup {
-
- // array of actions for filtering by change type (additions, deletions and changes)
- private ChangeFilterAction[] actions;
- private SyncViewerActions actionGroup;
-
- /**
- * Action for filtering by change type.
- */
- class ChangeFilterAction extends Action {
- // The SyncInfo change constant associated with the change type
- private int changeFilter;
- public ChangeFilterAction(String prefix, int changeFilter) {
- this.changeFilter = changeFilter;
- Utils.initAction(this, prefix);
- }
- public void run() {
- refreshFilters();
- }
- public int getChangeFilter() {
- return changeFilter;
- }
- }
-
- protected SyncViewerChangeFilters(SynchronizeView viewer, SyncViewerActions actionGroup) {
- super(viewer);
- this.actionGroup = actionGroup;
- createActions();
- }
-
- private void createActions() {
- ChangeFilterAction additions = new ChangeFilterAction("action.changeFilterShowAdditions.", SyncInfo.ADDITION); //$NON-NLS-1$
- additions.setChecked(true);
- ChangeFilterAction deletions = new ChangeFilterAction("action.changeFilterShowDeletions.", SyncInfo.DELETION); //$NON-NLS-1$
- deletions.setChecked(true);
- ChangeFilterAction changes = new ChangeFilterAction("action.changeFilterShowChanges.", SyncInfo.CHANGE); //$NON-NLS-1$
- changes.setChecked(true);
- actions = new ChangeFilterAction[] { additions, deletions, changes };
- }
-
- /**
- * Get the current set of active change filters
- */
- public int[] getChangeFilters() {
- // Determine how many change types are checked
- int count = 0;
- for (int i = 0; i < actions.length; i++) {
- ChangeFilterAction action = actions[i];
- if (action.isChecked()) {
- count++;
- }
- }
- // Create an array of checked change types
- int[] changeFilters = new int[count];
- count = 0;
- for (int i = 0; i < actions.length; i++) {
- ChangeFilterAction action = actions[i];
- if (action.isChecked()) {
- changeFilters[count++] = action.getChangeFilter();
- }
- }
- return changeFilters;
- }
-
- public void fillMenu(SyncViewerToolbarDropDownAction action) {
- super.fillMenu(action);
- for (int i = 0; i < actions.length; i++) {
- action.add(actions[i]);
- }
- }
-
- /**
- * Return all the actions for filtering by change type
- * @return
- */
- public Action[] getFilters() {
- return actions;
- }
-
- /**
- * Return all the active change types
- * @return
- */
- public Action[] getActiveFilters() {
- List result = new ArrayList();
- for (int i = 0; i < actions.length; i++) {
- Action action = actions[i];
- if (action.isChecked()) {
- result.add(action);
- }
- }
- return (Action[]) result.toArray(new Action[result.size()]);
- }
-
- /**
- * Change the active change types to those in the provided array
- * @param results
- */
- public void setActiveFilters(Object[] results) {
- for (int i = 0; i < actions.length; i++) {
- Action action = actions[i];
- boolean active = false;
- for (int j = 0; j < results.length; j++) {
- Object object = results[j];
- if (object == action) {
- active = true;
- break;
- }
- }
- action.setChecked(active);
- }
- }
-
- public void setAllEnabled() {
- for (int i = 0; i < actions.length; i++) {
- actions[i].setChecked(true);
- }
- }
-
- public void refreshFilters() {
- actionGroup.refreshFilters();
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java
deleted file mode 100644
index 4d5750e52..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.internal.runtime.Assert;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-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.sync.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.team.ui.sync.ISynchronizeView;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.actions.ActionContext;
-
-/**
- * This ActionGroup provides filtering of a sync set by change direction.
- * The actions are presented to the user as toolbar buttons where only one
- * button is active at a time
- */
-public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
-
- private static final String MEMENTO_KEY = "SyncViewerDirectionFilters"; //$NON-NLS-1$
-
- // An array of the selection actions for the modes (indexed by mode constant)
- private List actions = new ArrayList(3);
- private SyncViewerActions refreshGroup;
-
- private DirectionFilterAction incomingMode;
- private DirectionFilterAction outgoingMode;
- private DirectionFilterAction bothMode;
- private DirectionFilterAction conflictsMode;
-
- private final static int[] DEFAULT_FILTER = new int[] {SyncInfo.INCOMING, SyncInfo.OUTGOING, SyncInfo.CONFLICTING};
-
- /**
- * Action for toggling the sync mode.
- */
- class DirectionFilterAction extends Action {
- // The sync mode that this action enables
- private int[] syncMode;
- private boolean toggled;
- private int modeId;
- public DirectionFilterAction(String prefix,String commandId, int[] mode, int modeId) {
- super("", AS_RADIO_BUTTON); //$NON-NLS-1$
- this.syncMode = mode;
- this.modeId = modeId;
- Utils.initAction(this, prefix);
- Action a = new Action() {
- public void run() {
- DirectionFilterAction.this.run();
- }
- };
- IKeyBindingService kbs = refreshGroup.getSyncView().getSite().getKeyBindingService();
- Utils.registerAction(kbs, a, commandId); //$NON-NLS-1$
- }
- public void run() {
- // checkMode() is called because programatic checking of radio buttons doesn't
- // consider radio buttons, hence breaks the radio-button behavior. As a workaround
- // we have to manually check/uncheck the set instead.
- checkMode(getModeId());
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_SELECTED_MODE, modeId);
- updateFilter(this);
- }
- public int[] getFilter() {
- return syncMode;
- }
- public int getModeId() {
- return modeId;
- }
- }
-
- protected SyncViewerDirectionFilters(SynchronizeView viewer, SyncViewerActions refreshGroup) {
- super(viewer);
- this.refreshGroup = refreshGroup;
- createActions();
- }
-
- /**
- * Sets up the sync modes and the actions for switching between them.
- */
- private void createActions() {
- // Create the actions
- incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", new int[] {SyncInfo.INCOMING, SyncInfo.CONFLICTING}, ISynchronizeView.INCOMING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
- actions.add(incomingMode);
-
- outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.CONFLICTING}, ISynchronizeView.OUTGOING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
- actions.add(outgoingMode);
-
- bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.INCOMING, SyncInfo.CONFLICTING}, ISynchronizeView.BOTH_MODE); //$NON-NLS-1$ //$NON-NLS-2$
- actions.add(bothMode);
-
- conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", new int[] {SyncInfo.CONFLICTING}, ISynchronizeView.CONFLICTING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
- actions.add(conflictsMode);
-
- updateEnablement(null);
- }
-
- public int[] getDirectionFilter() {
- int[] filters = new int[actions.size()];
- int i = 0;
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction)it.next();
- if(action.isChecked()) {
- return action.getFilter();
- }
- }
- // should never happen because buttons are radio
- Assert.isTrue(true);
- return new int[0];
- }
-
- boolean isSet(int[] filters, int[] afilter) {
- for (int i = 0; i < filters.length; i++) {
- for (int j = 0; i < afilter.length; i++) {
- if(filters[i] == afilter[j]) return true;
- }
- }
- return false;
- }
-
- void updateFilter(DirectionFilterAction action) {
- getRefreshGroup().refreshFilters();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
- */
- public void fillActionBars(IActionBars actionBars) {
- super.fillActionBars(actionBars);
- IToolBarManager toolBar = actionBars.getToolBarManager();
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction) it.next();
- toolBar.add(action);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ccvs.syncviews.actions.SyncViewerActionGroup#restore(org.eclipse.ui.IMemento)
- */
- public void restore(IMemento memento) {
- super.restore(memento);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ccvs.syncviews.actions.SyncViewerActionGroup#save(org.eclipse.ui.IMemento)
- */
- public void save(IMemento memento) {
- super.save(memento);
- }
-
- public SyncViewerActions getRefreshGroup() {
- return refreshGroup;
- }
-
- /*
- * Only enable actions if a context is available. In addition disable the outgoing filter if
- * the subscriber doesn't support releasing changes to it.
- */
- private void updateEnablement(SubscriberInput input) {
- if(input == null) {
- incomingMode.setEnabled(false);
- outgoingMode.setEnabled(false);
- conflictsMode.setEnabled(false);
- bothMode.setEnabled(false);
- } else {
- TeamSubscriber s = input.getSubscriber();
- incomingMode.setEnabled(true);
- conflictsMode.setEnabled(true);
- bothMode.setEnabled(true);
- if( ! s.isReleaseSupported()) {
- outgoingMode.setEnabled(false);
- } else {
- outgoingMode.setEnabled(true);
- }
- int defaultMode = TeamUIPlugin.getPlugin().getPreferenceStore().getInt(IPreferenceIds.SYNCVIEW_SELECTED_MODE);
- bothMode.setChecked(false);
- incomingMode.setChecked(false);
- outgoingMode.setChecked(false);
- conflictsMode.setChecked(false);
- switch(defaultMode) {
- case ISynchronizeView.INCOMING_MODE: incomingMode.setChecked(true); break;
- case ISynchronizeView.CONFLICTING_MODE: conflictsMode.setChecked(true); break;
- case ISynchronizeView.BOTH_MODE: bothMode.setChecked(true); break;
- case ISynchronizeView.OUTGOING_MODE:
- // handle the case where the outgoing mode is disabled.
- if(outgoingMode.isEnabled()) {
- outgoingMode.setChecked(true);
- } else {
- incomingMode.setChecked(true);
- }
- break;
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.actions.SyncViewerActionGroup#initializeActions()
- */
- protected void initializeActions() {
- SubscriberInput input = getSubscriberContext();
- if(input != null) {
- updateEnablement(input);
- } else {
- updateEnablement(null);
- }
- super.initializeActions();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.actions.SyncViewerActionGroup#removeContext(org.eclipse.ui.actions.ActionContext)
- */
- public void removeContext(ActionContext context) {
- SubscriberInput input = getSubscriberContext();
- if(input != null) {
- updateEnablement(null);
- }
- }
-
- public void setCurrentMode(int mode) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction)it.next();
- if(action.getModeId() == mode) {
- action.run();
- }
- }
- }
-
- private void checkMode(int mode) {
- for (Iterator it = actions.iterator(); it.hasNext();) {
- DirectionFilterAction action = (DirectionFilterAction)it.next();
- if(action.getModeId() == mode) {
- action.setChecked(true);
- } else {
- action.setChecked(false);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerShowPreferencesAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerShowPreferencesAction.java
deleted file mode 100644
index b7aa99a9c..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerShowPreferencesAction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog;
-import org.eclipse.team.internal.ui.preferences.SyncViewerPreferencePage;
-
-public class SyncViewerShowPreferencesAction extends Action {
- private final Shell shell;
-
- public SyncViewerShowPreferencesAction(Shell shell) {
- this.shell = shell;
- Utils.initAction(this, "action.syncViewPreferences."); //$NON-NLS-1$
- }
-
- public void run() {
- PreferencePage page = new SyncViewerPreferencePage();
- Dialog dialog = new PreferencePageContainerDialog(shell, page);
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerSubscriberListActions.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerSubscriberListActions.java
deleted file mode 100644
index 827b977a0..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerSubscriberListActions.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.ui.actions.ActionContext;
-
-/**
- * SyncViewerSubscriberListActions
- */
-public class SyncViewerSubscriberListActions extends SyncViewerActionGroup {
-
- // {QualifiedName:subscriber id -> SubscriberInput}
- private Map actions = new HashMap();
- private SubscriberInput activeInput = null;
- private CancelSubscription cancelAction;
-
- /**
- * Action for filtering by change type.
- */
- class SwitchSubscriberAction extends Action {
- private SubscriberInput input;
- public SwitchSubscriberAction(SubscriberInput input) {
- super(input.getSubscriber().getName(), Action.AS_RADIO_BUTTON);
- this.input = input;
- }
- public void run() {
- // Uncheck and let the activate check once the activate succeeds
- setChecked(false);
- SyncViewerSubscriberListActions.this.activate(this);
- }
- public SubscriberInput getSubscriberInput() {
- return input;
- }
- }
-
- public SyncViewerSubscriberListActions(SynchronizeView syncView) {
- super(syncView);
- setContext(null);
- }
-
- public void activate(SwitchSubscriberAction activatedAction) {
- if(activeInput == null || ! activatedAction.getSubscriberInput().getSubscriber().getId().equals(activeInput.getSubscriber().getId())) {
- getSyncView().initializeSubscriberInput(activatedAction.getSubscriberInput());
- // The action check state will be updated when the view invokes
- // setContext which then invokes initializeActions
- } else {
- activatedAction.setChecked(true);
- }
- }
-
- /*
- * Called when a context is enabled for the view.
- * (non-Javadoc)
- * @see SyncViewerActionGroup#initializeActions()
- */
- public void initializeActions() {
- SubscriberInput input = getSubscriberContext();
- if (input != null) {
- for (Iterator it = actions.values().iterator(); it.hasNext();) {
- SwitchSubscriberAction action =
- (SwitchSubscriberAction) it.next();
- boolean checked = action.getSubscriberInput().getSubscriber().getId().equals(
- input.getSubscriber().getId());
- action.setChecked(checked);
- if(checked) {
- activeInput = input;
- }
- }
- cancelAction.setEnabled(input.getSubscriber().isCancellable());
- cancelAction.setSubscriber(input.getSubscriber());
- } else {
- if(cancelAction != null)
- cancelAction.setEnabled(false);
- }
- }
-
- /*
- * Checking of the currently active subscriber input is done when the context is set
- * in the initializeActions method.
- * (non-Javadoc)
- * @see fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
- if (! actions.isEmpty()) {
- for (Iterator it = actions.values().iterator(); it.hasNext();) {
- SwitchSubscriberAction action = (SwitchSubscriberAction) it.next();
- menu.add(action);
- }
- if(cancelAction != null) {
- menu.add(new Separator());
- menu.add(cancelAction);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.actions.SyncViewerActionGroup#addContext(org.eclipse.ui.actions.ActionContext)
- */
- public void addContext(ActionContext context) {
- boolean enableFirstContext = actions.isEmpty();
- SubscriberInput input = (SubscriberInput)context.getInput();
- SwitchSubscriberAction action = new SwitchSubscriberAction(input);
- actions.put(input.getSubscriber().getId(), action);
- if(cancelAction == null) {
- cancelAction = new CancelSubscription(getSyncView(), input.getSubscriber());
- }
- if(enableFirstContext) {
- activate(action);
- }
- }
-
- /*
- * Method to add menu items to a toolbar drop down action
- */
- public void fillMenu(SyncViewerToolbarDropDownAction dropDown) {
- super.fillMenu(dropDown);
- if (! actions.isEmpty()) {
- for (Iterator it = actions.values().iterator(); it.hasNext();) {
- SwitchSubscriberAction action = (SwitchSubscriberAction) it.next();
- dropDown.add(action);
- }
- if(cancelAction != null) {
- dropDown.add(new Separator());
- dropDown.add(cancelAction);
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.actions.SyncViewerActionGroup#removeContext(org.eclipse.ui.actions.ActionContext)
- */
- public void removeContext(ActionContext context) {
- SubscriberInput input = (SubscriberInput)context.getInput();
- actions.remove(input.getSubscriber().getId());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerToolbarDropDownAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerToolbarDropDownAction.java
deleted file mode 100644
index 5416f42c8..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerToolbarDropDownAction.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * This class allows SyncViewerActionGroups to be place in a toolbar as
- * drop down menus
- */
-public class SyncViewerToolbarDropDownAction extends Action implements IMenuCreator {
-
- SyncViewerActionGroup[] actionGroup;
- private Menu fMenu;
-
- public SyncViewerToolbarDropDownAction(SyncViewerActionGroup actionGroup) {
- this.actionGroup = new SyncViewerActionGroup[] {actionGroup};
- setMenuCreator(this);
- }
-
- public SyncViewerToolbarDropDownAction(SyncViewerActionGroup[] actionGroups) {
- this.actionGroup = actionGroups;
- setMenuCreator(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // TODO: The menu is recreated each time. Another possibility would be to
- // cache the menu and reset it at the appropriate time
- if (fMenu != null)
- fMenu.dispose();
-
- fMenu= new Menu(parent);
- fillMenu();
- return fMenu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- private void fillMenu() {
- for (int i = 0; i < actionGroup.length; i++) {
- if(i != 0 && i < (actionGroup.length) && getMenu().getItemCount() > 0) {
- new Separator().fill(getMenu(), -1);
- }
- actionGroup[i].fillMenu(this);
- }
- }
-
- public void add(Action action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(getMenu(), -1);
- }
-
- public void add(ContributionItem item) {
- item.fill(getMenu(), -1);
- }
-
- public Menu getMenu() {
- return fMenu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- super.run();
- }
-
- public SyncViewerActionGroup[] getActionGroups() {
- return actionGroup;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ToggleViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ToggleViewAction.java
deleted file mode 100644
index 3387e8ae2..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/ToggleViewAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.SWT;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.ui.IPropertyListener;
-
-class ToggleViewAction extends Action implements IPropertyListener {
- private SynchronizeView viewer;
- private int layout;
-
- public ToggleViewAction(SynchronizeView viewer, int layout) {
- super(null, SWT.RADIO);
- this.viewer = viewer;
- this.layout = layout;
- if(layout == SynchronizeView.TABLE_VIEW) {
- Utils.initAction(this, "action.toggleViewFlat."); //$NON-NLS-1$
- } else {
- Utils.initAction(this, "action.toggleViewHierarchical."); //$NON-NLS-1$
- }
- viewer.addPropertyListener(this);
- }
-
- public void run() {
- viewer.switchViewerType(layout);
- }
-
- public void propertyChanged(Object source, int propId) {
- if(propId == SynchronizeView.PROP_VIEWTYPE) {
- setChecked(viewer.getCurrentViewType() == layout);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
index c37a15fb1..3d4ed1cde 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ui.sync.pages;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -22,14 +21,12 @@ import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.sync.INewSynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
import org.eclipse.team.ui.sync.ISynchronizePageListener;
import org.eclipse.team.ui.sync.ISynchronizeViewPage;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.MessagePage;
@@ -319,53 +316,5 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
consolesAdded(consoles);
// add as a listener
manager.addSynchronizePageListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#refreshWithRemote(org.eclipse.team.core.subscribers.TeamSubscriber, org.eclipse.core.resources.IResource[])
- */
- public void refreshWithRemote(TeamSubscriber subscriber, IResource[] resources) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#refreshWithRemote(org.eclipse.team.core.subscribers.TeamSubscriber)
- */
- public void refreshWithRemote(TeamSubscriber subscriber) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#refreshWithRemote()
- */
- public void refreshWithRemote() {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#getCurrentViewType()
- */
- public int getCurrentViewType() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#setWorkingSet(org.eclipse.ui.IWorkingSet)
- */
- public void setWorkingSet(IWorkingSet workingSet) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.ISynchronizeView#setMode(int)
- */
- public void setMode(int mode) {
- // TODO Auto-generated method stub
-
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
index 92c9210b2..e3eb057d4 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
@@ -4,17 +4,40 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.Policy;
@@ -26,12 +49,35 @@ import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
import org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener;
import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
import org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent;
-import org.eclipse.team.internal.ui.sync.views.*;
+import org.eclipse.team.internal.ui.sync.views.StatisticsPanel;
+import org.eclipse.team.internal.ui.sync.views.SyncSetContentProvider;
+import org.eclipse.team.internal.ui.sync.views.SyncSetTableContentProvider;
+import org.eclipse.team.internal.ui.sync.views.SyncTableViewer;
+import org.eclipse.team.internal.ui.sync.views.SyncTreeViewer;
+import org.eclipse.team.internal.ui.sync.views.SyncViewerLabelProvider;
+import org.eclipse.team.internal.ui.sync.views.SyncViewerSorter;
+import org.eclipse.team.internal.ui.sync.views.SyncViewerTableSorter;
+import org.eclipse.team.internal.ui.sync.views.ViewStatusInformation;
import org.eclipse.team.ui.sync.INewSynchronizeView;
import org.eclipse.team.ui.sync.SubscriberPage;
-import org.eclipse.team.ui.sync.actions.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.team.ui.sync.actions.AndSyncInfoFilter;
+import org.eclipse.team.ui.sync.actions.DirectionFilterActionGroup;
+import org.eclipse.team.ui.sync.actions.INavigableControl;
+import org.eclipse.team.ui.sync.actions.NavigateAction;
+import org.eclipse.team.ui.sync.actions.OpenWithActionGroup;
+import org.eclipse.team.ui.sync.actions.PseudoConflictFilter;
+import org.eclipse.team.ui.sync.actions.RefactorActionGroup;
+import org.eclipse.team.ui.sync.actions.SubscriberAction;
+import org.eclipse.team.ui.sync.actions.SyncInfoChangeTypeFilter;
+import org.eclipse.team.ui.sync.actions.SyncInfoDirectionFilter;
+import org.eclipse.team.ui.sync.actions.SyncInfoFilter;
+import org.eclipse.team.ui.sync.actions.SyncViewerShowPreferencesAction;
+import org.eclipse.team.ui.sync.actions.ToggleViewLayoutAction;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkingSetFilterActionGroup;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.IShowInSource;
@@ -62,12 +108,21 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
private SubscriberPage page;
private IPageSite site;
+ public final static int[] INCOMING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.INCOMING};
+ public final static int[] OUTGOING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING};
+ public final static int[] BOTH_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.INCOMING, SyncInfo.OUTGOING};
+ public final static int[] CONFLICTING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING};
+
// Actions
private OpenWithActionGroup openWithActions;
private NavigateAction gotoNext;
private NavigateAction gotoPrevious;
private Action toggleLayoutTree;
private Action toggleLayoutTable;
+ private RefactorActionGroup refactorActions;
+ private SyncViewerShowPreferencesAction showPreferences;
+ private DirectionFilterActionGroup modesGroup;
+ private WorkingSetFilterActionGroup workingSetGroup;
/**
* Constructs a new SynchronizeView.
@@ -101,11 +156,16 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
// create actions
openWithActions = new OpenWithActionGroup(view);
+ refactorActions = new RefactorActionGroup(view);
gotoNext = new NavigateAction(view, this, INavigableControl.NEXT);
gotoPrevious = new NavigateAction(view, this, INavigableControl.PREVIOUS);
+ modesGroup = new DirectionFilterActionGroup(view, page);
+
+ toggleLayoutTable = new ToggleViewLayoutAction(page, SubscriberPage.TABLE_LAYOUT);
+ toggleLayoutTree = new ToggleViewLayoutAction(page, SubscriberPage.TREE_LAYOUT);
- toggleLayoutTable = new ToggleViewAction(page, SubscriberPage.TABLE_LAYOUT);
- toggleLayoutTree = new ToggleViewAction(page, SubscriberPage.TREE_LAYOUT);
+ showPreferences = new SyncViewerShowPreferencesAction(view.getSite().getShell());
+ workingSetGroup = new WorkingSetFilterActionGroup(getSite().getShell(), this);
initializeSubscriberInput(input);
}
@@ -152,8 +212,8 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
}
protected void setContextMenu(IMenuManager manager) {
- openWithActions.setContext(new ActionContext(viewer.getSelection()));
openWithActions.fillContextMenu(manager);
+ refactorActions.fillContextMenu(manager);
manager.add(new Separator("SubscriberActionsGroup1")); //$NON-NLS-1$
manager.add(new Separator("SubscriberActionsGroup2")); //$NON-NLS-1$
manager.add(new Separator("SubscriberActionsGroup3")); //$NON-NLS-1$
@@ -477,34 +537,6 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
}
/**
- * Makes this view visible in the active page.
- */
- public static SynchronizeView showInActivePage(IWorkbenchPage activePage, boolean allowSwitchingPerspectives) {
-// IWorkbench workbench= TeamUIPlugin.getPlugin().getWorkbench();
-// IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
-//
-// if(allowSwitchingPerspectives && ! TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE).equals(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE_NONE)) {
-// try {
-// String pId = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE);
-// activePage = workbench.showPerspective(pId, window);
-// } catch (WorkbenchException e) {
-// Utils.handleError(window.getShell(), e, Policy.bind("SynchronizeView.14"), e.getMessage()); //$NON-NLS-1$
-// }
-// }
-// try {
-// if (activePage == null) {
-// activePage = TeamUIPlugin.getActivePage();
-// if (activePage == null) return null;
-// }
-// //return (SynchronizeView)activePage.showView(VIEW_ID);
-// } catch (PartInitException pe) {
-// Utils.handleError(window.getShell(), pe, Policy.bind("SynchronizeView.16"), pe.getMessage()); //$NON-NLS-1$
-// return null;
-// }
- return null;
- }
-
- /**
* Update the title when either the subscriber or filter sync set changes.
*/
public void syncSetChanged(SyncSetChangedEvent event) {
@@ -611,15 +643,23 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
/* (non-Javadoc)
* @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars)
*/
- public void setActionBars(IActionBars actionBars) {
+ public void setActionBars(IActionBars actionBars) {
IToolBarManager manager = actionBars.getToolBarManager();
manager.add(gotoNext);
manager.add(gotoPrevious);
+ modesGroup.fillActionBars(actionBars);
+
+ // drop down menu
IMenuManager menu = actionBars.getMenuManager();
- MenuManager layoutMenu = new MenuManager(Policy.bind("action.layout.label")); //$NON-NLS-1$
+ workingSetGroup.fillActionBars(actionBars);
+ MenuManager layoutMenu = new MenuManager(Policy.bind("action.layout.label")); //$NON-NLS-1$
layoutMenu.add(toggleLayoutTable);
layoutMenu.add(toggleLayoutTree);
menu.add(layoutMenu);
+ menu.add(new Separator());
+ menu.add(showPreferences);
+
+ // allow overrides
page.setActionsBars(actionBars);
}
@@ -630,10 +670,6 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
return this.site;
}
- public int getMode() {
- return 0;
- }
-
public int getLayout() {
return layout;
}
@@ -644,6 +680,47 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
public void propertyChange(PropertyChangeEvent event) {
if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_LAYOUT)) {
switchViewerType(((Integer)event.getNewValue()).intValue());
+ } else if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_MODE)) {
+ updateMode(((Integer)event.getNewValue()).intValue());
+ } else if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_WORKINGSET)) {
+ updateWorkingSet((IWorkingSet)event.getNewValue());
+ } else if(event.getProperty().equals(WorkingSetFilterActionGroup.CHANGE_WORKING_SET)) {
+ Object newValue = event.getNewValue();
+ if (newValue instanceof IWorkingSet) {
+ updateWorkingSet((IWorkingSet)newValue);
+ } else if (newValue == null) {
+ updateWorkingSet(null);
+ }
+ }
+ }
+
+ private void updateWorkingSet(IWorkingSet set) {
+ input.setWorkingSet(set);
+ updateTooltip();
+ }
+
+ private void updateMode(int mode) {
+ int[] modeFilter = BOTH_MODE_FILTER;
+ switch(mode) {
+ case SubscriberPage.INCOMING_MODE:
+ modeFilter = INCOMING_MODE_FILTER; break;
+ case SubscriberPage.OUTGOING_MODE:
+ modeFilter = OUTGOING_MODE_FILTER; break;
+ case SubscriberPage.BOTH_MODE:
+ modeFilter = BOTH_MODE_FILTER; break;
+ case SubscriberPage.CONFLICTING_MODE:
+ modeFilter = CONFLICTING_MODE_FILTER; break;
+ }
+ try {
+ input.setFilter(
+ new AndSyncInfoFilter(
+ new SyncInfoFilter[] {
+ new SyncInfoDirectionFilter(modeFilter),
+ new SyncInfoChangeTypeFilter(new int[] {SyncInfo.ADDITION, SyncInfo.DELETION, SyncInfo.CHANGE}),
+ new PseudoConflictFilter()
+ }), new NullProgressMonitor());
+ } catch (TeamException e) {
+ Utils.handleError(getSite().getShell(), e, Policy.bind("SynchronizeView.16"), e.getMessage()); //$NON-NLS-1$
}
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
index b309ad5e3..cf6292384 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
@@ -16,10 +16,26 @@ import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.util.ListenerList;
+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.ui.sync.INewSynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
import org.eclipse.team.ui.sync.ISynchronizePageListener;
import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+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;
+/**
+ * @author JLemieux
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
public class SynchronizeManager implements ISynchronizeManager {
/**
* Synchronize View page listeners
@@ -157,4 +173,28 @@ public class SynchronizeManager implements ISynchronizeManager {
private void fireUpdate(ISynchronizeViewPage[] consoles, int type) {
new SynchronizeViewPageNotifier().notify(consoles, type);
}
+
+ public INewSynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage activePage) {
+ IWorkbench workbench= TeamUIPlugin.getPlugin().getWorkbench();
+ IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
+
+ if(! TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE).equals(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE_NONE)) {
+ try {
+ String pId = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE);
+ activePage = workbench.showPerspective(pId, window);
+ } catch (WorkbenchException e) {
+ Utils.handleError(window.getShell(), e, Policy.bind("SynchronizeView.14"), e.getMessage()); //$NON-NLS-1$
+ }
+ }
+ try {
+ if (activePage == null) {
+ activePage = TeamUIPlugin.getActivePage();
+ if (activePage == null) return null;
+ }
+ return (INewSynchronizeView)activePage.showView(INewSynchronizeView.VIEW_ID);
+ } catch (PartInitException pe) {
+ Utils.handleError(window.getShell(), pe, Policy.bind("SynchronizeView.16"), pe.getMessage()); //$NON-NLS-1$
+ return null;
+ }
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java
deleted file mode 100644
index 20659c5a3..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java
+++ /dev/null
@@ -1,789 +0,0 @@
-/*************.******************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.sync.views;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.ITeamResourceChangeListener;
-import org.eclipse.team.core.subscribers.TeamDelta;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.internal.core.Assert;
-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.actions.TeamAction;
-import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
-import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
-import org.eclipse.team.internal.ui.sync.actions.RefreshAction;
-import org.eclipse.team.internal.ui.sync.actions.SyncViewerActions;
-import org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener;
-import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent;
-import org.eclipse.team.ui.sync.ISynchronizeView;
-import org.eclipse.team.ui.sync.actions.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.navigator.ResourceSorter;
-
-/**
- * The Team Synchronization view.
- */
-public class SynchronizeView extends ViewPart implements ITeamResourceChangeListener, ISyncSetChangedListener, ISynchronizeView {
-
- // The property id for <code>getCurrentViewType</code>.
- public static final int PROP_VIEWTYPE = 1;
-
- /**
- * View type constant (value 0) indicating that the synchronize view will be shown
- * as a tree.
- */
- public static final int TREE_VIEW = 0;
-
- /**
- * View type constant (value 1) indicating that the synchronize view will be shown
- * as a table.
- */
- public static final int TABLE_VIEW = 1;
-
- //This view's id. The same value as in the plugin.xml.
- public static final String VIEW_ID = "org.eclipse.team.sync.views.SynchronizeView"; //$NON-NLS-1$
-
- // The viewer that is shown in the view. Currently this can be either a table or tree viewer.
- private StructuredViewer viewer;
-
- // Parent composite of this view. It is remembered so that we can dispose of its children when
- // the viewer type is switched.
- private Composite composite = null;
- private StatisticsPanel statsPanel;
- private IMemento memento;
-
- // Viewer type constants
- private int currentViewType;
-
- // Cache for each subscriber registered with the view
- private Map subscriberInputs = new HashMap(1);
-
- // Remembering the current input and the previous.
- private SubscriberInput input = null;
-
- // A set of common actions. They are hooked to the active SubscriberInput and must
- // be reset when the input changes.
- private SyncViewerActions actions;
-
- private JobBusyCursor busyCursor;
-
- /**
- * Constructs a new SynchronizeView.
- */
- public SynchronizeView() {
- currentViewType = getStore().getInt(IPreferenceIds.SYNCVIEW_VIEW_TYPE);
- if (currentViewType != TREE_VIEW) {
- currentViewType = TABLE_VIEW;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- GridLayout gridLayout= new GridLayout();
- gridLayout.makeColumnsEqualWidth= false;
- gridLayout.marginWidth= 0;
- gridLayout.marginHeight = 0;
- parent.setLayout(gridLayout);
-
- // Create the busy cursor with no control to start with (createViewer will set it)
- busyCursor = new JobBusyCursor(null /* control */, SubscriberAction.SUBSCRIBER_JOB_TYPE);
-
- createViewer(parent);
- this.composite = parent;
-
- initializeActions();
- contributeToActionBars();
-
- // Register for addition/removal of subscribers
- TeamSubscriber.getSubscriberManager().addTeamResourceChangeListener(this);
- TeamSubscriber[] subscribers = TeamSubscriber.getSubscriberManager().getSubscribers();
- for (int i = 0; i < subscribers.length; i++) {
- TeamSubscriber subscriber = subscribers[i];
- addSubscriber(subscriber);
- }
-
- updateStatusPanel();
- updateTooltip();
-
- actions.setContext(null);
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- this.memento = memento;
-
- RefreshSubscriberInputJob refreshJob = TeamUIPlugin.getPlugin().getRefreshJob();
- if(getStore().getBoolean(IPreferenceIds.SYNCVIEW_SCHEDULED_SYNC) && refreshJob.getState() == Job.NONE) {
- refreshJob.setReschedule(true);
- // start once the UI has started and stabilized
- refreshJob.schedule(20000 /* 20 seconds */);
- }
- }
- /*
- * This method is synchronized to ensure that all internal state is not corrupted
- */
- public synchronized void initializeSubscriberInput(final SubscriberInput input) {
- Assert.isNotNull(input);
-
- // listen to sync set changes in order to update state relating to the
- // size of the sync sets and update the title
- disconnectSubscriberInput();
- this.input = input;
- input.registerListeners(this);
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- // create the viewer is it doesn't exist yet.
- if(viewer == null) {
- switchViewerType(currentViewType);
- }
- ActionContext context = new ActionContext(null);
- context.setInput(input);
- actions.setContext(context);
- viewer.setInput(input);
-
- RefreshSubscriberInputJob refreshJob = TeamUIPlugin.getPlugin().getRefreshJob();
- refreshJob.setSubscriberInput(input);
- updateStatusPanel();
- setTitle(Policy.bind("LiveSyncView.titleSubscriber", input.getSubscriber().getName())); //$NON-NLS-1$
- }
- });
- }
-
- private void disconnectSubscriberInput() {
- if(input != null) {
- input.deregisterListeners(this);
- input = null;
- }
- }
- /**
- * Toggles between label/tree/table viewers.
- */
- public void switchViewerType(int viewerType) {
- if(viewer == null || viewerType != currentViewType) {
- if (composite == null || composite.isDisposed()) return;
- IStructuredSelection oldSelection = null;
- if(viewer != null) {
- oldSelection = (IStructuredSelection)viewer.getSelection();
- }
- currentViewType = viewerType;
- getStore().setValue(IPreferenceIds.SYNCVIEW_VIEW_TYPE, currentViewType);
- disposeChildren(composite);
- createViewer(composite);
- composite.layout();
- if(oldSelection == null || oldSelection.size() == 0) {
- //gotoDifference(INavigableControl.NEXT);
- } else {
- viewer.setSelection(oldSelection, true);
- }
- fireSafePropertyChange(PROP_VIEWTYPE);
- updateStatusPanel();
- }
- }
-
- /**
- * Adds the listeners to the viewer.
- */
- protected void initializeListeners() {
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged(event);
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleDoubleClick(event);
- }
- });
- viewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- handleOpen(event);
- }
- });
- }
-
- protected void initializeActions() {
- actions = new SyncViewerActions(this);
- actions.restore(memento);
- }
- protected void hookContextMenu() {
- if(viewer != null) {
- MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- actions.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
- }
- protected void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- actions.fillActionBars(bars);
- }
-
- protected void createViewer(Composite parent) {
- if(input == null) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(Policy.bind("SynchronizeView.noSubscribersMessage")); //$NON-NLS-1$
- } else {
- statsPanel = new StatisticsPanel(parent);
- switch(currentViewType) {
- case TREE_VIEW:
- createTreeViewerPartControl(parent);
- break;
- case TABLE_VIEW:
- createTableViewerPartControl(parent);
- break;
- }
- viewer.setInput(input);
- viewer.getControl().setFocus();
- hookContextMenu();
- initializeListeners();
- busyCursor.setControl(viewer.getControl());
- }
- }
-
- protected void createTreeViewerPartControl(Composite parent) {
- GridData data = new GridData(GridData.FILL_BOTH);
- viewer = new SyncTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setLabelProvider(SyncViewerLabelProvider.getDecoratingLabelProvider());
- viewer.setSorter(new SyncViewerSorter(ResourceSorter.NAME));
- ((TreeViewer)viewer).getTree().setLayoutData(data);
- }
-
- protected void createTableViewerPartControl(Composite parent) {
- // Create the table
- Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- GridData data = new GridData(GridData.FILL_BOTH);
- table.setLayoutData(data);
-
- // Set the table layout
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
-
- // Create the viewer
- TableViewer tableViewer = new SyncTableViewer(table);
-
- // Create the table columns
- createColumns(table, layout, tableViewer);
-
- // Set the table contents
- viewer = tableViewer;
- viewer.setContentProvider(new SyncSetTableContentProvider());
- viewer.setLabelProvider(new SyncViewerLabelProvider());
-
- viewer.setSorter(new SyncViewerTableSorter());
- }
-
- /**
- * Creates the columns for the sync viewer table.
- */
- protected void createColumns(Table table, TableLayout layout, TableViewer viewer) {
- SelectionListener headerListener = SyncViewerTableSorter.getColumnListener(viewer);
- // revision
- TableColumn col = new TableColumn(table, SWT.NONE);
- col.setResizable(true);
- col.setText("Resource"); //$NON-NLS-1$
- col.addSelectionListener(headerListener);
- layout.addColumnData(new ColumnWeightData(30, true));
-
- // tags
- col = new TableColumn(table, SWT.NONE);
- col.setResizable(true);
- col.setText("In Folder"); //$NON-NLS-1$
- col.addSelectionListener(headerListener);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- protected void disposeChildren(Composite parent) {
- // Null out the control of the busy cursor while we are switching viewers
- busyCursor.setControl(null);
- Control[] children = parent.getChildren();
- for (int i = 0; i < children.length; i++) {
- Control control = children[i];
- control.dispose();
- }
- }
-
- /**
- * Handles a selection changed event from the viewer. Updates the status line and the action
- * bars, and links to editor (if option enabled).
- *
- * @param event the selection event
- */
- protected void handleSelectionChanged(SelectionChangedEvent event) {
- final IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- updateStatusLine(sel);
- updateActionBars(sel);
- }
-
- protected void handleOpen(OpenEvent event) {
- actions.open();
- }
- /**
- * Handles a double-click event from the viewer.
- * Expands or collapses a folder when double-clicked.
- *
- * @param event the double-click event
- * @since 2.0
- */
- protected void handleDoubleClick(DoubleClickEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object element = selection.getFirstElement();
-
- // Double-clicking should expand/collapse containers
- if (viewer instanceof TreeViewer) {
- TreeViewer tree = (TreeViewer)viewer;
- if (tree.isExpandable(element)) {
- tree.setExpandedState(element, !tree.getExpandedState(element));
- }
- }
-
- }
-
- public void activateSubscriber(TeamSubscriber subscriber) {
- SubscriberInput newInput = (SubscriberInput)subscriberInputs.get(subscriber.getId());
- if (newInput == null) {
- addSubscriber(subscriber);
- };
- if(! newInput.getSubscriber().getId().equals(getInput().getSubscriber().getId())) {
- initializeSubscriberInput(newInput);
- }
- }
-
- protected void updateStatusPanel() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- SubscriberInput input = getInput();
- if(input != null && statsPanel != null) {
- statsPanel.update(new ViewStatusInformation(input));
- }
- }
- });
- }
-
- protected void updateTooltip() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- SubscriberInput input = getInput();
- if(input != null) {
- if(input.getWorkingSet() != null) {
- String tooltip = Policy.bind("LiveSyncView.titleTooltip", input.getWorkingSet().getName()); //$NON-NLS-1$
- setTitleToolTip(tooltip);
- } else {
- setTitleToolTip(""); //$NON-NLS-1$
- }
- }
- }
- });
- }
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- if (viewer == null) return;
- viewer.getControl().setFocus();
- }
-
- public StructuredViewer getViewer() {
- return viewer;
- }
-
- private static void handle(Shell shell, Exception exception, String title, String message) {
- Utils.handleError(shell, exception, title, message);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- super.dispose();
-
- // cancel and wait
- RefreshSubscriberInputJob job = TeamUIPlugin.getPlugin().getRefreshJob();
- job.setRestartOnCancel(false);
- job.cancel();
- try {
- job.join();
- } catch (InterruptedException e) {
- // continue with shutdown
- }
- job.setSubscriberInput(null);
-
- // Cleanup the subscriber inputs
- TeamSubscriber.getSubscriberManager().removeTeamResourceChangeListener(this);
- for (Iterator it = subscriberInputs.values().iterator(); it.hasNext();) {
- SubscriberInput input = (SubscriberInput) it.next();
- input.dispose();
- }
-
- busyCursor.dispose();
- }
-
- public void run(IRunnableWithProgress runnable) {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable);
- } catch (InvocationTargetException e) {
- handle(getSite().getShell(), e, null, null);
- } catch (InterruptedException e) {
- // Nothing to be done
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento)
- */
- public void saveState(IMemento memento) {
- super.saveState(memento);
- actions.save(memento);
- }
-
- public int getViewerType() {
- return currentViewType;
- }
-
- /*
- * Return the current input for the view.
- */
- public SubscriberInput getInput() {
- return input;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.sync.ITeamResourceChangeListener#teamResourceChanged(org.eclipse.team.core.sync.TeamDelta[])
- */
- public void teamResourceChanged(TeamDelta[] deltas) {
- for (int i = 0; i < deltas.length; i++) {
- TeamDelta delta = deltas[i];
- if(delta.getFlags() == TeamDelta.SUBSCRIBER_CREATED) {
- TeamSubscriber s = delta.getSubscriber();
- addSubscriber(s);
- }
- }
- }
-
- /*
- * Add the subscriber to the view. This method does not activate
- * the subscriber.
- */
- synchronized private void addSubscriber(final TeamSubscriber s) {
- SubscriberInput si = new SubscriberInput(s);
- subscriberInputs.put(s.getId(), si);
- ActionContext context = new ActionContext(null);
- context.setInput(si);
- actions.addContext(context);
- }
-
- synchronized public void removeSubscriber(TeamSubscriber s) {
- // notify that context is changing
- SubscriberInput si = (SubscriberInput)subscriberInputs.get(s.getId());
- ActionContext context = new ActionContext(null);
- context.setInput(si);
- actions.removeContext(context);
-
- // dispose of the input
- si.dispose();
-
- // forget about this input
- subscriberInputs.remove(s.getId());
-
- // de-register the subscriber with the platform
- s.cancel();
-
- if (si == input) {
- if (subscriberInputs.isEmpty()) {
- disconnectSubscriberInput();
- if(viewer != null) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if(viewer == null) return;
- ActionContext context = new ActionContext(null);
- context.setInput(null);
- actions.setContext(context);
- viewer.setInput(null);
- setTitle(Policy.bind("LiveSyncView.titleSubscriber")); //$NON-NLS-1$
- }
- });
- }
- } else {
- initializeSubscriberInput((SubscriberInput)subscriberInputs.values().iterator().next());
- }
- }
- }
-
- public void collapseAll() {
- if (viewer == null || !(viewer instanceof AbstractTreeViewer)) return;
- viewer.getControl().setRedraw(false);
- ((AbstractTreeViewer)viewer).collapseToLevel(viewer.getInput(), TreeViewer.ALL_LEVELS);
- viewer.getControl().setRedraw(true);
- }
-
- public ISelection getSelection() {
- return getViewer().getSelection();
- }
-
- /**
- * This method enables "Show In" support for this view
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class key) {
- if (key == IShowInSource.class) {
- return new IShowInSource() {
- public ShowInContext getShowInContext() {
- StructuredViewer v = getViewer();
- if (v == null) return null;
- return new ShowInContext(null, v.getSelection());
- }
- };
- }
- return super.getAdapter(key);
- }
-
- /**
- * Updates the action bar actions.
- *
- * @param selection the current selection
- * @since 2.0
- */
- protected void updateActionBars(IStructuredSelection selection) {
- if (actions != null) {
- ActionContext actionContext = actions.getContext();
- if(actionContext != null) {
- actionContext.setSelection(selection);
- actions.updateActionBars();
- }
- }
- }
-
- /**
- * Updates the message shown in the status line.
- *
- * @param selection the current selection
- */
- protected void updateStatusLine(IStructuredSelection selection) {
- String msg = getStatusLineMessage(selection);
- getViewSite().getActionBars().getStatusLineManager().setMessage(msg);
- }
-
- /**
- * Returns the message to show in the status line.
- *
- * @param selection the current selection
- * @return the status line message
- * @since 2.0
- */
- protected String getStatusLineMessage(IStructuredSelection selection) {
- if (selection.size() == 1) {
- IResource resource = getResource(selection.getFirstElement());
- if (resource == null) {
- return Policy.bind("SynchronizeView.12"); //$NON-NLS-1$
- } else {
- return resource.getFullPath().makeRelative().toString();
- }
- }
- if (selection.size() > 1) {
- return selection.size() + Policy.bind("SynchronizeView.13"); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @param object
- * @return
- */
- private IResource getResource(Object object) {
- return (IResource)TeamAction.getAdapter(object, IResource.class);
- }
-
- /**
- * Makes this view visible in the active page.
- */
- public static SynchronizeView showInActivePage(IWorkbenchPage activePage, boolean allowSwitchingPerspectives) {
- IWorkbench workbench= TeamUIPlugin.getPlugin().getWorkbench();
- IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
-
- if(allowSwitchingPerspectives && ! TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE).equals(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE_NONE)) {
- try {
- String pId = TeamUIPlugin.getPlugin().getPreferenceStore().getString(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE);
- activePage = workbench.showPerspective(pId, window);
- } catch (WorkbenchException e) {
- Utils.handleError(window.getShell(), e, Policy.bind("SynchronizeView.14"), e.getMessage()); //$NON-NLS-1$
- }
- }
- try {
- if (activePage == null) {
- activePage = TeamUIPlugin.getActivePage();
- if (activePage == null) return null;
- }
- return (SynchronizeView)activePage.showView(VIEW_ID);
- } catch (PartInitException pe) {
- Utils.handleError(window.getShell(), pe, Policy.bind("SynchronizeView.16"), pe.getMessage()); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Update the title when either the subscriber or filter sync set changes.
- */
- public void syncSetChanged(SyncSetChangedEvent event) {
- updateStatusPanel();
- }
-
- private void fireSafePropertyChange(final int property) {
- if(! composite.isDisposed()) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- firePropertyChange(property);
- }
- });
- }
- }
-
- public void selectSubscriber(TeamSubscriber subscriber) {
- activateSubscriber(subscriber);
- }
-
- /**
- * Refreshes the resources from the specified subscriber. The working set or filters applied
- * to the sync view do not affect the sync.
- */
- public void refreshWithRemote(TeamSubscriber subscriber, IResource[] resources) {
- QualifiedName id = subscriber.getId();
- if(subscriberInputs.containsKey(id)) {
- if(input != null && ! input.getSubscriber().getId().equals(id)) {
- initializeSubscriberInput((SubscriberInput)subscriberInputs.get(id));
- }
- RefreshAction.run(this, resources, subscriber);
- }
- }
-
- /**
- * Refreshes the resources in the current input for the given subscriber.
- */
- public void refreshWithRemote(TeamSubscriber subscriber) {
- QualifiedName id = subscriber.getId();
- if(input != null && subscriberInputs.containsKey(id)) {
- if(! input.getSubscriber().getId().equals(id)) {
- initializeSubscriberInput((SubscriberInput)subscriberInputs.get(id));
- }
- RefreshAction.run(this, input.workingSetRoots(), subscriber);
- }
- }
-
- /**
- * Refreshes the resources in the current input for the given subscriber.
- */
- public void refreshWithRemote() {
- if(input != null) {
- RefreshAction.run(this, input.workingSetRoots(), input.getSubscriber());
- }
- }
-
- public int getCurrentViewType() {
- return currentViewType;
- }
-
- public void selectAll() {
- if (getViewerType() == TABLE_VIEW) {
- TableViewer table = (TableViewer)getViewer();
- table.getTable().selectAll();
- } else {
- // Select All in a tree doesn't really work well
- }
- }
-
- private IPreferenceStore getStore() {
- return TeamUIPlugin.getPlugin().getPreferenceStore();
- }
-
- public SyncSetContentProvider getContentProvider() {
- return (SyncSetContentProvider)getViewer().getContentProvider();
- }
-
- public void setWorkingSet(IWorkingSet workingSet) {
- actions.setWorkingSet(workingSet);
- }
-
- public void workingSetChanged(IWorkingSet set) {
- input.setWorkingSet(set);
- updateTooltip();
- }
- /**
- * Updates the filter applied to the active subscriber input and ensures that selection and expansions
- * is preserved when the filtered contents are shown.
- * @param filter
- */
- public void updateInputFilter(int[] directions, int[] changeTypes) {
- try {
- if(viewer instanceof INavigableControl) {
- ((INavigableControl)viewer).preserveState(1);
- }
- input.setFilter(
- new AndSyncInfoFilter(
- new SyncInfoFilter[] {
- new SyncInfoDirectionFilter(directions),
- new SyncInfoChangeTypeFilter(changeTypes),
- new PseudoConflictFilter()
- }), new NullProgressMonitor());
- if(viewer instanceof INavigableControl) {
- ((INavigableControl)viewer).restoreState(1);
- }
- } catch (TeamException e) {
- Utils.handleError(getSite().getShell(), e, Policy.bind("SynchronizeView.16"), e.getMessage()); //$NON-NLS-1$
- }
- }
-
- /**
- * Allows clients to change the active sync mode.
- */
- public void setMode(int mode) {
- actions.setMode(mode);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/TeamSynchronizingPerspective.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/TeamSynchronizingPerspective.java
index 356b7ff28..0d25d9b19 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/TeamSynchronizingPerspective.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/TeamSynchronizingPerspective.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.sync.views;
+import org.eclipse.team.internal.ui.sync.pages.NewSynchronizeView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
@@ -41,7 +42,7 @@ public class TeamSynchronizingPerspective implements IPerspectiveFactory {
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
- layout.addShowViewShortcut(SynchronizeView.VIEW_ID);
+ layout.addShowViewShortcut(NewSynchronizeView.VIEW_ID);
layout.addActionSet("org.eclipse.team.ui.actionSet"); //$NON-NLS-1$
}
@@ -52,7 +53,7 @@ public class TeamSynchronizingPerspective implements IPerspectiveFactory {
public void defineLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
IFolderLayout top = layout.createFolder("top", IPageLayout.LEFT, 0.25f, editorArea); //$NON-NLS-1$
- top.addView(SynchronizeView.VIEW_ID);
+ top.addView(NewSynchronizeView.VIEW_ID);
top.addView(IPageLayout.ID_RES_NAV);
top.addView(IPageLayout.ID_OUTLINE);
layout.setEditorAreaVisible(true);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
index d75e632a9..1b6f69822 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
@@ -13,10 +13,7 @@ package org.eclipse.team.ui;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.sync.pages.SynchronizeManager;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
-import org.eclipse.team.ui.sync.ISynchronizeView;
-import org.eclipse.ui.IWorkbenchPage;
/**
* TeamUI contains public API for generic UI-based Team functionality
@@ -38,14 +35,6 @@ public class TeamUI {
}
/**
- * Makes the synchronize view visible in the active page and returns a handle
- * to the view.
- */
- public static ISynchronizeView showSyncViewInActivePage(IWorkbenchPage activePage) {
- return SynchronizeView.showInActivePage(activePage, true /* allow perspective switch */);
- }
-
- /**
* Register for changes made to Team properties.
*
* @param listener the listener to add
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java
index cfd85d906..903188661 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java
@@ -23,6 +23,12 @@ import org.eclipse.ui.IViewPart;
*/
public interface INewSynchronizeView extends IViewPart {
+ /**
+ * The id for this view
+ */
+ public static final String VIEW_ID = "org.eclipse.team.sync.views.SynchronizeView";
+
+
public void display(ISynchronizeViewPage page);
public ISynchronizeViewPage getActivePage();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
index ea05f5c6e..fc718da33 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.team.ui.sync;
+import org.eclipse.ui.IWorkbenchPage;
+
/**
* Manages synchronization pages.
* <p>
@@ -58,4 +60,6 @@ public interface ISynchronizeManager {
* @return a collection of consoles registered with the console manager
*/
public ISynchronizeViewPage[] getSynchronizePages();
+
+ public INewSynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
deleted file mode 100644
index 93368a08f..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.ui.sync;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.ui.IWorkingSet;
-
-public interface ISynchronizeView {
- public final static int INCOMING_MODE = 1;
- public final static int OUTGOING_MODE = 2;
- public final static int BOTH_MODE = 3;
- public final static int CONFLICTING_MODE = 4;
-
- /**
- * Called to set the current selection in the sync viewer for the given subscriber. The viewType
- * parameter determines in which configuration of the view the selection should be made in. If
- * there are no resources passed in the given subscriber is activate.
- *
- * @param resources the resources to select
- * @param viewType the view configuration in which to select the resources
- */
- public void selectSubscriber(TeamSubscriber subscriber);
-
- /**
- * Refreshes the resources from the specified subscriber. The working set or filters applied
- * to the synchronize view are ignored.
- */
- public void refreshWithRemote(TeamSubscriber subscriber, IResource[] resources);
-
- /**
- * Refreshes the resources in the current input for the given subscriber.
- */
- public void refreshWithRemote(TeamSubscriber subscriber);
-
- /**
- * Refreshes the active subscriber.
- */
- public void refreshWithRemote();
-
- /**
- * Returns the current view configuration.
- */
- public int getCurrentViewType();
-
- /**
- * Sets the working set used by the view to the given working set
- */
- public void setWorkingSet(IWorkingSet workingSet);
-
- /**
- * Sets the current mode shown in the sync view. Valid modes are:
- * INCOMING_MODE, OUTGOING_MODE, BOTH_MODE,
- * CONFLICTING_MODE
- */
- public void setMode(int mode);
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java
index 5d399e0d5..6d168f504 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java
@@ -2,16 +2,24 @@ package org.eclipse.team.ui.sync;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.core.subscribers.TeamSubscriber;
+import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.sync.pages.SubscriberSynchronizeViewPage;
import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.part.IPageBookViewPage;
public class SubscriberPage extends AbstractSynchronizeViewPage {
-
+
protected TeamSubscriber subscriber;
protected SubscriberSynchronizeViewPage page;
+ protected int currentMode;
+
+ /**
+ * Property constant indicating the mode of a page has changed.
+ */
+ public static final String P_SYNCVIEWPAGE_WORKINGSET = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_WORKINGSET"; //$NON-NLS-1$
/**
* Property constant indicating the mode of a page has changed.
@@ -36,7 +44,7 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
* as a tree.
*/
public static final int TREE_LAYOUT = 0;
-
+
/**
* View type constant (value 1) indicating that the synchronize view will be shown
* as a table.
@@ -47,12 +55,13 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
super(name, imageDescriptor);
this.subscriber = subscriber;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeViewPage#createPage(org.eclipse.team.ui.sync.ISynchronizeView)
*/
public IPageBookViewPage createPage(INewSynchronizeView view) {
this.page = new SubscriberSynchronizeViewPage(this, view);
+ setMode(TeamUIPlugin.getPlugin().getPreferenceStore().getInt(IPreferenceIds.SYNCVIEW_SELECTED_MODE));
return page;
}
@@ -61,11 +70,14 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
}
public void setMode(int mode) {
- firePropertyChange(this, P_SYNCVIEWPAGE_MODE, new Integer(page.getMode()), new Integer(mode));
+ int oldMode = getMode();
+ currentMode = mode;
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_SELECTED_MODE, mode);
+ firePropertyChange(this, P_SYNCVIEWPAGE_MODE, new Integer(oldMode), new Integer(mode));
}
public int getMode() {
- return page.getMode();
+ return currentMode;
}
public void setLayout(int layout) {
@@ -76,24 +88,28 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
return page.getLayout();
}
+ public void setWorkingSet(IWorkingSet set) {
+ firePropertyChange(this, P_SYNCVIEWPAGE_WORKINGSET, null, set);
+ }
+
+ public TeamSubscriber getSubscriber() {
+ return subscriber;
+ }
+
+ public void setActionsBars(IActionBars actionBars) {
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeViewPage#dispose()
*/
protected void dispose() {
super.dispose();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeViewPage#init()
*/
protected void init() {
super.init();
}
-
- public TeamSubscriber getSubscriber() {
- return subscriber;
- }
-
- public void setActionsBars(IActionBars actionBars) {
- }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
new file mode 100644
index 000000000..5dc724c30
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * 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.sync.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.sync.INewSynchronizeView;
+import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IKeyBindingService;
+import org.eclipse.ui.actions.ActionGroup;
+
+/**
+ * This ActionGroup provides filtering of a sync set by change direction.
+ * The actions are presented to the user as toolbar buttons where only one
+ * button is active at a time
+ */
+public class DirectionFilterActionGroup extends ActionGroup implements IPropertyChangeListener {
+
+ // An array of the selection actions for the modes (indexed by mode constant)
+ private List actions = new ArrayList(3);
+
+ private DirectionFilterAction incomingMode;
+ private DirectionFilterAction outgoingMode;
+ private DirectionFilterAction bothMode;
+ private DirectionFilterAction conflictsMode;
+ private INewSynchronizeView view;
+ private SubscriberPage page;
+
+ class DirectionFilterAction extends Action {
+ private int modeId;
+
+ public DirectionFilterAction(String prefix,String commandId, int modeId) {
+ super("", AS_RADIO_BUTTON); //$NON-NLS-1$
+ this.modeId = modeId;
+ Utils.initAction(this, prefix);
+ Action a = new Action() {
+ public void run() {
+ DirectionFilterAction.this.run();
+ }
+ };
+ IKeyBindingService kbs = view.getSite().getKeyBindingService();
+ Utils.registerAction(kbs, a, commandId); //$NON-NLS-1$
+ }
+ public void run() {
+ // checkMode() is called because programatic checking of radio buttons doesn't
+ // consider radio buttons, hence breaks the radio-button behavior. As a workaround
+ // we have to manually check/uncheck the set instead.
+ checkMode(modeId);
+ page.setMode(modeId);
+ }
+ public int getModeId() {
+ return modeId;
+ }
+ }
+
+ public DirectionFilterActionGroup(INewSynchronizeView view, SubscriberPage page) {
+ this.page = page;
+ this.view = view;
+ createActions();
+ page.addPropertyChangeListener(this);
+ checkMode(page.getMode());
+ }
+
+ /**
+ * Sets up the sync modes and the actions for switching between them.
+ */
+ private void createActions() {
+ // Create the actions
+ incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", SubscriberPage.INCOMING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ actions.add(incomingMode);
+
+ outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", SubscriberPage.OUTGOING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ actions.add(outgoingMode);
+
+ bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", SubscriberPage.BOTH_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ actions.add(bothMode);
+
+ conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", SubscriberPage.CONFLICTING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ actions.add(conflictsMode);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
+ */
+ public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
+ IToolBarManager toolBar = actionBars.getToolBarManager();
+ for (Iterator it = actions.iterator(); it.hasNext();) {
+ DirectionFilterAction action = (DirectionFilterAction) it.next();
+ toolBar.add(action);
+ }
+ }
+
+ private void checkMode(int mode) {
+ for (Iterator it = actions.iterator(); it.hasNext();) {
+ DirectionFilterAction action = (DirectionFilterAction)it.next();
+ if(action.getModeId() == mode) {
+ action.setChecked(true);
+ } else {
+ action.setChecked(false);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ page.removePropertyChangeListener(this);
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#dispose()
+ */
+ public void dispose() {
+ // TODO Auto-generated method stub
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ExpandAllAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ExpandAllAction.java
new file mode 100644
index 000000000..74af2361c
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ExpandAllAction.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.ui.sync.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.ui.IViewPart;
+
+
+public class ExpandAllAction extends Action {
+ private IViewPart part;
+ private AbstractTreeViewer viewer;
+
+ public ExpandAllAction(IViewPart part) {
+ this.part = part;
+ Utils.initAction(this, "action.expandAll."); //$NON-NLS-1$
+ }
+
+ public void run() {
+ expandSelection();
+ }
+
+ public void setTreeViewer(AbstractTreeViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ public void update() {
+ setEnabled(viewer != null && hasSelection());
+ }
+
+ protected void expandSelection() {
+ if (viewer != null) {
+ ISelection selection = getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Iterator elements = ((IStructuredSelection)selection).iterator();
+ while (elements.hasNext()) {
+ Object next = elements.next();
+ viewer.expandToLevel(next, AbstractTreeViewer.ALL_LEVELS);
+ }
+ }
+ }
+ }
+
+ private ISelection getSelection() {
+ return part.getSite().getPage().getSelection();
+ }
+
+ private boolean hasSelection() {
+ ISelection selection = getSelection();
+ return (selection != null && !selection.isEmpty());
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/OpenWithActionGroup.java
index 8b0641c08..ad1b195bf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/OpenWithActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/OpenWithActionGroup.java
@@ -17,7 +17,6 @@ import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.OpenFileAction;
import org.eclipse.ui.actions.OpenWithMenu;
@@ -43,12 +42,7 @@ public class OpenWithActionGroup extends ActionGroup {
}
public void fillContextMenu(IMenuManager menu) {
- ActionContext context = getContext();
- IStructuredSelection selection = null;
- if (context != null) {
- selection = (IStructuredSelection) context.getSelection();
- }
- fillOpenWithMenu(menu, selection);
+ fillOpenWithMenu(menu, (IStructuredSelection)part.getSite().getPage().getSelection());
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RefactorActionGroup.java
index c39157b4b..30caa307b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RefactorActionGroup.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
+package org.eclipse.team.ui.sync.actions;
import java.util.Iterator;
@@ -17,15 +17,15 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.DeleteResourceAction;
import org.eclipse.ui.actions.MoveResourceAction;
import org.eclipse.ui.actions.RenameResourceAction;
@@ -36,30 +36,19 @@ import org.eclipse.ui.actions.TextActionHandler;
* the org.eclipse.ui.workbench plugin. We couldn't reuse that class
* because of a hard dependency on the navigator.
*/
-public class RefactorActionGroup extends SyncViewerActionGroup {
+public class RefactorActionGroup extends ActionGroup {
- private Clipboard clipboard;
-
- private CopyAction copyAction;
private DeleteResourceAction deleteAction;
- private PasteAction pasteAction;
private MoveResourceAction moveAction;
private RenameResourceAction renameAction;
private TextActionHandler textActionHandler;
+ private IWorkbenchPart part;
- protected RefactorActionGroup(SynchronizeView syncView) {
- super(syncView);
+ public RefactorActionGroup(IWorkbenchPart part) {
+ this.part = part;
makeActions();
}
- public void dispose() {
- if (clipboard != null) {
- clipboard.dispose();
- clipboard = null;
- }
- super.dispose();
- }
-
public void fillContextMenu(IMenuManager parentMenu) {
IStructuredSelection selection = getSelection();
@@ -70,10 +59,6 @@ public class RefactorActionGroup extends SyncViewerActionGroup {
IResource.PROJECT | IResource.FOLDER | IResource.FILE);
MenuManager menu = new MenuManager(Policy.bind("RefactorActionGroup.0")); //$NON-NLS-1$
- copyAction.selectionChanged(selection);
- menu.add(copyAction);
- pasteAction.selectionChanged(selection);
- menu.add(pasteAction);
if (anyResourceSelected) {
deleteAction.selectionChanged(selection);
@@ -88,30 +73,17 @@ public class RefactorActionGroup extends SyncViewerActionGroup {
public void fillActionBars(IActionBars actionBars) {
textActionHandler = new TextActionHandler(actionBars); // hooks handlers
- textActionHandler.setCopyAction(copyAction);
- textActionHandler.setPasteAction(pasteAction);
textActionHandler.setDeleteAction(deleteAction);
renameAction.setTextActionHandler(textActionHandler);
}
protected void makeActions() {
// Get the key binding service for registering actions with commands.
- final IWorkbenchPartSite site = getSyncView().getSite();
+ final IWorkbenchPartSite site = part.getSite();
final IKeyBindingService keyBindingService = site.getKeyBindingService();
Shell shell = site.getShell();
- clipboard = new Clipboard(shell.getDisplay());
-
- pasteAction = new PasteAction(shell, clipboard);
ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
- pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
- pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
- pasteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_HOVER));
-
- copyAction = new CopyAction(shell, clipboard, pasteAction);
- copyAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
- copyAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- copyAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_HOVER));
moveAction = new MoveResourceAction(shell);
renameAction = new RenameResourceAction(shell);
@@ -130,15 +102,13 @@ public class RefactorActionGroup extends SyncViewerActionGroup {
public void updateActionBars() {
IStructuredSelection selection = getSelection();
- copyAction.selectionChanged(selection);
- pasteAction.selectionChanged(selection);
deleteAction.selectionChanged(selection);
moveAction.selectionChanged(selection);
renameAction.selectionChanged(selection);
}
private IStructuredSelection getSelection() {
- return (IStructuredSelection)getSyncView().getSelection();
+ return (IStructuredSelection)part.getSite().getPage().getSelection();
}
private boolean allResourcesAreOfType(IStructuredSelection selection, int resourceMask) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java
index 89f897ced..7271f51ba 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java
@@ -8,30 +8,22 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.sync.actions;
+package org.eclipse.team.ui.sync.actions;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.sync.ISynchronizeViewPage;
-/**
- * This class acts as the superclass for all actions in the SynchronizeView
- */
-public abstract class SyncViewerAction extends Action {
+public class RemoveSynchronizeViewPageAction extends Action {
+ private ISynchronizeViewPage page;
- private IViewPart viewPart;
- private ISelection selection;
-
- /**
- * @param text
- */
- public SyncViewerAction(IViewPart viewPart, String label) {
- super(label);
- this.viewPart = viewPart;
+ public RemoveSynchronizeViewPageAction(ISynchronizeViewPage page) {
+ this.page = page;
+ Utils.initAction(this, "action.removePage."); //$NON-NLS-1$
}
-
- public Shell getShell() {
- return viewPart.getSite().getShell();
+
+ public void run() {
+ TeamUI.getSynchronizeManager().removeSynchronizePages(new ISynchronizeViewPage[] {page});
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java
index 8012175b2..df04bfc6c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java
@@ -15,18 +15,17 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
import org.eclipse.team.ui.sync.SubscriberPage;
-public class ToggleViewAction extends Action implements IPropertyChangeListener {
+public class ToggleViewLayoutAction extends Action implements IPropertyChangeListener {
private int layout;
private SubscriberPage page;
- public ToggleViewAction(SubscriberPage page, int layout) {
+ public ToggleViewLayoutAction(SubscriberPage page, int layout) {
super(null, SWT.RADIO);
this.page = page;
this.layout = layout;
- if(layout == SynchronizeView.TABLE_VIEW) {
+ if(layout == SubscriberPage.TABLE_LAYOUT) {
Utils.initAction(this, "action.toggleViewFlat."); //$NON-NLS-1$
} else {
Utils.initAction(this, "action.toggleViewHierarchical."); //$NON-NLS-1$
@@ -46,7 +45,6 @@ public class ToggleViewAction extends Action implements IPropertyChangeListener
if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_LAYOUT)) {
Integer newLayout = (Integer)event.getNewValue();
setChecked(newLayout.intValue() == layout);
- }
-
+ }
}
} \ No newline at end of file

Back to the top