Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-01-28 23:50:06 -0500
committerJean Michel-Lemieux2004-01-28 23:50:06 -0500
commit08f9005a931b6eabf03618ae959707a3113a6a98 (patch)
treee097dea6fd08074d1a9cf37e9939364a81f00dd3
parentf77e8b5b7f064e4ca5beb9262cc4ccd3f2b67894 (diff)
downloadeclipse.platform.team-08f9005a931b6eabf03618ae959707a3113a6a98.tar.gz
eclipse.platform.team-08f9005a931b6eabf03618ae959707a3113a6a98.tar.xz
eclipse.platform.team-08f9005a931b6eabf03618ae959707a3113a6a98.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizePage.java3
-rw-r--r--bundles/org.eclipse.team.ui/DESIGN.TXT26
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt57
-rw-r--r--bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java6
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java73
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshEvent.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshSubscriberListener.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java42
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java96
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java26
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressFolderView.java36
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/DefaultLogicalView.java66
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ILogicalView.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/ILogicalView.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ITreeViewerAccessor.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/LogicalViewProvider.java64
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java176
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java)230
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/RefreshSchedule.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCheckboxCompareInput.java41
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberPageDiffTreeViewerConfiguration.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java)17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/INavigableTree.java62
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/RefreshAction.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SyncInfoDiffTreeNavigator.java294
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/LogicalViewProvider.java97
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDecoratingLabelProvider.java29
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/TeamOperationInput.java58
44 files changed, 562 insertions, 1103 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
index 815a334de..1515b7e98 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
@@ -90,7 +90,7 @@ public class ReleaseCommentDialog extends DetailsDialog {
TeamSubscriberParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
FastSyncInfoFilter.SyncInfoDirectionFilter filter = new FastSyncInfoFilter.SyncInfoDirectionFilter(SyncInfo.OUTGOING);
compareEditorInput = new SyncInfoSetCompareInput(cc,
- new SyncInfoSetCompareConfiguration(null, participant.getTeamSubscriberSyncInfoCollector().getSyncInfoSet()));
+ new DiffTreeViewerConfiguration(null, participant.getTeamSubscriberSyncInfoCollector().getSyncInfoSet()));
// set F1 help
WorkbenchHelp.setHelp(composite, IHelpContextIds.RELEASE_COMMENT_DIALOG);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
index 9c7a8e89e..9b6478f51 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSLocalCompareConfiguration.java
@@ -18,17 +18,15 @@ import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.core.subscribers.FilteredSyncInfoCollector;
-import org.eclipse.team.core.subscribers.TeamSubscriberSyncInfoCollector;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
-import org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration;
+import org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration;
import org.eclipse.team.ui.synchronize.actions.RefreshAction;
/**
* Provides compare specific support
*/
-public class CVSLocalCompareConfiguration extends SyncInfoSetCompareConfiguration {
+public class CVSLocalCompareConfiguration extends DiffTreeViewerConfiguration {
private CVSCompareSubscriber subscriber;
private TeamSubscriberSyncInfoCollector collector;
@@ -58,7 +56,7 @@ public class CVSLocalCompareConfiguration extends SyncInfoSetCompareConfiguratio
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#dispose()
*/
- protected void dispose() {
+ public void dispose() {
filteredSyncSet.dispose();
collector.dispose();
subscriber.dispose();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
index 3870eedc1..b346bb2bb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
@@ -18,7 +18,7 @@ import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.views.*;
import org.eclipse.team.ui.synchronize.views.SyncInfoLabelProvider;
-public class CVSSynchronizeViewCompareConfiguration extends SynchronizeViewCompareConfiguration {
+public class CVSSynchronizeViewCompareConfiguration extends TeamSubscriberPageDiffTreeViewerConfiguration {
private static class CVSLabelProvider extends SyncInfoDecoratingLabelProvider {
protected CVSLabelProvider(SyncInfoLabelProvider syncInfoLabelProvider) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
index 7ef634814..4ae3f1896 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
@@ -115,7 +115,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.TeamSubscriberParticipantPage#createSyncInfoSetCompareConfiguration()
*/
- protected SynchronizeViewCompareConfiguration createSyncInfoSetCompareConfiguration() {
+ protected TeamSubscriberPageDiffTreeViewerConfiguration createSyncInfoSetCompareConfiguration() {
return new CVSSynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizePage.java
index 6f17059cb..43f63e413 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizePage.java
@@ -34,9 +34,6 @@ public class MergeSynchronizePage extends CVSSynchronizeViewPage {
Utils.initAction(updateAdapter, "action.SynchronizeViewUpdate.", Policy.getBundle()); //$NON-NLS-1$
getParticipant().setMode(TeamSubscriberParticipant.INCOMING_MODE);
-
- // force enablement to be update on action delegates
- // syncSetChanged(null);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/DESIGN.TXT b/bundles/org.eclipse.team.ui/DESIGN.TXT
index dcd3b7d5e..383a0183f 100644
--- a/bundles/org.eclipse.team.ui/DESIGN.TXT
+++ b/bundles/org.eclipse.team.ui/DESIGN.TXT
@@ -1,27 +1,39 @@
+======================
+ core
+======================
SyncInfo
- represents relative sync of local and remote gives access to resources
TeamSubscriber
- creates sync infos
-SyncInfoSet (optimized collection of sync infos - immutable)
-MutableSyncInfoSet
+SyncInfoSet/MutableSyncInfoSet (optimized collection of sync infos - immutable)
SyncInfoCollector (collects sync infos from subscriber, and optionally from workspace. Uses background thread to collect and calculate changes. Is updated automatically with changes)
FilteredSyncInfoSet (filters a provided sync info set with a given filter and possible roots)
-SynchronizeParticipant (shows in the sync view, has a mode, working set, and creates a page with the UI pieces)
+======================
+ ui
+======================
-Mode
+ISynchronizeView
-WorkingSet
+ISynchronizeParticipant (shows in the sync view, has a mode, working set, and creates a page with the UI pieces)
+
+
+
+
+Mode (DirectionFilterActionGroup)
SyncInfoFilter
-SyncInfoDiffTreeViewer
+SyncInfoSetCompareConfiguration (encapsulates navigation, menus, content, label providers)this
+ is used to configure a viewer in different ways based on it's use.
+
+SyncInfoDiffTreeViewer/SyncInfoDiffCheckboxViewer (shows diff nodes)
-SyncInfoDiffNode -> DiffNode + ICompareInput
+SyncInfoDiffNode -> DiffNode
SyncInfoSetCompareInput \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
index 5b516c1b6..412a7106f 100644
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -1,3 +1,17 @@
+======================================================================
+ EXAMPLE TEAM UI API USAGES
+======================================================================
+1. embeding sync viewer in dialog/wizard
+2. added a new content provider (logical views)
+3. adding custom label decorations
+4. actions/menus
+5. fetching sync info set without instantiating a participant
+6. fetch and wait for the event collector to finish processing the changes
+
+======================================================================
+ PR LIST (07-01-2004)
+======================================================================
+
x P3 schedule support by participant.
this requires changing the refresh jobs to accept scheduling different jobs. Essentially being able to have an
ordered queue of refreshes. Also, participant will need a schedule object to encapsulate the schedule logic.
@@ -40,23 +54,30 @@ x P2 need an event for adding roots to a subscriber to update the list shown
x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
- overiding outgoing/incoming doesn't show the changes in the commit dialog because the filter is only configured to show in one direction.
-
-- example sync view api usages:
- 1. embeding sync viewer in dialog/wizard
- 2. added a new content provider
- 3. adding custom label decorations
- 4. actions/menus
- 5. fetching sync info set without instantiating a participant
- 6. fetch and wait for the event collector to finish processing the changes
-
-
- To be PRd:
- - progress monitoring in SyncSet.reset and such. there are many places where null progress monitors are passed along.
- - showing sync view in commit dialog is complicated because there is no easy way of finding out exactly which resources will be committed at the
+======================================================================
+ PR LIST (16-01-2004)
+======================================================================
+- progress monitoring in SyncSet.reset and such. there are many places where null progress monitors are passed along.
+- showing sync view in commit dialog is complicated because there is no easy way of finding out exactly which resources will be committed at the
point the commit comment dialog is shown. Need to provide new API on the commit dialog for this.
- - convert details dialogs that show sync view into wizards, this allows more room to browse the changes. almost like the refactoring. Preview >> button instead of Next >>.
- - can you have non-diff nodes in the sync view? there shouldn't be any assumptions about the type of diff nodes in the sync view. Basically, any type of diff node should be supported.
- This would allow adding logical elements to the view don't directly have an associated IResource or SyncInfo.
- - workbenchadapter for SyncInfoSet, SyncInfo objects?
- - job status handler API or not?? \ No newline at end of file
+- convert details dialogs that show sync view into wizards, this allows more room to browse the changes. almost like the refactoring. Preview >> button instead of Next >>.
+- job status handler API or not??
+
+
+======================================================================
+ PR LIST (26-01-2004)
+======================================================================
+- navigable APIs must be consolidated, sync view navigation
+- compare configuration review
+- logical view extensions
+ - based on project natures
+ - ui (e.g. layouts/context menu??)
+- content provider should not assume diff nodes have associated resources
+ - content provider input? Is it a diff node or sync set? diff node hack required for getting the
+ compare editor input working.
+- viewer input as a diffnode with a sync set seems wrong?
+- share reconciling with existing (e.g. using compare contents to resolve)
+- comment grouping logical view
+- target migration
+ \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java
index f761eea67..bc600a5bb 100644
--- a/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java
+++ b/bundles/org.eclipse.team.ui/org.eclipse.jdt.ui.team/src/org/eclipse/jdt/ui/team/JavaLogicalViewProvider.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.jdt.ui.team;
+import org.eclipse.team.internal.ui.synchronize.views.*;
+import org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration;
import org.eclipse.team.ui.synchronize.views.*;
/**
@@ -17,6 +19,10 @@ import org.eclipse.team.ui.synchronize.views.*;
*/
public class JavaLogicalViewProvider extends LogicalViewProvider {
+ public JavaLogicalViewProvider(DiffTreeViewerConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.content.LogicalViewProvider#getContentProvider()
*/
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index f9b66d6c9..b75236a16 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -212,14 +212,4 @@
id="org.eclipse.team.ui.actionSet">
</actionSet>
</extension>
-<!-- ***************** Logical views ********************** -->
-<extension
- point="org.eclipse.team.ui.logicalViews">
- <logicalView
- name="%CompressFolderView.name"
- description="%CompressFolderView.description"
- class="org.eclipse.team.internal.ui.synchronize.views.CompressFolderView"
- id="org.eclipse.team.ui.compressed-folder-view">
- </logicalView>
-</extension>
</plugin>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
index b67505869..acaf2b035 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/PreferencePageContainerDialog.java
@@ -250,7 +250,7 @@ public class PreferencePageContainerDialog extends Dialog implements IPreference
gd = new GridData();
gd.horizontalAlignment = GridData.END;
fTitleImage.setLayoutData(gd);
-
+ updateMessage();
return fTitleArea;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
index 208eb9974..e616ed2e7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
@@ -23,6 +23,7 @@ import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.actions.*;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
index fb8d3b062..51c300bac 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
@@ -5,6 +5,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.internal.ui.synchronize.RefreshCompleteDialog;
import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
import org.eclipse.team.ui.synchronize.actions.*;
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 9fd515a1a..fd0dc7763 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
@@ -435,8 +435,8 @@ StatisticsPanel.workingSetTooltip=Double-click to change the working set applied
StatisticsPanel.numbersTooltip=The number of ''{0}'' changes in the entire workspace.
StatisticsPanel.numbersWorkingSetTooltip=The number of ''{0}'' changes in working set ''{1}'' versus those in the entire workspace.
-SyncViewerPreferencePage.6=Synchronize view preferences
-SyncViewerPreferencePage.7=Team Synchronize View settings:
+SyncViewerPreferencePage.6=General Synchronize Settings
+SyncViewerPreferencePage.7=General Team Settings:
SyncViewerPreferencePage.8=Display
SyncViewerPreferencePage.9=Compress in-sync folder paths when using the tree view
SyncViewerPreferencePage.10=Use incoming/outgoing mode when synchronizing
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
index b94fd39fe..a423da7c9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
@@ -30,7 +30,6 @@ import org.eclipse.ui.*;
public class SyncViewerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceIds {
private BooleanFieldEditor compressFolders = null;
- private BooleanFieldEditor smartModeSwitch = null;
private BooleanFieldEditor showSyncInLabels = null;
private BooleanFieldEditor promptWithChanges = null;
private BooleanFieldEditor promptWhenNoChanges = null;
@@ -51,73 +50,6 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
}
}
- class IntegerFieldEditor2 extends IntegerFieldEditor {
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#createControl(org.eclipse.swt.widgets.Composite)
- */
- protected void createControl(Composite parent) {
- super.createControl(parent);
- }
-
- public IntegerFieldEditor2(String name, String labelText, Composite parent, int size) {
- super(name, labelText, parent, size);
- }
-
- protected boolean checkState() {
- Text control= getTextControl();
- if (!control.isEnabled()) {
- clearErrorMessage();
- return true;
- }
- return super.checkState();
- }
-
- /**
- * Overrode here to be package visible.
- */
- protected void refreshValidState() {
- super.refreshValidState();
- }
-
- /**
- * Only store if the text control is enabled
- * @see FieldEditor#doStore()
- */
- protected void doStore() {
- Text text = getTextControl();
- if (text.isEnabled()) {
- super.doStore();
- }
- }
- /**
- * Clears the error message from the message line if the error
- * message is the error message from this field editor.
- */
- protected void clearErrorMessage() {
- if (getPreferencePage() != null) {
- String message= getPreferencePage().getErrorMessage();
- if (message != null) {
- if(getErrorMessage().equals(message)) {
- super.clearErrorMessage();
- }
-
- } else {
- super.clearErrorMessage();
- }
- }
- }
- }
-
- class BooleanFieldEditor2 extends BooleanFieldEditor {
- public BooleanFieldEditor2(String name, String labelText, int style, Composite parent) {
- super(name, labelText, style, parent);
- }
-
- protected void refreshValidState() {
- updateEnablements();
- }
- }
-
public SyncViewerPreferencePage() {
super(GRID);
setTitle(Policy.bind("SyncViewerPreferencePage.6")); //$NON-NLS-1$
@@ -137,16 +69,12 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
public void createFieldEditors() {
-
- GridData data;
Group displayGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.8")); //$NON-NLS-1$
compressFolders = new BooleanFieldEditor(SYNCVIEW_COMPRESS_FOLDERS, Policy.bind("SyncViewerPreferencePage.9"), SWT.NONE, displayGroup); //$NON-NLS-1$
addField(compressFolders);
showSyncInLabels = new BooleanFieldEditor(SYNCVIEW_VIEW_SYNCINFO_IN_LABEL, Policy.bind("SyncViewerPreferencePage.19"), SWT.NONE, displayGroup); //$NON-NLS-1$
addField(showSyncInLabels);
- //smartModeSwitch = new BooleanFieldEditor(SYNCVIEW_VIEW_SMART_MODE_SWITCH, "Smart mode switch", SWT.NONE, displayGroup); //$NON-NLS-1$
- //addField(smartModeSwitch);
Group promptGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.30")); //$NON-NLS-1$
@@ -174,7 +102,6 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
addField(comboEditor);
Dialog.applyDialogFont(getFieldEditorParent());
- updateLayout(displayGroup);
updateLayout(perspectiveGroup);
getFieldEditorParent().layout(true);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java
index 39f56a259..c242be86c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewDescriptor.java
@@ -11,8 +11,8 @@
package org.eclipse.team.internal.ui.registry;
import org.eclipse.core.runtime.*;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
-import org.eclipse.team.ui.synchronize.views.LogicalViewProvider;
+import org.eclipse.team.internal.ui.synchronize.views.ILogicalView;
+import org.eclipse.team.internal.ui.synchronize.views.LogicalViewProvider;
import org.eclipse.ui.internal.WorkbenchPlugin;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java
index 52a208f73..3f36261b9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/LogicalViewRegistry.java
@@ -16,7 +16,7 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
+import org.eclipse.team.internal.ui.synchronize.views.ILogicalView;
public class LogicalViewRegistry extends RegistryReader {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java
index a1879a1b9..5ed830660 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshEvent.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.actions;
+package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshSubscriberListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
index 0a503df7c..12bb707a5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/IRefreshSubscriberListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
@@ -1,4 +1,4 @@
-package org.eclipse.team.ui.synchronize.actions;
+package org.eclipse.team.internal.ui.synchronize;
public interface IRefreshSubscriberListener {
public void refreshStarted(IRefreshEvent event);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
index 52161d784..fa5bbe502 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
@@ -27,7 +27,6 @@ import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.actions.IRefreshEvent;
public class RefreshCompleteDialog extends DetailsDialog {
@@ -52,7 +51,7 @@ public class RefreshCompleteDialog extends DetailsDialog {
this.set = new FilteredSyncInfoCollector(participant.getTeamSubscriberSyncInfoCollector().getSyncInfoSet(), getResources(), null);
this.compareEditorInput = new SyncInfoSetCompareInput(new CompareConfiguration(),
- new SyncInfoSetCompareConfiguration(participant.getId(), set.getSyncInfoSet()));
+ new DiffTreeViewerConfiguration(participant.getId(), set.getSyncInfoSet()));
IDialogSettings workbenchSettings = TeamUIPlugin.getPlugin().getDialogSettings();
this.settings = workbenchSettings.getSection("RefreshCompleteDialog");//$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index e5c4083ee..48bbb49a8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -18,9 +18,9 @@ import org.eclipse.jface.util.ListenerList;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.registry.*;
+import org.eclipse.team.internal.ui.synchronize.views.ILogicalView;
import org.eclipse.team.ui.ITeamUIConstants;
import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
import org.eclipse.ui.*;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java
deleted file mode 100644
index 83c7cd8a2..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewAction.java
+++ /dev/null
@@ -1,42 +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.synchronize.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
-
-/**
- * Action that selects an <code>ILogicalView</code>.
- */
-public class LogicalViewAction extends Action {
-
- private ILogicalView view;
- private LogicalViewActionGroup group;
-
- public LogicalViewAction(ILogicalView view, LogicalViewActionGroup group) {
- this.view = view;
- this.group = group;
- setText(view.getLabel());
- setDescription(view.getDescription());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- group.selectView(view);
- }
-
- public ILogicalView getView() {
- return view;
- }
-
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java
deleted file mode 100644
index 67d88b024..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/LogicalViewActionGroup.java
+++ /dev/null
@@ -1,96 +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.synchronize.actions;
-
-import java.util.*;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
-import org.eclipse.ui.actions.ActionGroup;
-
-/**
- * Action group that populates a context menu with the available logical views.
- */
-public class LogicalViewActionGroup extends ActionGroup {
-
- public static final String SELECTED_VIEW = "selected-view"; //$NON-NLS-1$
-
- Action noLogicalView;
- List actions = new ArrayList();
- ILogicalView selectedView;
- IPropertyChangeListener listener;
-
- public LogicalViewActionGroup() {
- makeActions();
- }
-
- private void makeActions() {
- noLogicalView = new Action() {
- public void run() {
- selectView(null);
- }
- };
- Utils.initAction(noLogicalView, "action.noLogicalView.", Policy.getBundle());
- ILogicalView[] views = TeamUI.getSynchronizeManager().getLogicalViews();
- for (int i = 0; i < views.length; i++) {
- ILogicalView view = views[i];
- actions.add(new LogicalViewAction(view, this));
- }
- }
-
- public void fillContextMenu(IMenuManager parentMenu) {
- MenuManager menu =
- new MenuManager("Logical View"); //$NON-NLS-1$
- menu.add(noLogicalView);
- menu.add(new Separator());
- boolean hasSelection = false;
- for (Iterator iter = actions.iterator(); iter.hasNext();) {
- LogicalViewAction element = (LogicalViewAction) iter.next();
- menu.add(element);
- boolean selected = isSelected(element.getView().getId());
- hasSelection |= selected;
- element.setChecked(selected);
- }
- noLogicalView.setChecked(!hasSelection);
- parentMenu.add(menu);
- }
-
- private boolean isSelected(String id) {
- if (selectedView == null || id == null) return false;
- return selectedView.getId().equals(id);
- }
-
-
- /* package */ void selectView(ILogicalView view) {
- ILogicalView oldView = selectedView;
- selectedView = view;
- firePropertyChangeEvent(SELECTED_VIEW, oldView, view);
- }
-
- public void setPropertyChangeListener(IPropertyChangeListener listener) {
- this.listener = listener;
- }
-
- private void firePropertyChangeEvent(String property, Object oldValue, Object newValue) {
- if (listener == null)
- return;
- listener.propertyChange(new PropertyChangeEvent(this, property, oldValue, newValue));
- }
-
- public void setSelectedView(ILogicalView view) {
- selectedView = view;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
index 8c6526621..e9729c5cf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
@@ -12,13 +12,13 @@ package org.eclipse.team.internal.ui.synchronize.actions;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.ICompareNavigator;
+import org.eclipse.compare.internal.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.actions.ActionFactory;
@@ -31,17 +31,23 @@ import org.eclipse.ui.actions.ActionFactory;
* @since 3.0
*/
public class NavigateAction extends Action {
- private final int direction;
+ private final boolean next;
private ISynchronizeView view;
- private SyncInfoDiffTreeNavigator navigator;
+ private INavigatable navigator;
- public NavigateAction(ISynchronizeView view, SyncInfoDiffTreeNavigator navigator, int direction) {
+ /**
+ * Direction to navigate
+ */
+ final public static int NEXT = 1;
+ final public static int PREVIOUS = 2;
+
+ public NavigateAction(ISynchronizeView view, INavigatable navigator, boolean next) {
this.navigator = navigator;
this.view = view;
- this.direction = direction;
+ this.next = next;
IKeyBindingService kbs = view.getSite().getKeyBindingService();
- if(direction == SyncInfoDiffTreeNavigator.NEXT) {
+ if(next) {
Utils.initAction(this, "action.navigateNext."); //$NON-NLS-1$
view.getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.NEXT.getId(), this);
} else {
@@ -57,7 +63,7 @@ public class NavigateAction extends Action {
private void navigate() {
SyncInfo info = getSyncInfoFromSelection();
if(info == null) {
- if(navigator.gotoDifference(direction)) {
+ if(navigator.gotoDifference(next)) {
return;
} else {
info = getSyncInfoFromSelection();
@@ -66,7 +72,7 @@ public class NavigateAction extends Action {
}
if(info.getLocal().getType() != IResource.FILE) {
- if(! navigator.gotoDifference(direction)) {
+ if(! navigator.gotoDifference(next)) {
info = getSyncInfoFromSelection();
OpenInCompareAction.openCompareEditor(view, view.getParticipant(), info, true /* keep focus */);
}
@@ -83,8 +89,8 @@ public class NavigateAction extends Action {
input = (CompareEditorInput)editor.getEditorInput();
navigator = (ICompareNavigator)input.getAdapter(ICompareNavigator.class);
if(navigator != null) {
- if(navigator.selectChange(direction == SyncInfoDiffTreeNavigator.NEXT)) {
- if(! this.navigator.gotoDifference(direction)) {
+ if(navigator.selectChange(next)) {
+ if(! this.navigator.gotoDifference(next)) {
info = getSyncInfoFromSelection();
OpenInCompareAction.openCompareEditor(view, view.getParticipant(), info, true /* keep focus */);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressFolderView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressFolderView.java
deleted file mode 100644
index 5350317dd..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/CompressFolderView.java
+++ /dev/null
@@ -1,36 +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.synchronize.views;
-
-import org.eclipse.team.ui.synchronize.views.*;
-
-/**
- * This implementation compresses folder paths that do not contain out-of-sync resource.
- */
-public class CompressFolderView extends LogicalViewProvider {
-
- public static final String ID = "org.eclipse.team.ui.compressed-folder-view"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.content.ILogicalSyncInfoSetView#getContentProvider()
- */
- public SyncInfoSetTreeContentProvider getContentProvider() {
- return new CompressedFolderContentProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.content.ILogicalSyncInfoSetView#getLabelProvider()
- */
- public SyncInfoLabelProvider getLabelProvider() {
- return new CompressedFolderLabelProvider();
- }
-
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/DefaultLogicalView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/DefaultLogicalView.java
new file mode 100644
index 000000000..e06c4d10f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/DefaultLogicalView.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize.views;
+
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.team.internal.ui.IPreferenceIds;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration;
+import org.eclipse.team.ui.synchronize.views.SyncInfoLabelProvider;
+import org.eclipse.team.ui.synchronize.views.SyncInfoSetTreeContentProvider;
+
+public class DefaultLogicalView extends LogicalViewProvider implements IPropertyChangeListener {
+
+ public DefaultLogicalView(DiffTreeViewerConfiguration configuration) {
+ super(configuration);
+ TeamUIPlugin.getPlugin().getPreferenceStore().addPropertyChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.views.LogicalViewProvider#getContentProvider()
+ */
+ public SyncInfoSetTreeContentProvider getContentProvider() {
+ if(getShowCompressedFolders()) {
+ return new CompressedFolderContentProvider();
+ } else {
+ return new SyncInfoSetTreeContentProvider();
+ }
+ }
+
+ private boolean getShowCompressedFolders() {
+ return TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.synchronize.views.LogicalViewProvider#getLabelProvider()
+ */
+ public SyncInfoLabelProvider getLabelProvider() {
+ if(getShowCompressedFolders()) {
+ return new CompressedFolderLabelProvider();
+ } else {
+ return new SyncInfoLabelProvider();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
+ getConfiguration().setLogicalViewProvider(this);
+ }
+ }
+
+ public void dispose() {
+ TeamUIPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(this);
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/ILogicalView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ILogicalView.java
index abe4380c7..d216ef333 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/ILogicalView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ILogicalView.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.ui.synchronize.views;
+package org.eclipse.team.internal.ui.synchronize.views;
import org.eclipse.core.runtime.CoreException;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ITreeViewerAccessor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ITreeViewerAccessor.java
new file mode 100644
index 000000000..3ef8a2acd
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/ITreeViewerAccessor.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize.views;
+
+import org.eclipse.swt.widgets.TreeItem;
+
+public interface ITreeViewerAccessor {
+ public void openSelection();
+
+ public void createChildren(TreeItem item);
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/LogicalViewProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/LogicalViewProvider.java
new file mode 100644
index 000000000..e49374ba4
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/LogicalViewProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize.views;
+
+import org.eclipse.team.ui.synchronize.DiffTreeViewerConfiguration;
+import org.eclipse.team.ui.synchronize.views.*;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+
+/**
+ * Implementations can be contributed via extension point and used by team participants.
+ * Logical Providers can be of two types:
+ * 1. nature based (are applied directly to projects
+ * 2. global based
+ *
+ * TODO: Add project nature filter to extension point
+ *
+ * @since 3.0
+ */
+public abstract class LogicalViewProvider {
+
+ private DiffTreeViewerConfiguration configuration;
+
+ public LogicalViewProvider(DiffTreeViewerConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Return a content provider that can be used in a <code>TreeViewer</code>
+ * to show the hiearchical structure appropriate for this provider.
+ * @return a <code>SyncInfoSetTreeContentProvider</code>
+ */
+ public abstract SyncInfoSetTreeContentProvider getContentProvider();
+
+ /**
+ * Return a label provider that provides the text and image labels for
+ * the logical elements associated with this provider.
+ * @return
+ */
+ public abstract SyncInfoLabelProvider getLabelProvider();
+
+ /**
+ * Return the sorter to be used to sort elements from the logical view's
+ * content provider.
+ * @return a <code>SyncViewerSorter</code>
+ */
+ public SyncViewerSorter getSorter() {
+ return new SyncViewerSorter(ResourceSorter.NAME);
+ }
+
+ protected DiffTreeViewerConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void dispose() {
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
new file mode 100644
index 000000000..f5c898979
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TreeViewerUtils.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize.views;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+public class TreeViewerUtils {
+
+ /**
+ * Selects the next (or previous) node of the current selection.
+ * If there is no current selection the first (last) node in the tree is selected.
+ * Wraps around at end or beginning.
+ * Clients may override.
+ *
+ * @param next if <code>true</code> the next node is selected, otherwise the previous node
+ */
+ public static boolean gotoDifference(TreeViewer viewer, boolean next) {
+ return navigate(viewer, next, false);
+ }
+
+ /**
+ * Selects the next (or previous) node of the current selection.
+ * If there is no current selection the first (last) node in the tree is selected.
+ * Wraps around at end or beginning.
+ * Clients may override.
+ *
+ * @param next if <code>true</code> the next node is selected, otherwise the previous node
+ * @return <code>true</code> if at end (or beginning)
+ */
+ public static boolean navigate(TreeViewer viewer, boolean next, boolean fireOpen) {
+
+ Tree tree = viewer.getTree();
+ if (tree == null) return false;
+
+ TreeItem item= null;
+ TreeItem children[]= tree.getSelection();
+ if (children != null && children.length > 0)
+ item= children[0];
+ if (item == null) {
+ children= tree.getItems();
+ if (children != null && children.length > 0) {
+ item= children[0];
+ if (item != null && item.getItemCount() <= 0) {
+ setSelection(viewer, item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ return false;
+ }
+ }
+ }
+
+ while (true) {
+ item= findNextPrev(viewer, item, next);
+ if (item == null)
+ break;
+ if (item.getItemCount() <= 0)
+ break;
+ }
+
+ if (item != null) {
+ setSelection(viewer, item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ return false;
+ }
+ return true;
+ }
+
+ private static void setSelection(TreeViewer viewer, TreeItem ti, boolean fireOpen) {
+ if (ti != null) {
+ Object data= ti.getData();
+ if (data != null) {
+ // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ ISelection selection= new StructuredSelection(data);
+ viewer.setSelection(selection, true);
+ ISelection currentSelection= viewer.getSelection();
+ if (fireOpen && currentSelection != null && selection.equals(currentSelection)) {
+ if(viewer instanceof ITreeViewerAccessor) {
+ ((ITreeViewerAccessor)viewer).openSelection();
+ }
+ }
+ }
+ }
+ }
+
+ private static TreeItem findNextPrev(TreeViewer viewer, TreeItem item, boolean next) {
+
+ if (item == null || !(viewer instanceof ITreeViewerAccessor))
+ return null;
+
+ TreeItem children[]= null;
+ ITreeViewerAccessor treeAccessor = (ITreeViewerAccessor)viewer;
+
+ if (!next) {
+
+ TreeItem parent= item.getParentItem();
+ if (parent != null)
+ children= parent.getItems();
+ else
+ children= item.getParent().getItems();
+
+ if (children != null && children.length > 0) {
+ // goto previous child
+ int index= 0;
+ for (; index < children.length; index++)
+ if (children[index] == item)
+ break;
+
+ if (index > 0) {
+
+ item= children[index-1];
+
+ while (true) {
+ treeAccessor.createChildren(item);
+ int n= item.getItemCount();
+ if (n <= 0)
+ break;
+
+ item.setExpanded(true);
+ item= item.getItems()[n-1];
+ }
+
+ // previous
+ return item;
+ }
+ }
+
+ // go up
+ return parent;
+
+ } else {
+ item.setExpanded(true);
+ treeAccessor.createChildren(item);
+
+ if (item.getItemCount() > 0) {
+ // has children: go down
+ children= item.getItems();
+ return children[0];
+ }
+
+ while (item != null) {
+ children= null;
+ TreeItem parent= item.getParentItem();
+ if (parent != null)
+ children= parent.getItems();
+ else
+ children= item.getParent().getItems();
+
+ if (children != null && children.length > 0) {
+ // goto next child
+ int index= 0;
+ for (; index < children.length; index++)
+ if (children[index] == item)
+ break;
+
+ if (index < children.length-1) {
+ // next
+ return children[index+1];
+ }
+ }
+
+ // go up
+ item= parent;
+ }
+ }
+
+ return item;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
index 2d8001270..3833804be 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/DiffTreeViewerConfiguration.java
@@ -12,36 +12,29 @@ package org.eclipse.team.ui.synchronize;
import java.util.ArrayList;
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.CompareViewerPane;
+import org.eclipse.compare.*;
import org.eclipse.compare.internal.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.*;
-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.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.core.Assert;
-import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.internal.ui.synchronize.actions.LogicalViewActionGroup;
-import org.eclipse.team.internal.ui.synchronize.views.CompressFolderView;
-import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.actions.INavigableTree;
-import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.views.DefaultLogicalView;
+import org.eclipse.team.internal.ui.synchronize.views.LogicalViewProvider;
+import org.eclipse.team.ui.synchronize.actions.ExpandAllAction;
import org.eclipse.team.ui.synchronize.views.*;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.internal.PluginAction;
-import org.eclipse.ui.views.navigator.ResourceSorter;
/**
* This class provides the configurability of diff viewers that contain <code>SyncInfo</code>
@@ -50,29 +43,26 @@ import org.eclipse.ui.views.navigator.ResourceSorter;
* A configuration can only be used to configure a single viewer and the lifecycle of the
* configuration
*
+ * 1. contents diff nodes (labels, content provider, sorter)
+ * 2. menus
+ * 3. title
+ * 4. navigation
+ *
* @see SyncInfoSetCompareInput
* @see SyncInfoDiffTreeViewer
* @see SyncInfoDiffCheckboxTreeViewer
* @since 3.0
*/
-public class SyncInfoSetCompareConfiguration {
-
- /**
- * Id of the compressed folder <code>ILogicalVieww</code> that can be used to
- * access the view using <code>ISynchronizeManager#getLogicalView(String)</code>.
- */
- public static final String COMPRESSED_FOLDER_LOGICAL_VIEW_ID = CompressFolderView.ID;
+public class DiffTreeViewerConfiguration {
private SyncInfoSet set;
private String menuId;
-
private StructuredViewer viewer;
+ private LogicalViewProvider logicalView;
- // fields that are tied to a single viewer
- private SyncInfoDiffTreeNavigator navigator;
- private IPropertyChangeListener propertyListener;
-
- private LogicalViewActionGroup logicalViews;
+ private ExpandAllAction expandAllAction;
+ private NavigationAction nextAction;
+ private NavigationAction previousAction;
/**
* Create a <code>SyncInfoSetCompareConfiguration</code> for the given sync set
@@ -81,7 +71,7 @@ public class SyncInfoSetCompareConfiguration {
* @param menuId the id of menu objectContributions
* @param set the <code>SyncInfoSet</code> to be displayed in the resulting diff viewer
*/
- public SyncInfoSetCompareConfiguration(String menuId, SyncInfoSet set) {
+ public DiffTreeViewerConfiguration(String menuId, SyncInfoSet set) {
this.menuId = menuId;
this.set = set;
}
@@ -97,34 +87,20 @@ public class SyncInfoSetCompareConfiguration {
public void initializeViewer(Composite parent, final StructuredViewer viewer) {
Assert.isTrue(this.viewer == null, "A SyncInfoSetCompareConfiguration can only be used with a single viewer."); //$NON-NLS-1$
this.viewer = viewer;
-
- // Use a logical view to set the content provider, label provider and sorter
- ILogicalView view = getDefaultLogicalView();
- setLogicalViewProvider(viewer, view);
- logicalViews = new LogicalViewActionGroup();
- logicalViews.setSelectedView(view);
-
+
GridData data = new GridData(GridData.FILL_BOTH);
viewer.getControl().setLayoutData(data);
- // Listen to the glocal prefernce for content provider changes
- // TODO: Related to logocal view
- propertyListener = getPropertyListener(viewer);
- getStore().addPropertyChangeListener(propertyListener);
-
initializeListeners(viewer);
- initializeNavigator(viewer);
hookContextMenu(viewer);
initializeActions(viewer);
+ initializeNavigation(viewer);
+ logicalView = getDefaultLogicalViewProvider();
+ setLogicalViewProvider(logicalView);
+
viewer.setInput(getInput());
}
- private void initializeNavigator(StructuredViewer viewer) {
- if (viewer instanceof INavigableTree) {
- initializeNavigation(viewer, (INavigableTree)viewer);
- }
- }
-
/**
* Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
* to initialize the navigation controller for the diff tree. The navigation control
@@ -133,16 +109,16 @@ public class SyncInfoSetCompareConfiguration {
* @param target the interface used to navigate the viewer
* @see SyncInfoDiffTreeNavigator
*/
- protected void initializeNavigation(StructuredViewer viewer, INavigableTree target) {
- this.navigator = new SyncInfoDiffTreeNavigator(target);
- INavigatable nav= new INavigatable() {
- public boolean gotoDifference(boolean next) {
- // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- return getNavigator().navigate(next, true);
- }
- };
- viewer.getControl().setData(INavigatable.NAVIGATOR_PROPERTY, nav);
- navigator.createActions(viewer);
+ protected void initializeNavigation(final StructuredViewer viewer) {
+ if(viewer instanceof INavigatable) {
+ INavigatable nav= new INavigatable() {
+ public boolean gotoDifference(boolean next) {
+ // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
+ return ((INavigatable)viewer).gotoDifference(next);
+ }
+ };
+ viewer.getControl().setData(INavigatable.NAVIGATOR_PROPERTY, nav);
+ }
}
/**
@@ -192,7 +168,9 @@ public class SyncInfoSetCompareConfiguration {
* @param viewer the viewer being initialize
*/
protected void initializeActions(StructuredViewer viewer) {
- createToolBarActions(viewer.getControl().getParent());
+ createNextPreviousButtons(viewer.getControl().getParent());
+ expandAllAction = new ExpandAllAction((AbstractTreeViewer)viewer);
+ Utils.initAction(expandAllAction, "action.expandAll."); //$NON-NLS-1$
}
/**
@@ -204,51 +182,18 @@ public class SyncInfoSetCompareConfiguration {
return set;
}
- private void createToolBarActions(Composite parent) {
+ private void createNextPreviousButtons(Composite parent) {
ToolBarManager tbm= CompareViewerPane.getToolBarManager(parent);
if (tbm != null) {
tbm.removeAll();
tbm.add(new Separator("navigation")); //$NON-NLS-1$
- navigator.createToolItems(tbm);
+ nextAction = new NavigationAction(true);
+ previousAction = new NavigationAction(false);
+ tbm.appendToGroup("navigation", nextAction);
+ tbm.appendToGroup("navigation", previousAction);
tbm.update(true);
}
}
-
- /**
- * Change the tree layout between using compressed folders and regular folders
- * when the user setting is changed.
- */
- private IPropertyChangeListener getPropertyListener(final StructuredViewer viewer) {
- return new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
- ILogicalView view = getDefaultLogicalView();
- setLogicalViewProvider(viewer, view);
- }
- }
- };
- }
-
- /**
- * Return the preference store for this plugin.
- * @return IPreferenceStore for this plugin
- */
- private IPreferenceStore getStore() {
- return TeamUIPlugin.getPlugin().getPreferenceStore();
- }
-
- /**
- * Get the content provider that will be assigned to the viewer initialized by this configuration.
- * Subclass may override but should return a subclass of <code>SyncSetContentProvider</code>.
- * @return a content provider
- */
- protected ILogicalView getDefaultLogicalView() {
- if (getStore().getBoolean(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS)) {
- return TeamUI.getSynchronizeManager().getLogicalView(COMPRESSED_FOLDER_LOGICAL_VIEW_ID);
- } else {
- return null;
- }
- }
/**
* Method invoked from <code>initializeViewer(Composite, StructuredViewer)</code> in order
@@ -305,56 +250,12 @@ public class SyncInfoSetCompareConfiguration {
* @param manager the menu manager
*/
protected void fillContextMenu(final StructuredViewer viewer, IMenuManager manager) {
- navigator.fillContextMenu(viewer, manager);
- addLogicalViewSelection(viewer, manager);
+ manager.add(expandAllAction);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
- /**
- * Method that can be invoked from <code>fillContextMenu(StructuredViewer, IMenuManager)</code>
- * to add a submenu that allows the selection of one of the registered logical views.
- * @param viewer the viewer
- * @param manager the menu manager
- */
- protected void addLogicalViewSelection(final StructuredViewer viewer, IMenuManager manager) {
- logicalViews.fillContextMenu(manager);
- logicalViews.setPropertyChangeListener(new IPropertyChangeListener() {
- public void propertyChange(final PropertyChangeEvent event) {
- if (event.getProperty().equals(LogicalViewActionGroup.SELECTED_VIEW)) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- ILogicalView view = (ILogicalView)event.getNewValue();
- setLogicalViewProvider(viewer, view);
- }
- });
- }
- }
- });
- }
-
- /**
- * Set the logical view to be used in the diff tree viewer. Passing <code>null</code>
- * will remove any logical view and use the standard resource hierarchy view.
- * @param viewer the viewer
- * @param view the logical view to be used
- */
- protected void setLogicalViewProvider(StructuredViewer viewer, ILogicalView view) {
- if (view != null) {
- try {
- LogicalViewProvider provider = view.getLogicalViewProvider();
- viewer.setContentProvider(provider.getContentProvider());
- viewer.setLabelProvider(getLabelProvider(provider.getLabelProvider()));
- viewer.setSorter(provider.getSorter());
- } catch (CoreException e) {
- TeamUIPlugin.log(e);
- view = null;
- }
- }
- if (view == null) {
- viewer.setContentProvider(new SyncInfoSetTreeContentProvider());
- viewer.setLabelProvider(getLabelProvider(new SyncInfoLabelProvider()));
- viewer.setSorter(new SyncViewerSorter(ResourceSorter.NAME));
- }
+
+ protected LogicalViewProvider getDefaultLogicalViewProvider() {
+ return new DefaultLogicalView(this);
}
/**
@@ -368,8 +269,8 @@ public class SyncInfoSetCompareConfiguration {
/**
* Cleanup listeners
*/
- protected void dispose() {
- getStore().removePropertyChangeListener(propertyListener);
+ public void dispose() {
+ logicalView.dispose();
}
/**
@@ -378,7 +279,22 @@ public class SyncInfoSetCompareConfiguration {
* @param input the compare input
*/
public void updateCompareEditorInput(CompareEditorInput input) {
- navigator.updateCompareEditorInput(input);
+ nextAction.setCompareEditorInput(input);
+ previousAction.setCompareEditorInput(input);
+ }
+
+ /**
+ * Set the logical view to be used in the diff tree viewer. Passing <code>null</code>
+ * will remove any logical view and use the standard resource hierarchy view.
+ * @param viewer the viewer
+ * @param view the logical view to be used
+ */
+ public void setLogicalViewProvider(LogicalViewProvider provider) {
+ if (viewer != null) {
+ viewer.setLabelProvider(getLabelProvider(provider.getLabelProvider()));
+ viewer.setSorter(provider.getSorter());
+ viewer.setContentProvider(provider.getContentProvider());
+ }
}
/**
@@ -390,17 +306,15 @@ public class SyncInfoSetCompareConfiguration {
*/
protected void handleDoubleClick(StructuredViewer viewer, DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object element = selection.getFirstElement();
- navigator.reveal(viewer, element);
- }
-
- /**
- * Return the navigator that is associated with this compare configuration
- * and its viewer.
- * @return the viewer's navigator
- */
- public SyncInfoDiffTreeNavigator getNavigator() {
- return navigator;
+ Object element = selection.getFirstElement();
+ if(viewer instanceof AbstractTreeViewer) {
+ AbstractTreeViewer treeViewer = ((AbstractTreeViewer)viewer);
+ if(treeViewer.getExpandedState(element)) {
+ treeViewer.collapseToLevel(element, AbstractTreeViewer.ALL_LEVELS);
+ } else {
+ treeViewer.expandToLevel(element, AbstractTreeViewer.ALL_LEVELS);
+ }
+ }
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
index d4691e421..ffaf734c2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import org.eclipse.team.ui.synchronize.views.ILogicalView;
+import org.eclipse.team.internal.ui.synchronize.views.ILogicalView;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -88,23 +88,4 @@ public interface ISynchronizeManager {
* <code>null</code> if a descriptor is not found for that id.
*/
public ISynchronizeParticipantDescriptor getParticipantDescriptor(String id);
-
- /**
- * Return all the logical views that have been registered with Team.
- * The providers associated with the views will not be instantiated until
- * they are accessed so this list can be retrieved without fear of loading
- * client plugins.
- * @return the regisitered logical views
- */
- public ILogicalView[] getLogicalViews();
-
- /**
- * Return the registered view with the given id or <code>null</code> if no view
- * exists for the given id. The provider associated with the view will not be instantiated until
- * it is accessed so the logical view can be retrieved without fear of loading
- * client plugins.
- * @param id the id of the logical view
- * @return the logical view with the given id or <code>null</code>
- */
- public ILogicalView getLogicalView(String id);
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/RefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/RefreshSchedule.java
index 48e23074b..cdb6cafcd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/RefreshSchedule.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/RefreshSchedule.java
@@ -3,12 +3,13 @@ package org.eclipse.team.ui.synchronize;
import java.text.DateFormat;
import java.util.Date;
-import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.subscribers.SyncInfo;
+import org.eclipse.team.core.subscribers.SyncInfoSet;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.jobs.*;
-import org.eclipse.team.ui.synchronize.actions.*;
+import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
+import org.eclipse.team.internal.ui.synchronize.IRefreshEvent;
+import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IMemento;
public class RefreshSchedule {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
index 11785e0f2..43c36a827 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffCheckboxTreeViewer.java
@@ -10,21 +10,22 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
+import org.eclipse.compare.internal.INavigatable;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.team.ui.synchronize.actions.INavigableTree;
-import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
+import org.eclipse.team.internal.ui.synchronize.views.ITreeViewerAccessor;
+import org.eclipse.team.internal.ui.synchronize.views.TreeViewerUtils;
import org.eclipse.ui.internal.dialogs.ContainerCheckedTreeViewer;
// TODO: This is an internal superclass
-public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer implements INavigableTree {
+public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer implements INavigatable, ITreeViewerAccessor {
- private SyncInfoSetCompareConfiguration configuration;
+ private DiffTreeViewerConfiguration configuration;
- public SyncInfoDiffCheckboxTreeViewer(Composite parent, SyncInfoSetCompareConfiguration configuration) {
+ public SyncInfoDiffCheckboxTreeViewer(Composite parent, DiffTreeViewerConfiguration configuration) {
super(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
this.configuration = configuration;
configuration.initializeViewer(parent, this);
@@ -52,16 +53,15 @@ public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer i
protected void inputChanged(Object in, Object oldInput) {
super.inputChanged(in, oldInput);
if (in != oldInput) {
- configuration.getNavigator().navigate(false, true);
+ gotoDifference(true /*next*/);
}
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int)
*/
- public boolean gotoDifference(int direction) {
- boolean next = direction == SyncInfoDiffTreeNavigator.NEXT ? true : false;
- return configuration.getNavigator().navigate(next, false);
+ public boolean gotoDifference(boolean next) {
+ return TreeViewerUtils.gotoDifference(this, next);
}
/* (non-Javadoc)
@@ -81,8 +81,7 @@ public class SyncInfoDiffCheckboxTreeViewer extends ContainerCheckedTreeViewer i
/**
* @return Returns the configuration.
*/
- public SyncInfoSetCompareConfiguration getConfiguration() {
+ public DiffTreeViewerConfiguration getConfiguration() {
return configuration;
- }
-
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
index 820ae24fa..e39cabeab 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoDiffTreeViewer.java
@@ -10,19 +10,20 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
+import org.eclipse.compare.internal.INavigatable;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.team.ui.synchronize.actions.INavigableTree;
-import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
+import org.eclipse.team.internal.ui.synchronize.views.ITreeViewerAccessor;
+import org.eclipse.team.internal.ui.synchronize.views.TreeViewerUtils;
-public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigableTree {
+public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigatable, ITreeViewerAccessor {
- private SyncInfoSetCompareConfiguration configuration;
+ private DiffTreeViewerConfiguration configuration;
- public SyncInfoDiffTreeViewer(Composite parent, SyncInfoSetCompareConfiguration configuration) {
+ public SyncInfoDiffTreeViewer(Composite parent, DiffTreeViewerConfiguration configuration) {
super(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
this.configuration = configuration;
configuration.initializeViewer(parent, this);
@@ -50,16 +51,15 @@ public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigableTree
protected void inputChanged(Object in, Object oldInput) {
super.inputChanged(in, oldInput);
if (in != oldInput) {
- configuration.getNavigator().navigate(false, true);
+ gotoDifference(true);
}
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.actions.INavigableControl#gotoDifference(int)
*/
- public boolean gotoDifference(int direction) {
- boolean next = direction == SyncInfoDiffTreeNavigator.NEXT ? true : false;
- return configuration.getNavigator().navigate(next, false);
+ public boolean gotoDifference(boolean direction) {
+ return TreeViewerUtils.gotoDifference(this, direction);
}
/* (non-Javadoc)
@@ -75,5 +75,4 @@ public class SyncInfoDiffTreeViewer extends TreeViewer implements INavigableTree
public void createChildren(TreeItem item) {
super.createChildren(item);
}
-
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCheckboxCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCheckboxCompareInput.java
index a3d0ec025..2ff235d7b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCheckboxCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCheckboxCompareInput.java
@@ -9,44 +9,45 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-
import java.util.ArrayList;
import java.util.List;
-
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.subscribers.SyncInfo;
-
/**
- * This compare input supports selection of multiple sync info using checkboxes.
+ * This compare input supports selection of multiple sync info using
+ * checkboxes.
*
* @since 3.0
*/
public class SyncInfoSetCheckboxCompareInput extends SyncInfoSetCompareInput {
-
private Object[] checked;
private ICheckStateListener listener;
-
/**
- * Create a <code>SyncInfoSetCheckboxCompareInput</code> whose diff viewer is configured
- * using the provided <code>SyncInfoSetCompareConfiguration</code>.
- * @param configuration the compare configuration
- * @param diffViewerConfiguration the diff viewer configuration
- * @param listener listener taht is notified whenever the selection changes
+ * Create a <code>SyncInfoSetCheckboxCompareInput</code> whose diff
+ * viewer is configured using the provided <code>SyncInfoSetCompareConfiguration</code>.
+ *
+ * @param configuration
+ * the compare configuration
+ * @param diffViewerConfiguration
+ * the diff viewer configuration
+ * @param listener
+ * listener taht is notified whenever the selection changes
*/
- public SyncInfoSetCheckboxCompareInput(CompareConfiguration configuration, SyncInfoSetCompareConfiguration diffViewerConfiguration, ICheckStateListener listener) {
+ public SyncInfoSetCheckboxCompareInput(CompareConfiguration configuration, DiffTreeViewerConfiguration diffViewerConfiguration, ICheckStateListener listener) {
super(configuration, diffViewerConfiguration);
this.listener = listener;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareInput#internalCreateDiffViewer(org.eclipse.swt.widgets.Composite, org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareInput#internalCreateDiffViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration)
*/
- protected StructuredViewer internalCreateDiffViewer(
- Composite parent,
- SyncInfoSetCompareConfiguration diffViewerConfiguration) {
+ protected StructuredViewer internalCreateDiffViewer(Composite parent, DiffTreeViewerConfiguration diffViewerConfiguration) {
final SyncInfoDiffCheckboxTreeViewer treeViewer = new SyncInfoDiffCheckboxTreeViewer(parent, diffViewerConfiguration);
treeViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
@@ -58,9 +59,9 @@ public class SyncInfoSetCheckboxCompareInput extends SyncInfoSetCompareInput {
});
return treeViewer;
}
-
/**
* Return the resources that were checked in the diff viewer.
+ *
* @return an array of resources
*/
public IResource[] getSelection() {
@@ -70,7 +71,7 @@ public class SyncInfoSetCheckboxCompareInput extends SyncInfoSetCompareInput {
Object element = checked[i];
if (element instanceof SyncInfoDiffNode) {
// Only include out-of-sync resources that are checked
- SyncInfoDiffNode node = (SyncInfoDiffNode)element;
+ SyncInfoDiffNode node = (SyncInfoDiffNode) element;
SyncInfo syncInfo = node.getSyncInfo();
if (syncInfo != null && syncInfo.getKind() != 0) {
result.add(node.getResource());
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
index 897cd1ced..4349c065a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SyncInfoSetCompareInput.java
@@ -31,7 +31,7 @@ import org.eclipse.team.internal.ui.Utils;
*/
public class SyncInfoSetCompareInput extends CompareEditorInput {
- private SyncInfoSetCompareConfiguration diffViewerConfiguration;
+ private DiffTreeViewerConfiguration diffViewerConfiguration;
/**
* Create a <code>SyncInfoSetCompareInput</code> whose diff viewer is configured
@@ -39,7 +39,7 @@ public class SyncInfoSetCompareInput extends CompareEditorInput {
* @param configuration the compare configuration
* @param diffViewerConfiguration the diff viewer configuration
*/
- public SyncInfoSetCompareInput(CompareConfiguration configuration, SyncInfoSetCompareConfiguration diffViewerConfiguration) {
+ public SyncInfoSetCompareInput(CompareConfiguration configuration, DiffTreeViewerConfiguration diffViewerConfiguration) {
super(configuration);
this.diffViewerConfiguration = diffViewerConfiguration;
}
@@ -60,7 +60,7 @@ public class SyncInfoSetCompareInput extends CompareEditorInput {
* @param diffViewerConfiguration the configuration for the diff viewer
* @return the created diff viewer
*/
- protected StructuredViewer internalCreateDiffViewer(Composite parent, SyncInfoSetCompareConfiguration diffViewerConfiguration) {
+ protected StructuredViewer internalCreateDiffViewer(Composite parent, DiffTreeViewerConfiguration diffViewerConfiguration) {
return new SyncInfoDiffTreeViewer(parent, diffViewerConfiguration);
}
@@ -105,6 +105,5 @@ public class SyncInfoSetCompareInput extends CompareEditorInput {
}
}
return null;
- }
-
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberPageDiffTreeViewerConfiguration.java
index e81d9c8a7..2ec304424 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberPageDiffTreeViewerConfiguration.java
@@ -19,13 +19,12 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.synchronize.actions.*;
-import org.eclipse.team.ui.synchronize.actions.INavigableTree;
import org.eclipse.ui.IWorkbenchActionConstants;
/**
* Overrides the SyncInfoDiffViewerConfiguration to configure the diff viewer for the synchroniza view
*/
-public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfiguration {
+public class TeamSubscriberPageDiffTreeViewerConfiguration extends DiffTreeViewerConfiguration {
private ISynchronizeView view;
private TeamSubscriberParticipant participant;
@@ -34,7 +33,7 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
private RefactorActionGroup refactorActions;
private TeamParticipantRefreshAction refreshSelectionAction;
- public SynchronizeViewCompareConfiguration(ISynchronizeView view, TeamSubscriberParticipant participant) {
+ public TeamSubscriberPageDiffTreeViewerConfiguration(ISynchronizeView view, TeamSubscriberParticipant participant) {
super(participant.getId(), participant.getFilteredSyncInfoCollector().getSyncInfoSet());
this.view = view;
this.participant = participant;
@@ -60,9 +59,6 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
refactorActions.fillContextMenu(manager);
manager.add(refreshSelectionAction);
manager.add(new Separator());
- addLogicalViewSelection(viewer, manager);
- manager.add(new Separator());
- getNavigator().fillContextMenu(viewer, manager);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@@ -141,13 +137,4 @@ public class SynchronizeViewCompareConfiguration extends SyncInfoSetCompareConfi
}
return ""; //$NON-NLS-1$
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SyncInfoSetCompareConfiguration#initializeNavigation(org.eclipse.swt.widgets.Control, org.eclipse.team.internal.ui.synchronize.SyncInfoDiffTreeNavigator.INavigationTarget)
- */
- protected void initializeNavigation(StructuredViewer viewer, INavigableTree target) {
- super.initializeNavigation(viewer, target);
- getNavigator().setShowOpenAction(false);
- }
-
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
index a4be58632..e203917b1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
+import org.eclipse.compare.internal.INavigatable;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -21,9 +22,9 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
-import org.eclipse.team.internal.ui.synchronize.*;
+import org.eclipse.team.internal.ui.synchronize.ChangesSection;
+import org.eclipse.team.internal.ui.synchronize.ConfigureRefreshScheduleDialog;
import org.eclipse.team.internal.ui.synchronize.actions.*;
-import org.eclipse.team.ui.synchronize.actions.SyncInfoDiffTreeNavigator;
import org.eclipse.ui.*;
import org.eclipse.ui.part.*;
@@ -60,7 +61,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
private Action collapseAll;
private WorkingSetFilterActionGroup workingSetGroup;
private StatusLineContributionGroup statusLine;
- private SynchronizeViewCompareConfiguration configuration;
+ private TeamSubscriberPageDiffTreeViewerConfiguration configuration;
/**
* Constructs a new SynchronizeView.
@@ -93,8 +94,11 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
changesSection = new ChangesSection(composite, this);
// toolbar
- gotoNext = new NavigateAction(view, configuration.getNavigator(), SyncInfoDiffTreeNavigator.NEXT);
- gotoPrevious = new NavigateAction(view, configuration.getNavigator(), SyncInfoDiffTreeNavigator.PREVIOUS);
+ Viewer viewer = getChangesViewer();
+ if(viewer instanceof INavigatable) {
+ gotoNext = new NavigateAction(view, (INavigatable)viewer, true /*next*/);
+ gotoPrevious = new NavigateAction(view, (INavigatable)viewer, false /*previous*/);
+ }
refreshAllAction = new TeamParticipantRefreshAction(getSite().getSelectionProvider(), getParticipant(), true /* refresh all */);
collapseAll = new Action() {
public void run() {
@@ -272,7 +276,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
return viewer;
}
- protected SynchronizeViewCompareConfiguration createSyncInfoSetCompareConfiguration() {
- return new SynchronizeViewCompareConfiguration(getSynchronizeView(), getParticipant());
+ protected TeamSubscriberPageDiffTreeViewerConfiguration createSyncInfoSetCompareConfiguration() {
+ return new TeamSubscriberPageDiffTreeViewerConfiguration(getSynchronizeView(), getParticipant());
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/INavigableTree.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/INavigableTree.java
deleted file mode 100644
index 1cc4a22a8..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/INavigableTree.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.ui.synchronize.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-/**
- * This interface is used by the <code>SyncInfoDiffTreeNavigator</code>. Any
- * tree widget that is used as the diff viewer associated with a
- * <code>SyncInfoSetCompareConfiguration</code> should implement this interface
- * in order to get menu, toolbar and keyboard navigation.
- */
-public interface INavigableTree {
-
- /**
- * Open the currently selected item. For a <code>TreeViewer</code>,
- * this can be accomplished using the expression
- * <code>fireOpen(new OpenEvent(this, getSelection()))</code>.
- */
- void openSelection();
-
- /**
- * Get the <code>Tree</code> that is the control for this viewer.
- * This method is already defined on <code>TreeViewer</code>.
- * @return a <code>Tree</code> control
- */
- Tree getTree();
-
- /**
- * Create the children of the given <code>TreeItem</code> if they have not
- * already been created.
- * This method is already defined on <code>TreeViewer</code> but is protected
- * so an implementor must override it to make it public.
- * @param item the parent tree item
- */
- void createChildren(TreeItem item);
-
- /**
- * Get the currently selected item.
- * This method is already defined on <code>TreeViewer</code>.
- * @return the selection
- */
- ISelection getSelection();
-
- /**
- * Set the viewers selection to the given selection.
- * This method is already defined on <code>TreeViewer</code>.
- * @param selection the new selection
- * @param fireOpen open selection as well
- */
- void setSelection(ISelection selection, boolean fireOpen);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/RefreshAction.java
index 40739bca2..deb199fd5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/RefreshAction.java
@@ -20,6 +20,7 @@ import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
+import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.views.SyncInfoSetContentProvider;
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SyncInfoDiffTreeNavigator.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SyncInfoDiffTreeNavigator.java
deleted file mode 100644
index 9da7d78f1..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/actions/SyncInfoDiffTreeNavigator.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.ui.synchronize.actions;
-
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.NavigationAction;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
-
-/**
- * This class provides the tree navigation support for tree based diff viewers
- * created using a <code>SyncInfoSetCompareConfiguration</code>. This includes
- * menu actions for expanding the tree and opening the selected item in the
- * text compare pane as well as up and down navigation actions that are added
- * to the toolbas and bound to the navigation keys.
- */
-public class SyncInfoDiffTreeNavigator {
-
- private final class OpenAction extends Action {
- public void run() {
- target.openSelection();
- }
- public void update() {
- ISelection selection = target.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() == 1) {
- Object element = ss.getFirstElement();
- if (element instanceof SyncInfoDiffNode) {
- IResource resource = ((SyncInfoDiffNode)element).getResource();
- setEnabled(resource != null && resource.getType() == IResource.FILE);
- return;
- }
- }
- }
- setEnabled(false);
- }
- }
-
- /**
- * Direction to navigate
- */
- final public static int NEXT = 1;
- final public static int PREVIOUS = 2;
-
- private ExpandAllAction expandAll;
- private OpenAction open;
- private NavigationAction nextAction;
- private NavigationAction previousAction;
-
- INavigableTree target;
- boolean showOpenAction = true;
-
- public SyncInfoDiffTreeNavigator(INavigableTree target) {
- this.target = target;
- }
-
- /**
- * Selects the next (or previous) node of the current selection.
- * If there is no current selection the first (last) node in the tree is selected.
- * Wraps around at end or beginning.
- * Clients may override.
- *
- * @param next if <code>true</code> the next node is selected, otherwise the previous node
- */
- public boolean gotoDifference(int direction) {
- boolean next = direction == SyncInfoDiffTreeNavigator.NEXT ? true : false;
- return navigate(next, false);
- }
-
- /**
- * Selects the next (or previous) node of the current selection.
- * If there is no current selection the first (last) node in the tree is selected.
- * Wraps around at end or beginning.
- * Clients may override.
- *
- * @param next if <code>true</code> the next node is selected, otherwise the previous node
- * @return <code>true</code> if at end (or beginning)
- */
- public boolean navigate(boolean next, boolean fireOpen) {
-
- Tree tree = getTarget().getTree();
- if (tree == null) return false;
-
- TreeItem item= null;
- TreeItem children[]= tree.getSelection();
- if (children != null && children.length > 0)
- item= children[0];
- if (item == null) {
- children= tree.getItems();
- if (children != null && children.length > 0) {
- item= children[0];
- if (item != null && item.getItemCount() <= 0) {
- setSelection(item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- return false;
- }
- }
- }
-
- while (true) {
- item= findNextPrev(item, next);
- if (item == null)
- break;
- if (item.getItemCount() <= 0)
- break;
- }
-
- if (item != null) {
- setSelection(item, fireOpen); // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- return false;
- }
- return true;
- }
-
- private void setSelection(TreeItem ti, boolean fireOpen) {
- if (ti != null) {
- Object data= ti.getData();
- if (data != null) {
- // Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
- ISelection selection= new StructuredSelection(data);
- getTarget().setSelection(selection, true);
- ISelection currentSelection= getTarget().getSelection();
- if (fireOpen && currentSelection != null && selection.equals(currentSelection)) {
- getTarget().openSelection();
- }
- }
- }
- }
-
- private TreeItem findNextPrev(TreeItem item, boolean next) {
-
- if (item == null)
- return null;
-
- TreeItem children[]= null;
-
- if (!next) {
-
- TreeItem parent= item.getParentItem();
- if (parent != null)
- children= parent.getItems();
- else
- children= item.getParent().getItems();
-
- if (children != null && children.length > 0) {
- // goto previous child
- int index= 0;
- for (; index < children.length; index++)
- if (children[index] == item)
- break;
-
- if (index > 0) {
-
- item= children[index-1];
-
- while (true) {
- getTarget().createChildren(item);
- int n= item.getItemCount();
- if (n <= 0)
- break;
-
- item.setExpanded(true);
- item= item.getItems()[n-1];
- }
-
- // previous
- return item;
- }
- }
-
- // go up
- return parent;
-
- } else {
- item.setExpanded(true);
- getTarget().createChildren(item);
-
- if (item.getItemCount() > 0) {
- // has children: go down
- children= item.getItems();
- return children[0];
- }
-
- while (item != null) {
- children= null;
- TreeItem parent= item.getParentItem();
- if (parent != null)
- children= parent.getItems();
- else
- children= item.getParent().getItems();
-
- if (children != null && children.length > 0) {
- // goto next child
- int index= 0;
- for (; index < children.length; index++)
- if (children[index] == item)
- break;
-
- if (index < children.length-1) {
- // next
- return children[index+1];
- }
- }
-
- // go up
- item= parent;
- }
- }
-
- return item;
- }
-
- public INavigableTree getTarget() {
- return target;
- }
-
- public void createToolItems(IToolBarManager tbm) {
- nextAction= new NavigationAction(true);
- tbm.appendToGroup("navigation", nextAction); //$NON-NLS-1$
-
- previousAction= new NavigationAction(false);
- tbm.appendToGroup("navigation", previousAction); //$NON-NLS-1$
- }
-
- public void updateCompareEditorInput(CompareEditorInput input) {
- nextAction.setCompareEditorInput(input);
- previousAction.setCompareEditorInput(input);
- }
-
- public void createActions(final StructuredViewer viewer) {
- AbstractTreeViewer abstractTreeViewer = getAbstractTreeViewer(viewer);
- if (abstractTreeViewer != null) {
- expandAll = new ExpandAllAction(abstractTreeViewer);
- Utils.initAction(expandAll, "action.expandAll."); //$NON-NLS-1$
- }
-
- open = new OpenAction();
- Utils.initAction(open, "action.open."); //$NON-NLS-1$
- }
-
- public void fillContextMenu(StructuredViewer viewer, IMenuManager manager) {
- AbstractTreeViewer tree = getAbstractTreeViewer(viewer);
- if (isShowOpenAction()) {
- open.update();
- manager.add(open);
- }
- if (tree != null) {
- manager.add(expandAll);
- }
- }
-
- private AbstractTreeViewer getAbstractTreeViewer(StructuredViewer viewer) {
- if (viewer instanceof AbstractTreeViewer) {
- return (AbstractTreeViewer)viewer;
- }
- return null;
- }
-
- public void reveal(StructuredViewer viewer, Object element) {
- AbstractTreeViewer tree = getAbstractTreeViewer(viewer);
- if (tree == null)return;
- // Double-clicking should expand/collapse containers
- if(tree.isExpandable(element)) {
- tree.setExpandedState(element, ! tree.getExpandedState(element));
- }
- }
-
- /**
- * @return Returns the showOpenAction.
- */
- public boolean isShowOpenAction() {
- return showOpenAction;
- }
-
- /**
- * @param showOpenAction The showOpenAction to set.
- */
- public void setShowOpenAction(boolean showOpenAction) {
- this.showOpenAction = showOpenAction;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/LogicalViewProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/LogicalViewProvider.java
deleted file mode 100644
index bfdf7db1d..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/LogicalViewProvider.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.ui.synchronize.views;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.ui.views.navigator.ResourceSorter;
-
-/**
- * Implementations can be contributed via extension point and used by team participants.
- *
- * TODO: Add project nature filter to extension point
- *
- * @since 3.0
- */
-public abstract class LogicalViewProvider {
-
- /**
- * Return a content provider that can be used in a <code>TreeViewer</code>
- * to show the hiearchical structure appropriate for this provider.
- * @return a <code>SyncInfoSetTreeContentProvider</code>
- */
- public abstract SyncInfoSetTreeContentProvider getContentProvider();
-
- /**
- * Return a label provider that provides the text and image labels for
- * the logical elements associated with this provider.
- * @return
- */
- public abstract SyncInfoLabelProvider getLabelProvider();
-
- /**
- * Return the sorter to be used to sort elements from the logical view's
- * content provider.
- * @return a <code>SyncViewerSorter</code>
- */
- public SyncViewerSorter getSorter() {
- return new SyncViewerSorter(ResourceSorter.NAME);
- }
-
- /**
- * Return an array of <code>TeamOperationInput</code> objects that describe the resources
- * that are contained by or make up the given logical elements. The size of the
- * returned array of <code>TeamOperationInput</code> need not corrolate to the
- * size of the array of logical elements. An array is returned to give the logical view
- * provider flexibility in describing what resources make up a logical element. It
- * is up to the client of this interface to translate the <code>TeamOperationInput</code>
- * array into an appropriate operation input.
- * <p>
- * The implementor of this method is encouraged to use the provided subscriber to determine
- * which resources are included. The <code>TeamSubscriber#members(IResource)</code> method
- * will return resources that exists locally and also those that do not exist locally but do
- * have a remote counterpart. This method will also exclude resources that are not supervised
- * by the subscriber (e.g. ignored from version contgrol). The significance of this is that the
- * logical view provider can prepare a team operation input that includes resources that need to
- * be created locally or deleted remotely and excludes unnecessay resources.
- * <p>
- * By default, this method returns a deep (<code>IResource.DEPTH_INFINITE</code>) operations
- * on any resources that can be obtained from he given elements. Subclasses should override
- * to provide the proper mapping from their logical elements to a set of
- * <code>TeamOperationInput</code>.
- * @param elements the logical elements
- * @param subscriber the team subscriber for which the input is being prepared
- * @param monitor a progress monitor
- * @return the input to a team operation
- */
- public TeamOperationInput[] getTeamOperationInput(Object[] elements, TeamSubscriber subscriber, IProgressMonitor monitor) throws CoreException {
- Set resources = new HashSet();
- for (int i = 0; i < elements.length; i++) {
- Object object = elements[i];
- IResource resource = SyncInfoSetContentProvider.getResource(object);
- if (resource != null) {
- resources.add(resource);
- }
- }
- if (resources.isEmpty()) {
- return new TeamOperationInput[0];
- }
- return new TeamOperationInput[] {
- new TeamOperationInput(
- (IResource[]) resources.toArray(new IResource[resources.size()]),
- IResource.DEPTH_INFINITE) };
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDecoratingLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDecoratingLabelProvider.java
index 3d9b67e0e..632e0d76f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDecoratingLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoDecoratingLabelProvider.java
@@ -34,10 +34,10 @@ import org.eclipse.ui.internal.WorkbenchColors;
* on the labels and icons of adaptable objects by overriding
* <code>decorateText()</code> and <code>decorateImage</code>.
*
- * @see SyncInfoSetCompareConfiguration#getLabelProvider(SyncInfoLabelProvider)
+ * @see DiffTreeViewerConfiguration#getLabelProvider(SyncInfoLabelProvider)
* @since 3.0
*/
-public class SyncInfoDecoratingLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
+public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IColorProvider {
//column constants
private static final int COL_RESOURCE = 0;
@@ -188,31 +188,6 @@ public class SyncInfoDecoratingLabelProvider extends LabelProvider implements IT
}
/* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == COL_RESOURCE) {
- return getImage(element);
- } else if (columnIndex == COL_PARENT) {
- return null;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex == COL_RESOURCE) {
- return getText(element);
- } else if (columnIndex == COL_PARENT) {
- IResource resource = syncInfoLabelProvider.getResource(element);
- return resource.getParent().getFullPath().toString();
- }
- return null;
- }
-
- /* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/
public Color getForeground(Object element) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/TeamOperationInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/TeamOperationInput.java
deleted file mode 100644
index 33ee18092..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/TeamOperationInput.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.ui.synchronize.views;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * A container for the <code>IResource</code> based input to a team operation.
- * It is used by a logical view to communicate to a team operation what
- * resources make up a logical view element.
- *
- * @see LogicalViewProvider
- */
-public class TeamOperationInput {
-
- private IResource[] resources;
- private int depth;
-
- /**
- * Create a team operation input that consists of the given resources,
- * all of which should be traversed to the given depth.
- * @param resources the resources to be operated on
- * @param depth the depth to traverse the resources
- */
- public TeamOperationInput(IResource[] resources, int depth) {
- this.resources = resources;
- this.depth = depth;
- }
-
- /**
- * Return the depth that the team operation should traverse the resource.
- * The depth values are those provided by the <code>IResource</code> interface,
- * namely <code>IResource.DEPTH_ZERO</code>, <code>IResource.DEPTH_ONE</code>
- * or <code>IResource.DEPTH_INFINITE</code>.
- * @return Returns the depth
- */
- public int getDepth() {
- return depth;
- }
-
- /**
- * Return the resources to be included in the team operation. These resources should be traversed
- * to the depth provided by this operation input.
- * @return Returns the resources.
- */
- public IResource[] getResources() {
- return resources;
- }
-
-}

Back to the top