Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-11-19 17:10:32 -0500
committerMichael Valenta2003-11-19 17:10:32 -0500
commite91346f4c5985549c1696e2709c70a4aaea6f601 (patch)
treeaaa189276eb9c49da654c59b3e579e2f3c04eed2
parentd7d63b99d8cc88448e1bc36d0dfb53b58904400f (diff)
downloadeclipse.platform.team-branch_20031024_DateTag.tar.gz
eclipse.platform.team-branch_20031024_DateTag.tar.xz
eclipse.platform.team-branch_20031024_DateTag.zip
*** empty log message ***branch_20031024_DateTag
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.classpath16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/.project6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml164
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java68
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java30
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java64
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java169
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java26
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareRemoteResourcesAction.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java45
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java65
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java74
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java32
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java42
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java76
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java80
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSBlockingRunnableContext.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java27
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSSubscriberNonblockingContext.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java72
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java31
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java44
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberAction.java43
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberConfirmMergedAction.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java23
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java46
53 files changed, 831 insertions, 740 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/.classpath b/bundles/org.eclipse.team.cvs.ui/.classpath
index 1049098b9..065ac06e1 100644
--- a/bundles/org.eclipse.team.cvs.ui/.classpath
+++ b/bundles/org.eclipse.team.cvs.ui/.classpath
@@ -1,15 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.team.core"/>
- <classpathentry kind="src" path="/org.eclipse.team.ui"/>
- <classpathentry kind="src" path="/org.eclipse.team.cvs.core"/>
- <classpathentry kind="src" path="/org.eclipse.compare"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" path="/org.eclipse.ui.console"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.team.cvs.ui/.project b/bundles/org.eclipse.team.cvs.ui/.project
index 49e69c4d8..b5ab8eecf 100644
--- a/bundles/org.eclipse.team.cvs.ui/.project
+++ b/bundles/org.eclipse.team.cvs.ui/.project
@@ -6,12 +6,18 @@
<project>org.eclipse.compare</project>
<project>org.eclipse.core.boot</project>
<project>org.eclipse.core.resources</project>
+ <project>org.eclipse.core.resources.spysupport</project>
<project>org.eclipse.core.runtime</project>
+ <project>org.eclipse.jface.text</project>
<project>org.eclipse.team.core</project>
<project>org.eclipse.team.cvs.core</project>
<project>org.eclipse.team.ui</project>
<project>org.eclipse.ui</project>
<project>org.eclipse.ui.console</project>
+ <project>org.eclipse.ui.editors</project>
+ <project>org.eclipse.ui.ide</project>
+ <project>org.eclipse.ui.views</project>
+ <project>org.eclipse.ui.workbench.texteditor</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index fa92e70c4..25f12feee 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -19,6 +19,9 @@ CVSGroupMenu.label=C&VS
SharingWizard.name=CVS
+CVSWorkspaceParticipant=CVS Workspace
+CVSMergeParticipant=CVS Merge
+
PreferencePage.name=CVS
ConsolePreferencePage.name=Console
DecoratorPreferencePage.name=Label Decorations
@@ -61,7 +64,7 @@ ConvertNature.tooltip=Converts a CVS project from using natures to using propert
CopyRepositoryNameAction.label=&Copy to Clipboard
CopyRepositoryNameAction.tooltip=Copy Repository Names to Clipboard
-IgnoreAction.label=A&dd to .cvsignore
+IgnoreAction.label=A&dd to .cvsignore...
IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing
RefreshTagsAction.label=Refresh &Branches...
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 8eda051be..499c9fe94 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
<plugin
id="org.eclipse.team.cvs.ui"
name="%pluginName"
@@ -13,6 +14,11 @@
</library>
</runtime>
<requires>
+ <import plugin="org.eclipse.ui.ide" optional="true"/>
+ <import plugin="org.eclipse.ui.views" optional="true"/>
+ <import plugin="org.eclipse.jface.text" optional="true"/>
+ <import plugin="org.eclipse.ui.workbench.texteditor" optional="true"/>
+ <import plugin="org.eclipse.ui.editors" optional="true"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
@@ -23,6 +29,25 @@
<import plugin="org.eclipse.compare"/>
</requires>
+<!-- *************** Synchronize View Participant **************** -->
+<extension
+ point="org.eclipse.team.ui.synchronizeParticipants">
+ <participant
+ name="%CVSWorkspaceParticipant"
+ icon="icons/full/cview16/cvs_persp.gif"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant"
+ type="static"
+ id="org.eclipse.team.cvs.ui.cvsworkspace-participant">
+ </participant>
+ <participant
+ name="%CVSMergeParticipant"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant"
+ type="dynamic"
+ id="org.eclipse.team.cvs.ui.cvsmerge-participant">
+ </participant>
+</extension>
+
<!-- *************** Authenticator **************** -->
<extension
point="org.eclipse.team.cvs.core.authenticator">
@@ -141,6 +166,7 @@
<action
label="%ShowHistoryAction.label"
tooltip="%ShowHistoryAction.tooltip"
+ icon="icons/full/ctool16/history.gif"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
menubarPath="team.main/group2"
helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
@@ -149,6 +175,7 @@
<action
label="%ShowAnnotationAction.label"
tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/ctool16/annotate.gif"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
menubarPath="team.main/group2"
helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
@@ -264,7 +291,7 @@
tooltip="%GenerateDiff.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
+ helpContextId="org.eclipse.team.cvs.ui.team_create__action_context"
id="org.eclipse.team.ccvs.ui.GenerateDiff">
</action>
<action
@@ -423,6 +450,7 @@
<action
label="%ShowHistoryAction.label"
tooltip="%ShowHistoryAction.tooltip"
+ icon="icons/full/ctool16/history.gif"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowHistoryAction"
helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
id="org.eclipse.team.ccvs.ui.showHistory">
@@ -430,6 +458,7 @@
<action
label="%ShowAnnotationAction.label"
tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/ctool16/annotate.gif"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
@@ -456,6 +485,7 @@
<action
label="%ShowAnnotationAction.label"
tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/ctool16/annotate.gif"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
id="org.eclipse.team.ccvs.ui.showAnnotation">
@@ -564,20 +594,32 @@
</action>
</objectContribution>
</extension>
-
-
-
+
<!-- ************* Subscriber Menus ************ -->
<extension
point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.team.ui.sync.ISynchronizeViewNode"
+ <viewerContribution
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriberContributions"
- adaptable="true">
-
- <filter name="equals" value="org.eclipse.team.cvs.subscribers:workspace-subscriber" />
-
+ targetID="org.eclipse.team.cvs.ui.cvsworkspace-participant">
+ <action
+ label="%CVSWorkspaceSubscriber.commit.label"
+ menubarPath="SubscriberActionsGroup1"
+ tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
+ overrideActionId="org.eclipse.team.ccvs.ui.commit"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_commit_action"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.commit">
+ </action>
+ <action
+ label="%CVSWorkspaceSubscriber.update.label"
+ menubarPath="SubscriberActionsGroup1"
+ tooltip="%CVSWorkspaceSubscriber.update.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
+ overrideActionId="org.eclipse.team.ccvs.ui.update"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_update_action"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.update">
+ </action>
<action
label="%CVSWorkspaceSubscriber.confirmMerged.label"
menubarPath="SubscriberActionsGroup2"
@@ -586,7 +628,6 @@
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.confirmMerged">
</action>
-
<action
label="%CVSWorkspaceSubscriber.overcommit.label"
menubarPath="SubscriberActionsGroup2"
@@ -594,8 +635,7 @@
class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overcommit_action"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overcommit">
- </action>
-
+ </action>
<action
label="%CVSWorkspaceSubscriber.overupdate.label"
menubarPath="SubscriberActionsGroup2"
@@ -604,36 +644,55 @@
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
</action>
-
- <action
- label="%CVSWorkspaceSubscriber.commit.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
- overrideActionId="org.eclipse.team.ccvs.ui.commit"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_commit_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.commit">
- </action>
-
- <action
- label="%CVSWorkspaceSubscriber.update.label"
- menubarPath="SubscriberActionsGroup1"
- tooltip="%CVSWorkspaceSubscriber.update.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_update_action"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.update">
- </action>
- </objectContribution>
+ <action
+ label="%ShowHistoryAction.label"
+ tooltip="%ShowHistoryAction.tooltip"
+ icon="icons/full/ctool16/history.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
+ id="org.eclipse.team.ccvs.ui.showHistory">
+ </action>
+ <action
+ label="%ShowAnnotationAction.label"
+ tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/ctool16/annotate.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ id="org.eclipse.team.ccvs.ui.showAnnotation">
+ </action>
+ <action
+ label="%BranchAction.label"
+ tooltip="%BranchAction.tooltip"
+ icon="icons/full/clcl16/newstream_wiz.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
+ id="org.eclipse.team.ccvs.ui.branch">
+ </action>
+ <action
+ label="%GenerateDiff.label"
+ tooltip="%GenerateDiff.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
+ id="org.eclipse.team.ccvs.ui.GenerateDiff">
+ </action>
+ <action
+ label="%IgnoreAction.label"
+ tooltip="%IgnoreAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
+ id="org.eclipse.team.ccvs.ui.ignore">
+ </action>
+ </viewerContribution>
- <objectContribution
- objectClass="org.eclipse.team.ui.sync.ISynchronizeViewNode"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions"
- adaptable="true">
-
- <filter name="startsWith" value="org.eclipse.team.cvs.subscribers:merge-" />
-
- <action
+ <viewerContribution
+ id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions"
+ targetID="org.eclipse.team.cvs.ui.cvsmerge-participant">
+ <action
label="%CVSWorkspaceSubscriber.confirmMerged.label"
menubarPath="SubscriberActionsGroup1"
tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
@@ -641,7 +700,6 @@
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
</action>
-
<action
label="%CVSWorkspaceSubscriber.merge.label"
menubarPath="SubscriberActionsGroup1"
@@ -651,7 +709,25 @@
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
</action>
- </objectContribution>
+ <action
+ label="%ShowHistoryAction.label"
+ tooltip="%ShowHistoryAction.tooltip"
+ icon="icons/full/ctool16/history.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
+ id="org.eclipse.team.ccvs.ui.showHistory">
+ </action>
+ <action
+ label="%ShowAnnotationAction.label"
+ tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/ctool16/annotate.gif"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ id="org.eclipse.team.ccvs.ui.showAnnotation">
+ </action>
+ </viewerContribution>
</extension>
<!-- ************** Views ********************** -->
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java
index 8917530db..10b284938 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java
@@ -17,39 +17,15 @@ import java.util.Collection;
import java.util.Iterator;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.text.*;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.team.internal.ccvs.core.CVSAnnotateBlock;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.*;
import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.IWorkbenchConstants;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.internal.registry.EditorDescriptor;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -285,9 +261,7 @@ public class AnnotateView extends ViewPart implements ISelectionChangedListener
}
/**
- * Try and open the correct registered editor type for the file. If the registered
- * editor is *not* an ITextEditor then open the source in a default text editor.
- * @return
+ * Try and open the correct registered editor type for the file.
* @throws InvocationTargetException
*/
private IEditorPart openEditor() throws InvocationTargetException {
@@ -305,29 +279,10 @@ public class AnnotateView extends ViewPart implements ISelectionChangedListener
IEditorDescriptor descriptor = registry.getDefaultEditor(file.getName());
- // Determine if the registered editor is an ITextEditor.
-
- String id;
-
- if (descriptor == null || !(descriptor instanceof EditorDescriptor) || !(((EditorDescriptor)descriptor).isInternal())) {
- id = IWorkbenchConstants.DEFAULT_EDITOR_ID; //$NON-NLS-1$
- } else {
- try {
- Object obj = WorkbenchPlugin.createExtension(((EditorDescriptor) descriptor).getConfigurationElement(), "class"); //$NON-NLS-1$
- if (obj instanceof ITextEditor) {
- id = descriptor.getId();
- } else {
- id = IWorkbenchConstants.DEFAULT_EDITOR_ID;
- }
- } catch (CoreException e) {
- id = IWorkbenchConstants.DEFAULT_EDITOR_ID;
- }
- }
-
// Either reuse an existing editor or open a new editor of the correct type.
try {
try {
- if (editor != null && editor instanceof IReusableEditor && page.isPartVisible(editor) && editor.getSite().getId().equals(id)) {
+ if (editor != null && editor instanceof IReusableEditor && page.isPartVisible(editor) && editor.getSite().getId().equals(descriptor.getId())) {
// We can reuse the editor
((IReusableEditor) editor).setInput(new RemoteAnnotationEditorInput(file, contents));
part = editor;
@@ -337,15 +292,10 @@ public class AnnotateView extends ViewPart implements ISelectionChangedListener
page.closeEditor(editor, false);
editor = null;
}
- part = page.openEditor(new RemoteAnnotationEditorInput(file, contents), id);
+ part = page.openEditor(new RemoteAnnotationEditorInput(file, contents), descriptor.getId());
}
} catch (PartInitException e) {
- if (id.equals(IWorkbenchConstants.DEFAULT_EDITOR_ID)) {
- throw e;
- } else {
- // Could not open desired editor, try a default text editor.
- part = page.openEditor(new RemoteAnnotationEditorInput(file, contents), IWorkbenchConstants.DEFAULT_EDITOR_ID); //$NON-NLS-1$
- }
+ throw e;
}
} catch (PartInitException e) {
// Total failure.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java
index 1017dfb34..79eba69a7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java
@@ -91,8 +91,12 @@ public class CVSDecoratorConfiguration {
}
}
- decoration.addPrefix(prefix.toString());
- decoration.addSuffix(suffix.toString());
+ if (prefix.length() != 0) {
+ decoration.addPrefix(prefix.toString());
+ }
+ if (suffix.length() != 0) {
+ decoration.addSuffix(suffix.toString());
+ }
}
//todo: leaving the old bind method in until senders can be fixed
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java
index 0a9420af5..ef27dbefb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -69,7 +70,6 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
private Text addedFlag;
private Button showDirty;
- private Button showSyncInfoInLabel;
class StringPair {
String s1;
@@ -178,11 +178,6 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
tabItem.setText(Policy.bind("CVSDecoratorPreferencesPage.generalTabFolder"));//$NON-NLS-1$
tabItem.setControl(createGeneralDecoratorPage(tabFolder));
- // synchronize decoration options
- tabItem = new TabItem(tabFolder, SWT.NONE);
- tabItem.setText(Policy.bind("CVSDecoratorPreferencesPage.synchronizeTabFolder"));//$NON-NLS-1$
- tabItem.setControl(createSynchronizeDecoratorPage(tabFolder));
-
initializeValues();
WorkbenchHelp.setHelp(tabFolder, IHelpContextIds.DECORATORS_PREFERENCE_PAGE);
Dialog.applyDialogFont(parent);
@@ -261,18 +256,6 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
return composite;
}
- private Control createSynchronizeDecoratorPage(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- createLabel(composite, Policy.bind("CVSDecoratorPreferencesPage.synchronizeDescription"), 1); //$NON-NLS-1$
- showSyncInfoInLabel = createCheckBox(composite, Policy.bind("CVSDecoratorPreferencesPage.showSyncInfoInLabel")); //$NON-NLS-1$
- return composite;
- }
-
private Label createLabel(Composite parent, String text, int span) {
Label label = new Label(parent, SWT.LEFT);
label.setText(text);
@@ -323,9 +306,6 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
imageShowNewResource.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION));
showDirty.setSelection(store.getBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY));
-
- showSyncInfoInLabel.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_SYNCINFO_AS_TEXT));
-
setValid(true);
}
@@ -356,10 +336,7 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
store.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, showDirty.getSelection());
- store.setValue(ICVSUIConstants.PREF_SHOW_SYNCINFO_AS_TEXT, showSyncInfoInLabel.getSelection());
-
- CVSLightweightDecorator.refresh();
-
+ CVSUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, CVSUIPlugin.P_DECORATORS_CHANGED, null, null));
CVSUIPlugin.getPlugin().savePluginPreferences();
return true;
}
@@ -384,8 +361,7 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork
imageShowHasRemote.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION));
imageShowNewResource.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION));
- showDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY));
- showSyncInfoInLabel.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_SYNCINFO_AS_TEXT));
+ showDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY));
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
index a600a5b41..c3e892b56 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
@@ -28,6 +28,8 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.jface.viewers.LabelProvider;
@@ -52,10 +54,11 @@ import org.eclipse.team.internal.ccvs.core.util.ResourceStateChangeListeners;
import org.eclipse.team.internal.core.ExceptionCollector;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.TeamUI;
public class CVSLightweightDecorator
extends LabelProvider
- implements ILightweightLabelDecorator, IResourceStateChangeListener {
+ implements ILightweightLabelDecorator, IResourceStateChangeListener, IPropertyChangeListener {
// Images cached for better performance
private static ImageDescriptor dirty;
@@ -66,7 +69,7 @@ public class CVSLightweightDecorator
private static ImageDescriptor newResource;
private static ImageDescriptor edited;
- private static ExceptionCollector exceptions;
+ private static ExceptionCollector exceptions = new ExceptionCollector(Policy.bind("CVSDecorator.exceptionMessage"), CVSUIPlugin.ID, IStatus.ERROR, CVSUIPlugin.getPlugin().getLog()); //$NON-NLS-1$;
/*
* Define a cached image descriptor which only creates the image data once
@@ -85,6 +88,30 @@ public class CVSLightweightDecorator
}
}
+ public static class Decoration implements IDecoration {
+ public String prefix, suffix;
+ public ImageDescriptor overlay;
+
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addPrefix(java.lang.String)
+ */
+ public void addPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addSuffix(java.lang.String)
+ */
+ public void addSuffix(String suffix) {
+ this.suffix = suffix;
+ }
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addOverlay(org.eclipse.jface.resource.ImageDescriptor)
+ */
+ public void addOverlay(ImageDescriptor overlay) {
+ this.overlay = overlay;
+ }
+ }
+
static {
dirty = new CachedImageDescriptor(TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_DIRTY_OVR));
checkedIn = new CachedImageDescriptor(TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR));
@@ -97,8 +124,9 @@ public class CVSLightweightDecorator
public CVSLightweightDecorator() {
ResourceStateChangeListeners.getListener().addResourceStateChangeListener(this);
+ TeamUI.addPropertyChangeListener(this);
+ CVSUIPlugin.addPropertyChangeListener(this);
CVSProviderPlugin.broadcastDecoratorEnablementChanged(true /* enabled */);
- exceptions = new ExceptionCollector(Policy.bind("CVSDecorator.exceptionMessage"), CVSUIPlugin.ID, IStatus.ERROR, CVSUIPlugin.getPlugin().getLog()); //$NON-NLS-1$
}
public static boolean isDirty(final ICVSResource cvsResource) {
@@ -183,10 +211,8 @@ public class CVSLightweightDecorator
}
// determine a if resource has outgoing changes (e.g. is dirty).
- IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
boolean isDirty = false;
- boolean computeDeepDirtyCheck =
- store.getBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY);
+ boolean computeDeepDirtyCheck = isDeepDirtyCalculationEnabled();
int type = resource.getType();
if (type == IResource.FILE || computeDeepDirtyCheck) {
isDirty = CVSLightweightDecorator.isDirty(resource);
@@ -200,7 +226,12 @@ public class CVSLightweightDecorator
}
}
-//todo the showRevisions flag is temp, a better solution is DecoratorStrategy classes which have most the code below
+ private boolean isDeepDirtyCalculationEnabled() {
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ return store.getBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY);
+ }
+
+ //todo the showRevisions flag is temp, a better solution is DecoratorStrategy classes which have most the code below
public static void decorateTextLabel(IResource resource, IDecoration decoration, boolean isDirty, boolean showRevisions) {
try {
Map bindings = new HashMap(3);
@@ -209,7 +240,7 @@ public class CVSLightweightDecorator
// if the resource does not have a location then return. This can happen if the resource
// has been deleted after we where asked to decorate it.
- if(resource.getLocation() == null) {
+ if(!resource.isAccessible() || resource.getLocation() == null) {
return;
}
@@ -486,7 +517,7 @@ public class CVSLightweightDecorator
//System.out.println(">> State Change Event");
Set resourcesToUpdate = new HashSet();
- boolean showingDeepDirtyIndicators = CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY);
+ boolean showingDeepDirtyIndicators = isDeepDirtyCalculationEnabled();
for (int i = 0; i < changedResources.length; i++) {
IResource resource = changedResources[i];
@@ -526,12 +557,15 @@ public class CVSLightweightDecorator
}
});
}
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
public void dispose() {
super.dispose();
CVSProviderPlugin.broadcastDecoratorEnablementChanged(false /* disabled */);
+ TeamUI.removePropertyChangeListener(this);
+ CVSUIPlugin.removePropertyChangeListener(this);
}
/**
@@ -540,4 +574,16 @@ public class CVSLightweightDecorator
private static void handleException(Exception e) {
exceptions.handleException(e);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String prop = event.getProperty();
+ if(prop.equals(TeamUI.GLOBAL_IGNORES_CHANGED)) {
+ refresh();
+ } else if(prop.equals(CVSUIPlugin.P_DECORATORS_CHANGED)) {
+ refresh();
+ }
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index 5ff0f6320..00b563546 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -374,7 +375,9 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
// changing the default keyword substitution mode for text files may affect
// information displayed in the decorators
- if (! oldKSubst.equals(newKSubst)) CVSLightweightDecorator.refresh();
+ if (! oldKSubst.equals(newKSubst)) {
+ CVSUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, CVSUIPlugin.P_DECORATORS_CHANGED, null, null));
+ }
CVSUIPlugin.getPlugin().savePluginPreferences();
return true;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
index 5d6417a08..0ff2d8168 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -387,8 +388,9 @@ public class CVSProjectPropertiesPage extends CVSPropertiesPage {
}
});
newLocation = null;
- if (changeReadOnly[0])
- CVSLightweightDecorator.refresh();
+ if (changeReadOnly[0]) {
+ CVSUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, CVSUIPlugin.P_DECORATORS_CHANGED, null, null));
+ }
} catch (InvocationTargetException e) {
handle(e);
} catch (InterruptedException e) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 3d991d751..b8e454ba7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -14,7 +14,10 @@ package org.eclipse.team.internal.ccvs.ui;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
@@ -43,17 +46,22 @@ import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
+import org.eclipse.team.internal.ccvs.ui.console.CVSOutputConsole;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot;
+import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+
/**
* UI Plugin for CVS provider-specific workbench functionality.
*/
@@ -64,18 +72,25 @@ public class CVSUIPlugin extends AbstractUIPlugin {
public static final String ID = "org.eclipse.team.cvs.ui"; //$NON-NLS-1$
public static final String DECORATOR_ID = "org.eclipse.team.cvs.ui.decorator"; //$NON-NLS-1$
+ /**
+ * Property constant indicating the decorator configuration has changed.
+ */
+ public static final String P_DECORATORS_CHANGED = CVSUIPlugin.ID + ".P_DECORATORS_CHANGED"; //$NON-NLS-1$
+
private Hashtable imageDescriptors = new Hashtable(20);
-
- // timeout in milliseconds before displaying a progress monitor dialog
- // (used for normally short-running interactive operations)
- private static final int TIMEOUT = 2000;
-
+ private static List propertyChangeListeners = new ArrayList(5);
+
/**
* The singleton plug-in instance
*/
private static CVSUIPlugin plugin;
/**
+ * The CVS console
+ */
+ private CVSOutputConsole console;
+
+ /**
* The repository manager
*/
private RepositoryManager repositoryManager;
@@ -84,15 +99,6 @@ public class CVSUIPlugin extends AbstractUIPlugin {
public static final String EDIT = "edit"; //$NON-NLS-1$
public static final String HIGHJACK = "highjack"; //$NON-NLS-1$
- // Property change listener
- IPropertyChangeListener listener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(TeamUI.GLOBAL_IGNORES_CHANGED)) {
- CVSLightweightDecorator.refresh();
- }
- }
- };
-
/**
* CVSUIPlugin constructor
*
@@ -102,7 +108,20 @@ public class CVSUIPlugin extends AbstractUIPlugin {
super(descriptor);
plugin = this;
}
-
+
+ /**
+ * Returns the standard display to be used. The method first checks, if
+ * the thread calling this method has an associated display. If so, this
+ * display is returned. Otherwise the method returns the default display.
+ */
+ public static Display getStandardDisplay() {
+ Display display= Display.getCurrent();
+ if (display == null) {
+ display= Display.getDefault();
+ }
+ return display;
+ }
+
/**
* Creates an image and places it in the image registry.
*/
@@ -129,6 +148,30 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
/**
+ * Register for changes made to Team properties.
+ */
+ public static void addPropertyChangeListener(IPropertyChangeListener listener) {
+ propertyChangeListeners.add(listener);
+ }
+
+ /**
+ * Deregister as a Team property changes.
+ */
+ public static void removePropertyChangeListener(IPropertyChangeListener listener) {
+ propertyChangeListeners.remove(listener);
+ }
+
+ /**
+ * Broadcast a Team property change.
+ */
+ public static void broadcastPropertyChange(PropertyChangeEvent event) {
+ for (Iterator it = propertyChangeListeners.iterator(); it.hasNext();) {
+ IPropertyChangeListener listener = (IPropertyChangeListener)it.next();
+ listener.propertyChange(event);
+ }
+ }
+
+ /**
* Extract or convert to a TeamException
*/
public static TeamException asTeamException(InvocationTargetException e) {
@@ -149,8 +192,8 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* supplied operation will be run again.
*/
public static void runWithRefresh(Shell parent, IResource[] resources,
- IRunnableWithProgress runnable, IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
+ IRunnableWithProgress runnable, IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
boolean firstTime = true;
while(true) {
try {
@@ -223,7 +266,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @exception InterruptedException when the progress monitor is cancelled
*/
public static void runWithProgress(Shell parent, boolean cancelable,
- final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
+ final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
Utils.runWithProgress(parent, cancelable, runnable);
}
@@ -240,7 +283,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @exception InterruptedException when the progress monitor is cancelled
*/
public static void runWithProgress(final Shell parent, final boolean cancelable,
- final IRunnableWithProgress runnable, int flags) throws InvocationTargetException, InterruptedException {
+ final IRunnableWithProgress runnable, int flags) throws InvocationTargetException, InterruptedException {
if ((flags & PERFORM_SYNC_EXEC) > 0) {
@@ -269,7 +312,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
display = parent.getDisplay();
}
display.syncExec(outerRunnable);
-
+
// handle any exception
if (exception[0] != null) {
Exception e = exception[0];
@@ -313,7 +356,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
return plugin;
}
-
+
/**
* Returns the repository manager
*
@@ -336,7 +379,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
*/
private void initializeImages() {
URL baseURL = getDescriptor().getInstallURL();
-
+
// objects
createImageDescriptor(ICVSUIConstants.IMG_REPOSITORY, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_REFRESH, baseURL);
@@ -347,6 +390,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
createImageDescriptor(ICVSUIConstants.IMG_COLLAPSE_ALL, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_COLLAPSE_ALL_ENABLED, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_NEWLOCATION, baseURL);
+ createImageDescriptor(ICVSUIConstants.IMG_CVSLOGO, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_TAG, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_MODULE, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_CLEAR, baseURL);
@@ -385,7 +429,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
public static void log(IStatus status) {
getPlugin().getLog().log(status);
}
-
+
public static void log(CoreException e) {
log(e.getStatus().getSeverity(), Policy.bind("simpleInternal"), e); //$NON-NLS-1$
}
@@ -396,7 +440,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
public static void log(int severity, String message, Throwable e) {
log(new Status(severity, ID, 0, message, e));
}
-
+
// flags to tailor error reporting
public static final int PERFORM_SYNC_EXEC = 1;
public static final int LOG_TEAM_EXCEPTIONS = 2;
@@ -515,7 +559,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
flags = flags | PERFORM_SYNC_EXEC;
}
}
-
+
// Create a runnable that will display the error status
final Shell shell = providedShell;
Runnable outerRunnable = new Runnable() {
@@ -533,7 +577,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
}
};
-
+
// Execute the above runnable as determined by the parameters
if (shell == null || (flags & PERFORM_SYNC_EXEC) > 0) {
Display display;
@@ -550,8 +594,8 @@ public class CVSUIPlugin extends AbstractUIPlugin {
outerRunnable.run();
}
}
-
-
+
+
/**
* Initializes the preferences for this plugin if necessary.
*/
@@ -560,12 +604,6 @@ public class CVSUIPlugin extends AbstractUIPlugin {
// Get the plugin preferences for CVS Core
Preferences corePrefs = CVSProviderPlugin.getPlugin().getPluginPreferences();
- // work in progress START
- store.setDefault(ICVSUIConstants.BACKGROUND_REPOVIEW, true);
- store.setDefault(ICVSUIConstants.BACKGROUND_OPERATIONS, true);
- store.setDefault(ICVSUIConstants.USE_NEW_SYNCVIEW, true);
- // work in progress END
-
store.setDefault(ICVSUIConstants.PREF_REPOSITORIES_ARE_BINARY, false);
store.setDefault(ICVSUIConstants.PREF_SHOW_COMMENTS, true);
store.setDefault(ICVSUIConstants.PREF_SHOW_TAGS, true);
@@ -598,8 +636,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION, true);
store.setDefault(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, false);
store.setDefault(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION, true);
- store.setDefault(ICVSUIConstants.PREF_CALCULATE_DIRTY, true);
- store.setDefault(ICVSUIConstants.PREF_SHOW_SYNCINFO_AS_TEXT, false);
+ store.setDefault(ICVSUIConstants.PREF_CALCULATE_DIRTY, true);
store.setDefault(ICVSUIConstants.PREF_PROMPT_ON_MIXED_TAGS, true);
store.setDefault(ICVSUIConstants.PREF_PROMPT_ON_SAVING_IN_SYNC, true);
store.setDefault(ICVSUIConstants.PREF_SAVE_DIRTY_EDITORS, ICVSUIConstants.OPTION_PROMPT);
@@ -625,14 +662,14 @@ public class CVSUIPlugin extends AbstractUIPlugin {
CVSProviderPlugin.getPlugin().setConfirmMoveTagEnabled(store.getBoolean(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG));
CVSProviderPlugin.getPlugin().setDebugProtocol(CVSProviderPlugin.getPlugin().isDebugProtocol() || store.getBoolean(ICVSUIConstants.PREF_DEBUG_PROTOCOL));
}
-
+
/**
* @see Plugin#startup()
*/
public void startup() throws CoreException {
super.startup();
Policy.localize("org.eclipse.team.internal.ccvs.ui.messages"); //$NON-NLS-1$
-
+
CVSAdapterFactory factory = new CVSAdapterFactory();
Platform.getAdapterManager().registerAdapters(factory, ICVSRemoteFile.class);
Platform.getAdapterManager().registerAdapters(factory, ICVSRemoteFolder.class);
@@ -642,12 +679,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
initializeImages();
initializePreferences();
- // if the global ignores list is changed then update decorators.
- TeamUI.addPropertyChangeListener(listener);
-
Console.startup();
- // Commented out until we have fully ported the CVS console to the new API
- //ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {new CVSOutputConsole()});
}
public static IWorkingSet getWorkingSet(IResource[] resources, String name) {
@@ -666,15 +698,60 @@ public class CVSUIPlugin extends AbstractUIPlugin {
*/
public void shutdown() throws CoreException {
super.shutdown();
- TeamUI.removePropertyChangeListener(listener);
try {
if (repositoryManager != null)
repositoryManager.shutdown();
} catch (TeamException e) {
throw new CoreException(e.getStatus());
}
-
+
Console.shutdown();
}
-}
+ /**
+ * @return Returns the cvsWorkspaceSynchronizeViewPage.
+ */
+ public WorkspaceSynchronizeParticipant getCvsWorkspaceSynchronizeParticipant() {
+ ISynchronizeParticipant[] instances = TeamUI.getSynchronizeManager().find(WorkspaceSynchronizeParticipant.ID);
+ if(instances.length == 1) {
+ return (WorkspaceSynchronizeParticipant)instances[0];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the system speed setting. This is mainly used to determine to enable/disable
+ * certain CVS features.
+ * @since 3.0
+ */
+ public static int getPlatformPerformance() {
+ return Platform.getPlugin(Platform.PI_RUNTIME).getPluginPreferences().getInt(Platform.PREF_PLATFORM_PERFORMANCE);
+ }
+
+ /**
+ * This is a convenience method to show the CVS workspace subscriber in the sync view.
+ * The working set of the workspace participant will be set to the provided working set
+ * and the provided resources will be refreshed.
+ * @param shell shell used to display errors (can be <code>null</code>)
+ * @param resources the resources to be refreshed (can be <code>null</code>)
+ * @param workingSet the working set to be assigned to the participant (can be <code>null</code>)
+ * @param mode the mode to place the participant in (can be 0)
+ */
+ public static void showInSyncView(Shell shell, IResource[] resources, IWorkingSet workingSet, int mode) {
+ ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
+ if(view != null) {
+ WorkspaceSynchronizeParticipant cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ view.display(cvsPage);
+ cvsPage.setWorkingSet(workingSet);
+ if (resources != null) {
+ cvsPage.refreshWithRemote(resources);
+ }
+ if (mode != 0) {
+ cvsPage.setMode(mode);
+ }
+ } else {
+ CVSUIPlugin.openError(shell, Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index 52d68217c..1718bb376 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -86,7 +86,7 @@ import org.eclipse.team.internal.ccvs.ui.actions.MoveRemoteTagAction;
import org.eclipse.team.internal.ccvs.ui.actions.OpenLogEntryAction;
import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
import org.eclipse.team.internal.ui.jobs.JobStatusHandler;
-import org.eclipse.team.internal.ui.sync.compare.SyncInfoCompareInput;
+import org.eclipse.team.internal.ui.synchronize.compare.SyncInfoCompareInput;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IEditorInput;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index dea0cd3db..2bf8d1148 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -53,6 +53,7 @@ public interface ICVSUIConstants {
// wizards
public final String IMG_NEWLOCATION = "wizards/newlocation_wiz.gif"; //$NON-NLS-1$
+ public final String IMG_CVSLOGO = "wizards/newconnect_wiz.gif"; //$NON-NLS-1$
// preferences
public final String PREF_SHOW_COMMENTS = "pref_show_comments"; //$NON-NLS-1$
@@ -97,8 +98,6 @@ public interface ICVSUIConstants {
public final String PREF_ADDED_FLAG = "pref_added_flag"; //$NON-NLS-1$
public final String PREF_CALCULATE_DIRTY = "pref_calculate_dirty"; //$NON-NLS-1$
-
- public final String PREF_SHOW_SYNCINFO_AS_TEXT = "pref_show_syncinfo_as_text"; //$NON-NLS-1$
// watch/edit preferences
public final String PREF_CHECKOUT_READ_ONLY = "pref_checkout_read_only"; //$NON-NLS-1$
@@ -136,11 +135,6 @@ public interface ICVSUIConstants {
// preference options
public final int OPTION_NEVER = 1; //$NON-NLS-1$
public final int OPTION_PROMPT = 2; //$NON-NLS-1$
- public final int OPTION_AUTOMATIC = 3;
-
- // work in progress preferences
- public final String BACKGROUND_REPOVIEW = PREFIX + "background_repoview"; //$NON-NLS-1$
- public final String BACKGROUND_OPERATIONS = PREFIX + "background_operations"; //$NON-NLS-1$
- public final String USE_NEW_SYNCVIEW = PREFIX + "old_sync_view"; //$NON-NLS-1$
+ public final int OPTION_AUTOMATIC = 3;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
index 711f518ae..a3cee4bad 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
@@ -122,4 +122,8 @@ public class Policy {
return monitor;
return new InfiniteSubProgressMonitor(monitor, ticks);
}
+
+ public static ResourceBundle getBundle() {
+ return bundle;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
index edec1e568..6e850912e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
@@ -10,13 +10,10 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
-import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.team.internal.ccvs.ui.Policy;
public class WorkInProgressPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
@@ -39,9 +36,6 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
public void createFieldEditors() {
- addField(new BooleanFieldEditor(ICVSUIConstants.BACKGROUND_REPOVIEW, Policy.bind("WorkInProgressPreferencePage.2"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
- addField(new BooleanFieldEditor(ICVSUIConstants.BACKGROUND_OPERATIONS, Policy.bind("WorkInProgressPreferencePage.3"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
- addField(new BooleanFieldEditor(ICVSUIConstants.USE_NEW_SYNCVIEW, Policy.bind("WorkInProgressPreferencePage.4"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 6ba03eeee..4a7e054ce 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -48,7 +48,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.internal.ui.dialogs.IPromptCondition;
-import org.eclipse.team.ui.sync.ISynchronizeViewNode;
+import org.eclipse.team.internal.ui.synchronize.views.SynchronizeViewNode;
import org.eclipse.ui.PlatformUI;
/**
@@ -299,10 +299,6 @@ abstract public class CVSAction extends TeamAction {
Iterator elements = ((IStructuredSelection) selection).iterator();
while (elements.hasNext()) {
Object next = elements.next();
- if(next instanceof ISynchronizeViewNode) {
- resources.add(((ISynchronizeViewNode)next).getSyncInfo().getRemote());
- continue;
- }
if (next instanceof ICVSResource) {
resources.add(next);
continue;
@@ -481,4 +477,24 @@ abstract public class CVSAction extends TeamAction {
return CVSUIPlugin.getPlugin().getRepositoryManager();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.actions.TeamAction#getSelectedResources()
+ */
+ protected IResource[] getSelectedResources() {
+ if(selection.isEmpty()) return new IResource[0];
+ Iterator it = selection.iterator();
+ List resources = new ArrayList();
+ while(it.hasNext()) {
+ Object element = it.next();
+ if(element instanceof SynchronizeViewNode) {
+ resources.add(((SynchronizeViewNode)element).getResource());
+ } else {
+ Object adapter = getAdapter(element, IResource.class);
+ if (adapter instanceof IResource) {
+ resources.add(adapter);
+}
+ }
+ }
+ return (IResource[]) resources.toArray(new IResource[resources.size()]);
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareRemoteResourcesAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareRemoteResourcesAction.java
index 039f9eee7..0414ca887 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareRemoteResourcesAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareRemoteResourcesAction.java
@@ -19,14 +19,8 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import org.eclipse.team.internal.ccvs.ui.CVSCompareEditorInput;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.ResourceEditionNode;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteCompareOperation;
/**
@@ -46,7 +40,7 @@ public class CompareRemoteResourcesAction extends CVSAction {
if (isSameFolder(editions)) {
// Run the compare operation in the background
try {
- new RemoteCompareOperation(null, editions[0], getTag(editions[1]))
+ new RemoteCompareOperation(null, editions[0], RemoteCompareOperation.getTag(editions[1]))
.run();
} catch (CVSException e) {
throw new InvocationTargetException(e);
@@ -63,18 +57,6 @@ public class CompareRemoteResourcesAction extends CVSAction {
}
}, false /* cancelable */, PROGRESS_BUSYCURSOR);
}
-
- protected CVSTag getTag(ICVSRemoteResource resource) throws CVSException {
- CVSTag tag = null;
- if (resource.isContainer()) {
- tag = ((ICVSRemoteFolder)resource).getTag();
- } else {
- ResourceSyncInfo info = ((ICVSRemoteFile)resource).getSyncInfo();
- if (info != null) tag = info.getTag();
- }
- if (tag == null) tag = CVSTag.DEFAULT;
- return tag;
- }
protected boolean isSameFolder(ICVSRemoteResource[] editions) {
return editions[0].getRepository().equals(editions[1].getRepository())
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
index b705cad65..30f3fd451 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
@@ -11,62 +11,45 @@
package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
import org.eclipse.team.internal.core.InfiniteSubProgressMonitor;
import org.eclipse.team.internal.ui.dialogs.IPromptCondition;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
public class ReplaceWithRemoteAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ final IResource[][] resources = new IResource[][] {null};
+ run(new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
try {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 100);
- IResource resources[] = checkOverwriteOfDirtyResources(getSelectedResources(), new InfiniteSubProgressMonitor(monitor, 20));
- if(resources.length > 0) {
- performReplace(resources, Policy.subMonitorFor(monitor, 80));
- }
+ resources[0] = checkOverwriteOfDirtyResources(getSelectedResources(), new InfiniteSubProgressMonitor(monitor, 100));
} catch (TeamException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
- }, true /* cancelable */, PROGRESS_DIALOG);
- }
-
- protected void performReplace(IResource[] resources, IProgressMonitor monitor) throws TeamException {
+ }, false /* cancelable */, PROGRESS_BUSYCURSOR);
+
+ if (resources[0] == null || resources[0].length == 0) return;
+
try {
- Hashtable table = getProviderMapping(resources);
- Set keySet = table.keySet();
- monitor.beginTask(null, keySet.size() * 10); //$NON-NLS-1$
- monitor.setTaskName(Policy.bind("ReplaceWithRemoteAction.replacing")); //$NON-NLS-1$
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 10);
- CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.get(providerResources, IResource.DEPTH_INFINITE, subMonitor);
- }
- } finally {
- monitor.done();
+ // Peform the replace in the background
+ new ReplaceOperation(getShell(), resources[0], null, true).run();
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
index 6e8313439..4d74d80e0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
@@ -11,26 +11,17 @@
package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
/**
* Action for replace with tag.
@@ -42,7 +33,7 @@ public class ReplaceWithTagAction extends WorkspaceAction {
public void execute(IAction action) throws InterruptedException, InvocationTargetException {
// Setup the holders
- final IResource[] resource = new IResource[] {null};
+ final IResource[][] resources = new IResource[][] {null};
final CVSTag[] tag = new CVSTag[] {null};
final boolean[] recurse = new boolean[] {true};
@@ -50,23 +41,22 @@ public class ReplaceWithTagAction extends WorkspaceAction {
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- IResource[] resources;
try {
- resources =
+ resources[0] =
checkOverwriteOfDirtyResources(
getSelectedResources(),
null /* no progress just a busy cursor for now */);
} catch (CVSException e) {
throw new InvocationTargetException(e);
}
- if(resources.length == 0) {
+ if(resources[0].length == 0) {
// nothing to do
return;
}
// show the tags for the projects of the selected resources
- IProject[] projects = new IProject[resources.length];
- for (int i = 0; i < resources.length; i++) {
- projects[i] = resources[i].getProject();
+ IProject[] projects = new IProject[resources[0].length];
+ for (int i = 0; i < resources[0].length; i++) {
+ projects[i] = resources[0][i].getProject();
}
TagSelectionDialog dialog = new TagSelectionDialog(getShell(), projects,
Policy.bind("ReplaceWithTagAction.message"), //$NON-NLS-1$
@@ -84,7 +74,7 @@ public class ReplaceWithTagAction extends WorkspaceAction {
// For non-projects determine if the tag being loaded is the same as the resource's parent
// If it's not, warn the user that they will have strange sync behavior
try {
- if(!CVSAction.checkForMixingTags(getShell(), resources, tag[0])) {
+ if(!CVSAction.checkForMixingTags(getShell(), resources[0], tag[0])) {
tag[0] = null;
return;
}
@@ -94,39 +84,16 @@ public class ReplaceWithTagAction extends WorkspaceAction {
}
}, false /* cancelable */, PROGRESS_BUSYCURSOR); //$NON-NLS-1$
- if (tag[0] == null) return;
+ if (resources[0] == null || resources[0].length == 0 || tag[0] == null) return;
- // Display a progress dialog while replacing
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- int depth = recurse[0] ? IResource.DEPTH_INFINITE : IResource.DEPTH_ONE;
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000); //$NON-NLS-1$
- monitor.setTaskName(Policy.bind("ReplaceWithTagAction.replacing", tag[0].getName())); //$NON-NLS-1$
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.get(providerResources, depth, tag[0], Policy.subMonitorFor(monitor, 100));
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, true /* cancelable */, PROGRESS_DIALOG);
+ try {
+ // Peform the replace in the background
+ new ReplaceOperation(getShell(), resources[0], tag[0], recurse[0]).run();
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
+ }
}
- protected boolean equalTags(CVSTag tag1, CVSTag tag2) {
- if (tag1 == null) tag1 = CVSTag.DEFAULT;
- if (tag2 == null) tag2 = CVSTag.DEFAULT;
- return tag1.equals(tag2);
- }
/**
* @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getErrorTitle()
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
index a456be8b7..230a3638e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
@@ -42,12 +42,11 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
-public class ShowAnnotationAction extends CVSAction {
-
-/**
- * Action to open a CVS Annotate View
- */
+public class ShowAnnotationAction extends WorkspaceAction {
+ /**
+ * Action to open a CVS Annotate View
+ */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
// Get the selected resource.
final ICVSResource cvsResource = getSingleSelectedCVSResource();
@@ -58,43 +57,43 @@ public class ShowAnnotationAction extends CVSAction {
final AnnotateListener listener = new AnnotateListener();
if (cvsResource == null) {
- return;
+ return;
}
// Get the selected revision
final String revision;
try {
ResourceSyncInfo info = cvsResource.getSyncInfo();
- if(info == null) {
- handle(new CVSException(Policy.bind("ShowAnnotationAction.noSyncInfo", cvsResource.getName())));
+ if (info == null) {
+ handle(new CVSException(Policy.bind("ShowAnnotationAction.noSyncInfo", cvsResource.getName()))); //$NON-NLS-1$
return;
}
revision = cvsResource.getSyncInfo().getRevision();
} catch (CVSException e) {
throw new InvocationTargetException(e);
}
-
+
// Run the CVS Annotate action with a progress monitor
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
fetchAnnotation(listener, cvsResource, revision, monitor);
- }
+ }
}, true, PROGRESS_DIALOG);
-
if (listener.hasError()) {
throw new InvocationTargetException(new CVSException(Policy.bind("ShowAnnotationAction.1", listener.getError()))); //$NON-NLS-1$
}
-
+
// Open the view
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
try {
PlatformUI.getWorkbench().showPerspective("org.eclipse.team.cvs.ui.cvsPerspective", window); //$NON-NLS-1$
} catch (WorkbenchException e1) {
- // If this does not work we will just open the view in the curren perspective.
+ // If this does not work we will just open the view in the
+ // curren perspective.
}
}
-
+
try {
AnnotateView view = AnnotateView.openInActivePerspective();
view.showAnnotations(cvsResource, listener.getCvsAnnotateBlocks(), listener.getContents());
@@ -105,6 +104,7 @@ public class ShowAnnotationAction extends CVSAction {
/**
* Send the CVS annotate command
+ *
* @param listener
* @param cvsResource
* @param revision
@@ -112,14 +112,17 @@ public class ShowAnnotationAction extends CVSAction {
* @throws InvocationTargetException
*/
private void fetchAnnotation(final AnnotateListener listener, final ICVSResource cvsResource, final String revision, IProgressMonitor monitor) throws InvocationTargetException {
-
+
try {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 100);
ICVSFolder folder = cvsResource.getParent();
final FolderSyncInfo info = folder.getFolderSyncInfo();
ICVSRepositoryLocation location = CVSProviderPlugin.getPlugin().getRepository(info.getRoot());
- Session session = new Session(location, folder, true /* output to console */);
+ Session session = new Session(location, folder, true /*
+ * output to
+ * console
+ */);
session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */);
try {
Command.QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness();
@@ -127,16 +130,12 @@ public class ShowAnnotationAction extends CVSAction {
CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE);
final Command.LocalOption[] localOption;
if (revision == null) {
- localOption = Command.NO_LOCAL_OPTIONS;
+ localOption = Command.NO_LOCAL_OPTIONS;
} else {
- localOption = new Command.LocalOption[1];
+ localOption = new Command.LocalOption[1];
localOption[0] = Annotate.makeRevisionOption(revision);
}
- IStatus status = Command.ANNOTATE.execute(
- session,
- Command.NO_GLOBAL_OPTIONS,
- localOption, new ICVSResource[] { cvsResource }, listener,
- Policy.subMonitorFor(monitor, 90));
+ IStatus status = Command.ANNOTATE.execute(session, Command.NO_GLOBAL_OPTIONS, localOption, new ICVSResource[]{cvsResource}, listener, Policy.subMonitorFor(monitor, 90));
if (status.getCode() == CVSStatus.SERVER_ERROR) {
throw new CVSServerException(status);
}
@@ -156,13 +155,14 @@ public class ShowAnnotationAction extends CVSAction {
* Ony enabled for single resource selection
*/
protected boolean isEnabled() throws TeamException {
- return (selection.size() == 1);
+ ICVSResource resource = getSingleSelectedCVSResource();
+ return (resource != null && ! resource.isFolder());
}
/**
- * This action is called from one of a Resource Navigator a
- * CVS Resource Navigator or a History Log Viewer. Return
- * the selected resource as an ICVSResource
+ * This action is called from one of a Resource Navigator a CVS Resource
+ * Navigator or a History Log Viewer. Return the selected resource as an
+ * ICVSResource
*
* @return ICVSResource
*/
@@ -172,22 +172,22 @@ public class ShowAnnotationAction extends CVSAction {
if (cvsResources.length == 1) {
return cvsResources[0];
}
-
+
// Selected from a History Viewer
- Object[] logEntries = getSelectedResources(LogEntry.class);
+ Object[] logEntries = getSelectedResources(LogEntry.class);
if (logEntries.length == 1) {
LogEntry aLogEntry = (LogEntry) logEntries[0];
ICVSRemoteFile cvsRemoteFile = aLogEntry.getRemoteFile();
return cvsRemoteFile;
}
-
+
// Selected from a Resource Navigator
- IResource[] resources = getSelectedResources();
- if (resources.length == 1) {
- IContainer parent = resources[0].getParent();
- ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(parent);
- return CVSWorkspaceRoot.getCVSResourceFor(resources[0]);
- }
+ IResource[] resources = getSelectedResources();
+ if (resources.length == 1) {
+ IContainer parent = resources[0].getParent();
+ ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(parent);
+ return CVSWorkspaceRoot.getCVSResourceFor(resources[0]);
+ }
return null;
}
-}
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index 47ca97b68..7af6fff06 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -15,17 +15,11 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSWorkspaceSubscriber;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncView;
-import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.ui.IWorkingSet;
/**
@@ -34,25 +28,13 @@ import org.eclipse.ui.IWorkingSet;
public class SyncAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException {
- if(CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.USE_NEW_SYNCVIEW)) {
- IResource[] resources = getResourcesToSync();
- if (resources == null || resources.length == 0) return;
-
- IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(resources, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
- if(view != null) {
- CVSWorkspaceSubscriber cvsWorkspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
- view.setWorkingSet(workingSet);
- view.selectSubscriber(cvsWorkspaceSubscriber);
- view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
- } else {
- CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- executeInOldSyncView(action);
- }
+ IResource[] resources = getResourcesToSync();
+ if (resources == null || resources.length == 0) return;
+
+ IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(resources, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
+ CVSUIPlugin.showInSyncView(getShell(), resources, workingSet, 0 /* no mode in particular */);
}
-
+
public void executeInOldSyncView(IAction action) throws InvocationTargetException {
try {
IResource[] resources = getResourcesToSync();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
index 5dece06ba..a45f61090 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
@@ -16,9 +16,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.window.Window;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
@@ -69,8 +69,6 @@ public abstract class TagAction extends WorkspaceAction {
} catch (CVSException e1) {
throw new InvocationTargetException(e1);
}
-
- broadcastTagChange(result[0]);
}
protected boolean performPrompting() {
@@ -88,7 +86,7 @@ public abstract class TagAction extends WorkspaceAction {
TagAsVersionDialog dialog = new TagAsVersionDialog(getShell(),
Policy.bind("TagAction.tagResources"), //$NON-NLS-1$
operation);
- if (dialog.open() != InputDialog.OK) return null;
+ if (dialog.open() != Window.OK) return null;
// The user has indicated they want to force a move. Make sure they really do.
if (dialog.shouldMoveTag() && store.getBoolean(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG)) {
@@ -134,31 +132,29 @@ public abstract class TagAction extends WorkspaceAction {
wasCancelled = b;
}
- protected void broadcastTagChange(final ITagOperation operation) throws InvocationTargetException, InterruptedException {
+ public static void broadcastTagChange(final ICVSResource[] resources, final CVSTag tag) throws InvocationTargetException, InterruptedException {
final RepositoryManager manager = CVSUIPlugin.getPlugin().getRepositoryManager();
manager.run(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- ICVSResource[] resources = operation.getCVSResources();
- for (int i = 0; i < resources.length; i++) {
- ICVSResource resource = resources[i];
- // Cache the new tag creation even if the tag may have had warnings.
- try {
- manager.addTags(getRootParent(resource), new CVSTag[] {operation.getTag()});
- } catch (CVSException e) {
- CVSUIPlugin.log(e);
+ public void run(IProgressMonitor monitor) {
+ try {
+ for (int i = 0; i < resources.length; i++) {
+ ICVSResource resource = resources[i];
+ // Cache the new tag creation even if the tag may have had warnings.
+ manager.addTags(getRootParent(resource), new CVSTag[] {tag});
}
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e);
}
}
+ private ICVSResource getRootParent(ICVSResource resource) throws CVSException {
+ if (!resource.isManaged()) return resource;
+ ICVSFolder parent = resource.getParent();
+ if (parent == null) return resource;
+ // Special check for a parent which is the repository itself
+ if (parent.getName().length() == 0) return resource;
+ return getRootParent(parent);
+ }
}, new NullProgressMonitor());
}
-
- private ICVSResource getRootParent(ICVSResource resource) throws CVSException {
- if (!resource.isManaged()) return resource;
- ICVSFolder parent = resource.getParent();
- if (parent == null) return resource;
- // Special check for a parent which is the repository itself
- if (parent.getName().length() == 0) return resource;
- return getRootParent(parent);
- }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
index 13a8e7ecb..1dfee653a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
@@ -11,39 +11,21 @@
package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.core.InfiniteSubProgressMonitor;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.team.internal.ccvs.ui.operations.DisconnectOperation;
import org.eclipse.ui.help.WorkbenchHelp;
/**
@@ -54,10 +36,9 @@ public class UnmanageAction extends WorkspaceAction {
static class DeleteProjectDialog extends MessageDialog {
- private IProject[] projects;
- private boolean deleteContent = false;
- private Button radio1;
- private Button radio2;
+ boolean deleteContent = false;
+ Button radio1;
+ Button radio2;
DeleteProjectDialog(Shell parentShell, IProject[] projects) {
super(
@@ -68,7 +49,6 @@ public class UnmanageAction extends WorkspaceAction {
MessageDialog.QUESTION,
new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
0); // yes is the default
- this.projects = projects;
}
static String getTitle(IProject[] projects) {
@@ -131,47 +111,15 @@ public class UnmanageAction extends WorkspaceAction {
*/
public void execute(IAction action) throws InterruptedException, InvocationTargetException {
if(confirmDeleteProjects()) {
- run(getOperation(), true /* cancelable */, PROGRESS_DIALOG);
+ try {
+ new DisconnectOperation(getShell(), getSelectedProjects(), deleteContent)
+ .run();
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
+ }
}
}
- private IRunnableWithProgress getOperation() {
- return new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000); //$NON-NLS-1$
- monitor.setTaskName(Policy.bind("Unmanage.unmanaging")); //$NON-NLS-1$
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new InfiniteSubProgressMonitor(monitor, 1000);
- subMonitor.beginTask(null, 100);
- CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- for (int i = 0; i < providerResources.length; i++) {
- IResource resource = providerResources[i];
- ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
- try {
- if(deleteContent) {
- folder.unmanage(Policy.subMonitorFor(subMonitor, 10));
- }
- } finally {
- // We want to remove the nature even if the unmanage operation fails
- RepositoryProvider.unmap((IProject)resource);
- }
- }
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- };
- }
-
boolean confirmDeleteProjects() {
final int[] result = new int[] { MessageDialog.OK };
IProject[] projects = getSelectedProjects();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
index ef98718b7..c2ba522c0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/console/CVSOutputConsole.java
@@ -6,17 +6,22 @@ import java.util.Date;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.client.listeners.IConsoleListener;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
-public class CVSOutputConsole extends MessageConsole implements IConsoleListener {
+public class CVSOutputConsole extends MessageConsole implements IConsoleListener, IPropertyChangeListener {
private Color commandColor;
private Color messageColor;
@@ -31,24 +36,48 @@ public class CVSOutputConsole extends MessageConsole implements IConsoleListener
private static final DateFormat TIME_FORMAT = new SimpleDateFormat(Policy.bind("Console.resultTimeFormat")); //$NON-NLS-1$
public CVSOutputConsole() {
- super("CVS", CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVS_CONSOLE));
+ super("CVS", CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVS_CONSOLE)); //$NON-NLS-1$
commandStream = newMessageStream();
errorStream = newMessageStream();
messageStream = newMessageStream();
+
+ // install colors
+ commandColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR);
+ commandStream.setColor(commandColor);
+
+ messageColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR);
+ messageStream.setColor(messageColor);
+
+ errorColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR);
+ errorStream.setColor(errorColor);
+
+ // install font
+ setFont(JFaceResources.getFont(getPreferenceStore().getString(ICVSUIConstants.PREF_CONSOLE_FONT)));
+
CVSProviderPlugin.getPlugin().setConsoleListener(this);
+ CVSUIPlugin.getPlugin().getPreferenceStore().addPropertyChangeListener(this);
}
+ public void shutdown() {
+ commandColor.dispose();
+ messageColor.dispose();
+ errorColor.dispose();
+ }
+
public void commandInvoked(String line) {
commandStarted = System.currentTimeMillis();
commandStream.println(Policy.bind("Console.preExecutionDelimiter")); //$NON-NLS-1$
commandStream.println(line);
}
+
public void messageLineReceived(String line) {
messageStream.println(" " + line); //$NON-NLS-1$
}
+
public void errorLineReceived(String line) {
errorStream.println(" " + line); //$NON-NLS-1$
}
+
public void commandCompleted(IStatus status, Exception exception) {
long commandRuntime = System.currentTimeMillis() - commandStarted;
String time;
@@ -104,4 +133,43 @@ public class CVSOutputConsole extends MessageConsole implements IConsoleListener
}
return status.getMessage();
}
-}
+
+ /**
+ * Returns a color instance based on data from a preference field.
+ */
+ private Color createColor(Display display, String preference) {
+ RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), preference);
+ return new Color(display, rgb);
+ }
+
+ private IPreferenceStore getPreferenceStore() {
+ return CVSUIPlugin.getPlugin().getPreferenceStore();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ // colors
+ if(property.equals(ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR)) {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR);
+ commandStream.setColor(newColor);
+ commandColor.dispose();
+ commandColor = newColor;
+ } else if(property.equals(ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR)) {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR);
+ messageStream.setColor(newColor);
+ messageColor.dispose();
+ messageColor = newColor;
+ } else if(property.equals(ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR)) {
+ Color newColor = createColor(CVSUIPlugin.getStandardDisplay(), ICVSUIConstants.PREF_CONSOLE_ERROR_COLOR);
+ errorStream.setColor(newColor);
+ errorColor.dispose();
+ errorColor = newColor;
+ // font
+ } else if(property.equals(ICVSUIConstants.PREF_CONSOLE_FONT)) {
+ setFont(JFaceResources.getFont(getPreferenceStore().getString(ICVSUIConstants.PREF_CONSOLE_FONT)));
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 582ae672e..44f6b4e9f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -15,14 +15,16 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -63,13 +65,14 @@ public class MergeWizard extends Wizard {
CVSTag endTag = endPage.getTag();
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
- TeamSubscriber.getSubscriberManager().registerSubscriber(s);
+ MergeSynchronizeParticipant participant = new MergeSynchronizeParticipant(s);
+ ISynchronizeManager manager = TeamUI.getSynchronizeManager();
+ manager.addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
+ ISynchronizeView view = manager.showSynchronizeViewInActivePage(null);
if(view != null) {
- view.setWorkingSet(null); /* show all resources in the merge */
- view.selectSubscriber(s);
- view.refreshWithRemote(s, resources);
+ view.display(participant);
+ participant.refreshWithRemote(s.roots());
} else {
CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
return false;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
index f2534ba10..f0d4c430d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
@@ -116,6 +116,7 @@ public class MergeWizardStartPage extends CVSWizardPage {
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
table.refresh();
+ setPageComplete(! table.getSelection().isEmpty());
}
});
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index cde9e01f0..4722d6c86 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -1031,3 +1031,19 @@ RemoteRevisionQuickDiffProvider.readingFile=Error reading remote file
RemoteRevisionQuickDiffProvider.closingFile=Error closing remote file
RemoteRevisionQuickDiffProvider.fetchingFile=CVS QuickDiff: fetching remote contents for ''{0}''
RemoteCompareOperation.0=Comparing tags {0} and {1} of {2}
+action.SynchronizeViewCommit.label=Commit
+action.SynchronizeViewCommit.tooltip=Commit All Outgoing Changes
+action.SynchronizeViewCommit.description=Commit All Outgoing Changes
+action.SynchronizeViewCommit.image=checkin_action.gif
+
+action.SynchronizeViewUpdate.label=Update
+action.SynchronizeViewUpdate.tooltip=Update All Incoming Changes
+action.SynchronizeViewUpdate.description=Update All Incoming Changes
+action.SynchronizeViewUpdate.image=checkout_action.gif
+
+MergeSynchronizeParticipant.8=Missing id initializing cvs merge participant
+MergeSynchronizeParticipant.9=Unable to initialize cvs merge subscriber
+MergeSynchronizeParticipant.10=Missing root nodes in cvs merge subscriber memento: {0}
+MergeSynchronizeParticipant.11=Root resource in cvs merge subscriber is no longer in workspace, ignoring: {0}
+MergeSynchronizeParticipant.12=Missing root resources for cvs merge subscriber: {0}
+DisconnectOperation.0=Disconnecting
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
index d7cb29008..325001d37 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/RemoteContentProvider.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.model;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
@@ -18,7 +19,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.RemoteResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.model.WorkbenchContentProvider;
@@ -40,7 +40,7 @@ public class RemoteContentProvider extends WorkbenchContentProvider {
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (viewer instanceof AbstractTreeViewer) {
- if(CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.BACKGROUND_REPOVIEW)) {
+ if(CVSUIPlugin.getPlatformPerformance() != Platform.MIN_PERFORMANCE) {
manager = new DeferredTreeContentManager(this, (AbstractTreeViewer) viewer);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSBlockingRunnableContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSBlockingRunnableContext.java
index 6b2fb3895..a36b164df 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSBlockingRunnableContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSBlockingRunnableContext.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.IProgressService;
/**
* This CVS runnable context blocks the UI and can therfore have a shell assigned to
@@ -48,7 +49,13 @@ public class CVSBlockingRunnableContext implements ICVSRunnableContext {
protected IRunnableContext getRunnableContext() {
if (runnableContext == null) {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ return new IRunnableContext() {
+ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
+ throws InvocationTargetException, InterruptedException {
+ IProgressService manager = PlatformUI.getWorkbench().getProgressService();
+ manager.busyCursorWhile(runnable);
+ }
+ };
}
return runnableContext;
}
@@ -76,7 +83,7 @@ public class CVSBlockingRunnableContext implements ICVSRunnableContext {
exception[0] = e;
}
}
- }, schedulingRule, Policy.subMonitorFor(monitor, 100));
+ }, schedulingRule, 0 /* allow updates */, Policy.subMonitorFor(monitor, 100));
if (exception[0] != null) {
if (exception[0] instanceof InvocationTargetException) {
throw (InvocationTargetException)exception[0];
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
index f73de1e8d..470432a87 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
@@ -12,12 +12,14 @@ package org.eclipse.team.internal.ccvs.ui.operations;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -28,7 +30,6 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.util.Assert;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -48,7 +49,6 @@ public abstract class CVSOperation implements IRunnableWithProgress {
// shell to be used if the runnabl context is a blocking context
private Shell shell;
- private boolean modifiesWorkspace = true;
// instance variable used to indicate behavior while prompting for overwrite
private boolean confirmOverwrite = true;
@@ -71,7 +71,6 @@ public abstract class CVSOperation implements IRunnableWithProgress {
* @throws InterruptedException
*/
public synchronized void run() throws CVSException, InterruptedException {
- ICVSRunnableContext context = getCVSRunnableContext();
try {
getCVSRunnableContext().run(getTaskName(), getSchedulingRule(), getPostponeBuild(), this);
} catch (InvocationTargetException e) {
@@ -82,7 +81,7 @@ public abstract class CVSOperation implements IRunnableWithProgress {
}
protected boolean areJobsEnabled() {
- return CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.BACKGROUND_OPERATIONS);
+ return CVSUIPlugin.getPlatformPerformance() != Platform.MIN_PERFORMANCE;
}
/**
@@ -182,14 +181,6 @@ public abstract class CVSOperation implements IRunnableWithProgress {
return getCVSRunnableContext().getShell();
}
- public boolean isModifiesWorkspace() {
- return modifiesWorkspace;
- }
-
- public void setModifiesWorkspace(boolean b) {
- modifiesWorkspace = b;
- }
-
protected void addError(IStatus status) {
if (status.isOK()) return;
if (isLastError(status)) return;
@@ -320,5 +311,17 @@ public abstract class CVSOperation implements IRunnableWithProgress {
* @return
*/
protected abstract String getTaskName();
+
+ /**
+ * Return true if any of the accumulated status have a severity of ERROR
+ * @return
+ */
+ protected boolean errorsOccurred() {
+ for (Iterator iter = errors.iterator(); iter.hasNext();) {
+ IStatus status = (IStatus) iter.next();
+ if (status.getSeverity() == IStatus.ERROR) return true;
+ }
+ return false;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSSubscriberNonblockingContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSSubscriberNonblockingContext.java
index f0cd4b5bb..c880bcd84 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSSubscriberNonblockingContext.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSSubscriberNonblockingContext.java
@@ -12,7 +12,7 @@ package org.eclipse.team.internal.ccvs.ui.operations;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.internal.ui.jobs.JobStatusHandler;
-import org.eclipse.team.ui.sync.SubscriberAction;
+import org.eclipse.team.ui.synchronize.actions.SubscriberAction;
/**
* This context uses the JobStatusHandler from SubscriberAction to ensure
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
index bc4255e11..f1cdba5f0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteCompareOperation.java
@@ -10,40 +10,22 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import org.eclipse.compare.CompareUI;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.*;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.RDiff;
-import org.eclipse.team.internal.ccvs.core.client.Session;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.client.*;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.listeners.RDiffSummaryListener;
-import org.eclipse.team.internal.ccvs.core.resources.FileContentCachingService;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTree;
+import org.eclipse.team.internal.ccvs.core.resources.*;
+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Assert;
-import org.eclipse.team.internal.ccvs.ui.CVSCompareEditorInput;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.ResourceEditionNode;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.ui.IWorkbenchPage;
@@ -57,6 +39,28 @@ public class RemoteCompareOperation extends RemoteOperation implements RDiffSum
private RemoteFolderTree leftTree, rightTree;
+ public static CVSTag getTag(ICVSRemoteResource resource) throws CVSException {
+ CVSTag tag = null;
+ try {
+ if (resource.isContainer()) {
+ tag = ((ICVSRemoteFolder)resource).getTag();
+ } else {
+ ICVSRemoteFile file = (ICVSRemoteFile)resource;
+ String revision = file.getRevision();
+ if (revision.equals(ResourceSyncInfo.ADDED_REVISION)) {
+ ResourceSyncInfo info =file.getSyncInfo();
+ if (info != null) tag = info.getTag();
+ } else {
+ tag = new CVSTag(revision, CVSTag.VERSION);
+ }
+ }
+ } catch (TeamException e) {
+ throw CVSException.wrapException(e);
+ }
+ if (tag == null) tag = CVSTag.DEFAULT;
+ return tag;
+ }
+
/**
* Compare two versions of the given remote resource.
* @param shell
@@ -68,15 +72,11 @@ public class RemoteCompareOperation extends RemoteOperation implements RDiffSum
super(shell, new ICVSRemoteResource[] {remoteResource});
Assert.isNotNull(tag);
this.right = tag;
- if (remoteResource.isContainer()) {
- this.left = ((ICVSRemoteFolder)remoteResource).getTag();
- } else {
- try {
- this.left = remoteResource.getSyncInfo().getTag();
- } catch (CVSException e) {
- // This shouldn't happen but log it just in case
- CVSProviderPlugin.log(e);
- }
+ try {
+ this.left = getTag(remoteResource);
+ } catch (CVSException e) {
+ // This shouldn't happen but log it just in case
+ CVSProviderPlugin.log(e);
}
if (this.left == null) {
this.left = CVSTag.DEFAULT;
@@ -154,7 +154,9 @@ public class RemoteCompareOperation extends RemoteOperation implements RDiffSum
private IStatus buildTrees(ICVSRemoteResource resource, IProgressMonitor monitor) throws CVSException {
// Initialize the resulting trees
leftTree = new RemoteFolderTree(null, resource.getRepository(), ICVSRemoteFolder.REPOSITORY_ROOT_FOLDER_NAME, left);
+ leftTree.setChildren(new ICVSRemoteResource[0]);
rightTree = new RemoteFolderTree(null, resource.getRepository(), ICVSRemoteFolder.REPOSITORY_ROOT_FOLDER_NAME, right);
+ rightTree.setChildren(new ICVSRemoteResource[0]);
Command.QuietOption oldOption= CVSProviderPlugin.getPlugin().getQuietness();
Session session = new Session(resource.getRepository(), leftTree, false);
try {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
index c49567055..9e67c5573 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
@@ -17,6 +17,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
@@ -70,6 +71,15 @@ public class ReplaceOperation extends UpdateOperation {
throws CVSException, InterruptedException {
monitor.beginTask(null, 100);
+ // Accumulate the managed resources from the list of provided resources
+ List managedResources = new ArrayList();
+ for (int i = 0; i < resources.length; i++) {
+ ICVSResource resource = resources[i];
+ if (resource.isManaged() ||
+ (resource.isFolder() && ((ICVSFolder)resource).isCVSFolder())) {
+ managedResources.add(resource);
+ }
+ }
try {
new PrepareForReplaceVisitor().visitResources(
provider.getProject(),
@@ -77,9 +87,14 @@ public class ReplaceOperation extends UpdateOperation {
"CVSTeamProvider.scrubbingResource", // TODO: This is a key in CVS core! //$NON-NLS-1$
recurse ? IResource.DEPTH_INFINITE : IResource.DEPTH_ZERO,
Policy.subMonitorFor(monitor, 30)); //$NON-NLS-1$
-
- // Perform an update, ignoring any local file modifications
- return super.executeCommand(session, provider, resources, monitor);
+
+ // Only perform the remote command if some of the resources being replaced were managed
+ if (managedResources.isEmpty()) {
+ return OK;
+ } else {
+ // Perform an update, ignoring any local file modifications
+ return super.executeCommand(session, provider, resources, Policy.subMonitorFor(monitor, 70));
+ }
} finally {
monitor.done();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
index c4bcf15e1..48f263df2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java
@@ -10,25 +10,14 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -60,10 +49,27 @@ public abstract class RepositoryProviderOperation extends CVSOperation {
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- execute(provider, providerResources, subMonitor);
+ ISchedulingRule rule = getSchedulingRule(provider);
+ try {
+ Platform.getJobManager().beginRule(rule, monitor);
+ execute(provider, providerResources, subMonitor);
+ } finally {
+ Platform.getJobManager().endRule(rule);
+ }
}
}
+ /**
+ * Retgurn the scheduling rule to be obtained before work
+ * begins on the given provider. By default, it is the provider's project.
+ * This can be changed by subclasses.
+ * @param provider
+ * @return
+ */
+ protected ISchedulingRule getSchedulingRule(CVSTeamProvider provider) {
+ return provider.getProject();
+ }
+
/*
* Helper method. Return a Map mapping provider to a list of resources
* shared with that provider.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
index 4035e0e66..3a7ba94f3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
+import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Set;
@@ -24,6 +25,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.RTag;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.actions.TagAction;
public class TagInRepositoryOperation extends RemoteOperation implements ITagOperation {
@@ -44,7 +46,14 @@ public class TagInRepositoryOperation extends RemoteOperation implements ITagOpe
for (int i = 0; i < resources.length; i++) {
IStatus status = resources[i].tag(getTag(), getLocalOptions(), new SubProgressMonitor(monitor, 1000));
collectStatus(status);
- }
+ }
+ if (!errorsOccurred()) {
+ try {
+ TagAction.broadcastTagChange(getCVSResources(), getTag());
+ } catch (InvocationTargetException e) {
+ throw CVSException.wrapException(e);
+ }
+ }
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
index 459bd067b..7abd605f7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java
@@ -10,23 +10,25 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
+import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Tag;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.actions.TagAction;
public class TagOperation extends RepositoryProviderOperation implements ITagOperation {
@@ -49,7 +51,16 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
protected void execute(CVSTeamProvider provider, IResource[] resources, IProgressMonitor monitor) throws CVSException, InterruptedException {
- collectStatus(tag(provider, resources, monitor));
+ IStatus status = tag(provider, resources, monitor);
+ collectStatus(status);
+ }
+
+ private ICVSResource[] getCVSResources(IResource[] resources) {
+ ICVSResource[] cvsResources = new ICVSResource[resources.length];
+ for (int i = 0; i < cvsResources.length; i++) {
+ cvsResources[i] = CVSWorkspaceRoot.getCVSResourceFor(resources[i]);
+ }
+ return cvsResources;
}
/**
@@ -57,7 +68,6 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
*/
protected String getErrorMessage(IStatus[] problems, int operationCount) {
// We accumulated 1 status per resource above.
- MultiStatus combinedStatus;
if(operationCount == 1) {
return Policy.bind("TagAction.tagProblemsMessage"); //$NON-NLS-1$
} else {
@@ -124,4 +134,19 @@ public class TagOperation extends RepositoryProviderOperation implements ITagOpe
protected String getTaskName() {
return Policy.bind("TagFromWorkspace.taskName"); //$NON-NLS-1$
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
+ super.execute(monitor);
+ if (!errorsOccurred()) {
+ try {
+ TagAction.broadcastTagChange(getCVSResources(), getTag());
+ } catch (InvocationTargetException e) {
+ throw CVSException.wrapException(e);
+ }
+ }
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
index bdbe5b081..ac97ce0c1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/UpdateOperation.java
@@ -36,8 +36,15 @@ public class UpdateOperation extends SingleCommandOperation {
CVSTag tag;
/**
+ * Create an UpdateOperation that will perform on update on the given resources
+ * using the given local option. If a tag is provided, it will be added to the
+ * local options using the appropriate argument (-r or -D). If the tag is <code>null</code>
+ * then the tag will be omitted from the local options and the tags on the local resources
+ * will be used.
* @param shell
* @param resources
+ * @param options
+ * @param tag
*/
public UpdateOperation(Shell shell, IResource[] resources, LocalOption[] options, CVSTag tag) {
super(shell, resources, options);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java
index e4dc665cb..12d3dc4c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java
@@ -151,6 +151,7 @@ public class CVSRepositoryPropertiesPage extends PropertyPage {
userText.addListener(SWT.Modify, new Listener() {
public void handleEvent(Event event) {
connectionInfoChanged = true;
+ updateWidgetEnablements();
}
});
methodType.addListener(SWT.Modify, new Listener() {
@@ -516,6 +517,13 @@ public class CVSRepositoryPropertiesPage extends PropertyPage {
return;
}
}
+ String user = userText.getText();
+ if ((user.indexOf('@') != -1) || (user.indexOf(':') != -1)) {
+ setErrorMessage(Policy.bind("ConfigurationWizardMainPage.invalidUserName")); //$NON-NLS-1$
+ setValid(false);
+ return;
+ }
+ setErrorMessage(null);
setValid(true);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java
index 6a1b436d5..7b93fbb2c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java
@@ -10,26 +10,28 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.repo;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.internal.jobs.JobManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ccvs.ui.model.RepositoryLocationSchedulingRule;
import org.eclipse.team.internal.ui.dialogs.DetailsDialogWithProjects;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.ui.progress.IProgressService;
/**
@@ -76,8 +78,9 @@ public class RemoveRootAction extends SelectionListenerAction {
public void run() {
ICVSRepositoryLocation[] roots = getSelectedRemoteRoots();
if (roots.length == 0) return;
- CVSProviderPlugin provider = CVSProviderPlugin.getPlugin();
+ final CVSProviderPlugin provider = CVSProviderPlugin.getPlugin();
for (int i = 0; i < roots.length; i++) {
+ final ICVSRepositoryLocation root = roots[i];
try {
// Check if any projects are shared with the repository
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -109,17 +112,32 @@ public class RemoveRootAction extends SelectionListenerAction {
}
});
} else {
- ISchedulingRule rule = new RepositoryLocationSchedulingRule(roots[i]);
- JobManager.getInstance().beginRule(rule);
+ IProgressService manager = PlatformUI.getWorkbench().getProgressService();
try {
- view.getContentProvider().cancelJobs(roots[i]);
- provider.disposeRepository(roots[i]);
- } finally {
- JobManager.getInstance().endRule(rule);
+ manager.busyCursorWhile(new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ ISchedulingRule rule = new RepositoryLocationSchedulingRule(root);
+ try {
+ JobManager.getInstance().beginRule(rule, monitor);
+ view.getContentProvider().cancelJobs(root);
+ provider.disposeRepository(root);
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ JobManager.getInstance().endRule(rule);
+ }
+
+ }
+ });
+ } catch (InvocationTargetException e) {
+ throw CVSException.wrapException(e);
+ } catch (InterruptedException e) {
+ // Canceled
+ return;
}
}
} catch (CVSException e) {
- CVSUIPlugin.log(e);
+ CVSUIPlugin.openError(view.getShell(), null, null, e, CVSUIPlugin.PERFORM_SYNC_EXEC | CVSUIPlugin.LOG_TEAM_EXCEPTIONS | CVSUIPlugin.LOG_NONTEAM_EXCEPTIONS);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberAction.java
index 7da493bf5..06ee22802 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberAction.java
@@ -11,39 +11,27 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.operations.CVSBlockingRunnableContext;
-import org.eclipse.team.internal.ccvs.ui.operations.CVSSubscriberNonblockingContext;
-import org.eclipse.team.internal.ccvs.ui.operations.ICVSRunnableContext;
-import org.eclipse.team.ui.sync.SubscriberAction;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.internal.ccvs.ui.operations.*;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.actions.SubscriberAction;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
public abstract class CVSSubscriberAction extends SubscriberAction {
@@ -146,7 +134,10 @@ public abstract class CVSSubscriberAction extends SubscriberAction {
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()).run(
+ // Pass the scheduling rule to the synchronizer so that sync change events
+ // and cache commits to disk are batched
+ EclipseSynchronizer.getInstance().run(
+ getSchedulingRule(syncSet),
new ICVSRunnable() {
public void run(IProgressMonitor monitor) throws CVSException {
try {
@@ -177,7 +168,8 @@ public abstract class CVSSubscriberAction extends SubscriberAction {
}
protected boolean areJobsEnabled() {
- return CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.BACKGROUND_OPERATIONS);
+ int speed = CVSUIPlugin.getPlatformPerformance();
+ return speed != Platform.MIN_PERFORMANCE;
}
/**
@@ -265,10 +257,9 @@ public abstract class CVSSubscriberAction extends SubscriberAction {
*/
protected boolean promptForOverwrite(final SyncInfoSet syncSet) {
final int[] result = new int[] {Dialog.CANCEL};
- final Shell shell = getShell();
- shell.getDisplay().syncExec(new Runnable() {
+ TeamUIPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
- UpdateDialog dialog = new UpdateDialog(shell, syncSet);
+ UpdateDialog dialog = new UpdateDialog(getShell(), syncSet);
result[0] = dialog.open();
}
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
index c63610498..7abcd7fd4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
@@ -31,10 +31,10 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.ui.sync.OrSyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.OrSyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
/**
* This action performs a "cvs update -j start -j end ..." to merge changes
@@ -99,7 +99,7 @@ public class MergeUpdateAction extends SafeUpdateAction {
// Assumption that all nodes are from the same subscriber.
currentSubcriber = nodes[0].getSubscriber();
if (!(currentSubcriber instanceof CVSMergeSubscriber)) {
- throw new CVSException(Policy.bind("MergeUpdateAction.invalidSubscriber", currentSubcriber.getId().toString())); //$NON-NLS-1$
+ throw new CVSException(Policy.bind("MergeUpdateAction.invalidSubscriber", currentSubcriber.toString())); //$NON-NLS-1$
}
CVSTag startTag = ((CVSMergeSubscriber)currentSubcriber).getStartTag();
CVSTag endTag = ((CVSMergeSubscriber)currentSubcriber).getEndTag();
@@ -110,7 +110,7 @@ public class MergeUpdateAction extends SafeUpdateAction {
for (int i = 0; i < nodes.length; i++) {
SyncInfo resource = nodes[i];
int kind = resource.getKind();
- if ((kind & SyncInfo.ADDITION) != 0) {
+ if ((kind & SyncInfo.CHANGE_MASK) == SyncInfo.ADDITION) {
additions.add(resource);
} else {
changes.add(resource);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
index aa7002f89..915a207fd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
@@ -11,9 +11,9 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
public class OverrideAndCommitAction extends SubscriberCommitAction {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
index 456f4d87b..ee498f1a5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
@@ -18,9 +18,9 @@ import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
/**
* Runs an update command that will prompt the user for overwritting local
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
index bde0b4cc9..e885ca707 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
@@ -22,7 +22,6 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.sync.IRemoteResource;
@@ -30,11 +29,12 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.UpdateOnlyMergableOperation;
-import org.eclipse.team.ui.sync.AndSyncInfoFilter;
-import org.eclipse.team.ui.sync.OrSyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.AndSyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.OrSyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
/**
* This update action will update all mergable resources first and then prompt the
@@ -261,8 +261,7 @@ public abstract class SafeUpdateAction extends CVSSubscriberAction {
*/
protected void warnAboutFailedResources(final SyncInfoSet syncSet) {
final int[] result = new int[] {Dialog.CANCEL};
- final Shell shell = getShell();
- shell.getDisplay().syncExec(new Runnable() {
+ TeamUIPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
MessageDialog.openInformation(shell,
Policy.bind("SafeUpdateAction.warnFilesWithConflictsTitle"), //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
index ac6484938..2216abdf3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
@@ -31,9 +31,9 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.sync.ToolTipMessageDialog;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
public class SubscriberCommitAction extends CVSSubscriberAction {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberConfirmMergedAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberConfirmMergedAction.java
index c8e06623a..7d93c8b96 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberConfirmMergedAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberConfirmMergedAction.java
@@ -10,18 +10,15 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
/**
* This action marks the local resource as merged by updating the base
@@ -41,7 +38,6 @@ public class SubscriberConfirmMergedAction extends CVSSubscriberAction {
*/
protected void run(SyncInfoSet syncSet, IProgressMonitor monitor) throws CVSException {
SyncInfo[] syncResources = syncSet.getSyncInfos();
- List needsMerge = new ArrayList();
monitor.beginTask(null, 100 * syncResources.length);
try {
for (int i = 0; i < syncResources.length; i++) {
@@ -60,10 +56,4 @@ public class SubscriberConfirmMergedAction extends CVSSubscriberAction {
}
}
- protected boolean canRunAsJob() {
- // There's no sense doing this operation in the background since
- // it does not contact the server
- return false;
- }
-
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
index 1230ec59c..f3fddaadf 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
@@ -28,8 +28,8 @@ import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ccvs.ui.AdaptableResourceList;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
index 6b1445c85..b9926de6e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
@@ -15,7 +15,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
import org.eclipse.team.internal.ccvs.ui.Policy;
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
index 3f7891a28..a6b604f8d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
@@ -25,9 +25,9 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
-import org.eclipse.team.ui.sync.SyncInfoDirectionFilter;
-import org.eclipse.team.ui.sync.SyncInfoFilter;
-import org.eclipse.team.ui.sync.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoFilter.SyncInfoDirectionFilter;
/**
* This action performs an update for the CVSWorkspaceSubscriber.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index 20b0255b7..2b05f4192 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -43,10 +43,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.core.sync.RemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
@@ -198,7 +196,8 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
}
private static class Decoration implements IDecoration {
- public String prefix, suffix;
+ public String prefix = ""; //$NON-NLS-1$
+ public String suffix = ""; //$NON-NLS-1$
public ImageDescriptor overlay;
/**
@@ -306,14 +305,6 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
CVSLightweightDecorator.decorateTextLabel(resource, decoration, false /*don't show dirty*/, false /*don't show revisions*/);
label = decoration.prefix + label + decoration.suffix;
}
-
- if (CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_SHOW_SYNCINFO_AS_TEXT)) {
- int syncKind = node.getKind();
- if (syncKind != ILocalSyncElement.IN_SYNC) {
- String syncKindString = RemoteSyncElement.kindToString(syncKind);
- label = Policy.bind("CVSCatchupReleaseViewer.labelWithSyncKind", label, syncKindString); //$NON-NLS-1$
- }
- }
return label;
}
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
index 6614fac76..e6978876c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
@@ -18,23 +18,12 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -42,24 +31,13 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.client.Diff;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.misc.ContainerContentProvider;
-import org.eclipse.ui.internal.misc.ResourceAndContainerGroup;
+import org.eclipse.ui.internal.ide.misc.ContainerContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
@@ -78,9 +56,6 @@ public class GenerateDiffFileWizard extends Wizard {
* entering a file name that already exists.
*/
private class PatchFileSelectionPage extends WizardPage {
-
- private IStructuredSelection currentSelection;
- private ResourceAndContainerGroup resourceGroup;
private Text filenameCombo;
private Button browseButton;
@@ -101,7 +76,6 @@ public class GenerateDiffFileWizard extends Wizard {
PatchFileSelectionPage(String pageName, String title, ImageDescriptor image, IStructuredSelection selection) {
super(pageName, title, image);
- this.currentSelection = selection;
setPageComplete(false);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
index 7ce1652a4..9f59a5a5e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
@@ -13,29 +13,14 @@ package org.eclipse.team.internal.ccvs.ui.wizards;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.model.AdaptableList;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.model.*;
/**
* First wizard page for importing a project into a CVS repository.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 29527dbe4..4d10c0ff7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -11,47 +11,26 @@
package org.eclipse.team.internal.ccvs.ui.wizards;
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
+import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
-import org.eclipse.core.resources.IProject;
-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.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
@@ -298,15 +277,8 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
throw new InvocationTargetException(e);
}
}
- ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
- if(view != null) {
- IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$)
- view.setWorkingSet(workingSet);
- view.selectSubscriber(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
- view.setMode(ISynchronizeView.OUTGOING_MODE);
- } else {
- CVSUIPlugin.openError(getContainer().getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
+ CVSUIPlugin.showInSyncView(getContainer().getShell(), null, workingSet, TeamSubscriberParticipant.OUTGOING_MODE);
}
} catch (InterruptedException e) {
return true;

Back to the top