Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-05-03 22:35:20 -0400
committerJean Michel-Lemieux2004-05-03 22:35:20 -0400
commite36d3cddf2c821e0ec9573e7740c802674d46504 (patch)
tree4fb7f02908e585d45156a860d05d2c0989724640
parent791fe9a6b32aae724bf042ed7087b4b5fe9fa2cf (diff)
downloadeclipse.platform.team-e36d3cddf2c821e0ec9573e7740c802674d46504.tar.gz
eclipse.platform.team-e36d3cddf2c821e0ec9573e7740c802674d46504.tar.xz
eclipse.platform.team-e36d3cddf2c821e0ec9573e7740c802674d46504.zip
Improved refresh subscriber task names.I20040503
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshSubscriberJob.java27
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshWizard.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java16
13 files changed, 74 insertions, 28 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
index 47d476580..bac0d81d2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
@@ -18,6 +18,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
+import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.ui.PlatformUI;
@@ -38,8 +39,8 @@ public class CompareWithRemoteAction extends WorkspaceAction {
ISynchronizePageConfiguration.NAVIGATE_GROUP,
ISynchronizePageConfiguration.MODE_GROUP,
ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setWorkingSet(PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("", resources));
- participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), configuration, null); //$NON-NLS-1$
+ configuration.setWorkingSet(PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("", resources)); //$NON-NLS-1$
+ participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), Policy.bind("Participant.comparingDetail", participant.getName(), Utils.stripAmpersand(calculateActionTagValue())), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
}
/*
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index acefe2002..03d0b4acd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -41,12 +41,7 @@ public class CompareWithTagAction extends WorkspaceAction {
ISynchronizePageConfiguration.LAYOUT_GROUP });
configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSCompareSubscriber.ID_MODAL);
- participant.refreshInDialog(
- getShell(),
- resources,
- Policy.bind("Participant.comparing"),
- configuration,
- null);
+ participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), participant.getName(), configuration, null); //$NON-NLS-1$
}
protected CVSTag promptForTag(IResource[] resources) {
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 ded01768f..5aafef84a 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
@@ -31,7 +31,7 @@ public class SyncAction extends WorkspaceAction {
WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
if(participant != null) {
- participant.refresh(resources, Policy.bind("Participant.synchronizing"), getTargetPart().getSite()); //$NON-NLS-1$
+ participant.refresh(resources, Policy.bind("Participant.synchronizing"), Policy.bind("Participant.synchronizingDetail", participant.getName()), getTargetPart().getSite()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 469a4e8c0..a8332727d 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
@@ -67,7 +67,7 @@ public class MergeWizard extends Wizard {
ISynchronizePageConfiguration.MODE_GROUP,
ISynchronizePageConfiguration.LAYOUT_GROUP });
configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSMergeSubscriber.ID_MODAL);
- participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), configuration, null); //$NON-NLS-1$
+ participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
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 133ebb7be..ed596fba6 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
@@ -1082,6 +1082,11 @@ CVSSynchronizeViewPage.0=Show incoming grouped by comment
Participant.comparing=Comparing
Participant.merging=Merging
Participant.synchronizing=Synchronizing
+
+Participant.comparingDetail=Comparing {0} with {1}
+Participant.mergingDetail=Merging {0}
+Participant.synchronizingDetail=Synchronizing {0}
+
CompareWithRevisionAction.4=Compare With Revision
ReplaceWithRevisionAction.0=&Replace
ReplaceWithRevisionAction.1=Replace With Revision
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 3434ae092..047c67087 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -532,4 +532,20 @@ public class Utils {
public static String getKey(String id, String secondaryId) {
return secondaryId == null ? id : id + '/' + secondaryId;
}
+
+ public static String stripAmpersand(String string) {
+ if( string.indexOf('&') != -1) {
+ StringBuffer buffer = new StringBuffer(string);
+ char last = 'x';
+ for (int i = string.length()-1; i > -1; i--) {
+ char c = string.charAt(i);
+ if(c == '&') {
+ buffer.deleteCharAt(i);
+ break;
+ }
+ }
+ return buffer.toString();
+ }
+ return string;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index fc285bca3..bf260c35f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -344,7 +344,8 @@ RefreshSchedule.10=minutes
RefreshSchedule.11=hour
RefreshSchedule.12=minute
RefreshSchedule.13=Every {0} {1}
-RefreshSchedule.14=Scheduled synchronize of ''{0}''
+RefreshSchedule.14=Scheduled Synchronize
+RefreshSchedule.15={0} {1}
DiffNodeControllerHierarchical.0=Updating labels
ChangesSection.8=Show Errors
ChangesSection.9=Reset View
@@ -373,6 +374,9 @@ RefreshSubscriberJob.2=Synchronizing {0}
Participant.comparing=Comparing
Participant.merging=Merging
Participant.synchronizing=Synchronizing
+Participant.comparingDetail=Comparing {0}
+Participant.mergingDetail=Merging {0}
+Participant.synchronizingDetail=Synchronizing {0}
GlobalRefreshResourceSelectionPage.1=Synchronize
GlobalRefreshResourceSelectionPage.2=Select the resources to synchronize or select a scope to automatically select a group of resources.
GlobalRefreshResourceSelectionPage.3=Synchronize
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshSubscriberJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshSubscriberJob.java
index 0a1413fc8..87d271d6f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshSubscriberJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshSubscriberJob.java
@@ -37,7 +37,14 @@ import org.eclipse.ui.progress.UIJob;
/**
* Job to refresh a {@link Subscriber} in the background. The job can be configured
* to be re-scheduled and run at a specified interval.
- *
+ * <p>
+ * The job supports a basic workflow for modal/non-modal usage. If the job is
+ * run in the foreground (e.g. in a modal progress dialog) the refresh listeners
+ * action is invoked immediately after the refresh is completed. Otherwise the refresh
+ * listeners action is associated to the job as a <i>goto</i> action. This will
+ * allow the user to select the action in the progress view and run it when they
+ * choose.
+ * </p>
* @since 3.0
*/
public final class RefreshSubscriberJob extends WorkspaceJob {
@@ -67,9 +74,18 @@ public final class RefreshSubscriberJob extends WorkspaceJob {
*/
private IResource[] resources;
+ /**
+ * The participant that is being refreshed.
+ */
private SubscriberParticipant participant;
/**
+ * The task name for this refresh. This is usually more descriptive than the
+ * job name.
+ */
+ private String taskName;
+
+ /**
* Refresh started/completed listener for every refresh
*/
private static List listeners = new ArrayList(1);
@@ -100,17 +116,20 @@ public final class RefreshSubscriberJob extends WorkspaceJob {
/**
* Create a job to refresh the specified resources with the subscriber.
+ *
+ * @param participant the subscriber participant
* @param name
* @param resources
* @param subscriber
*/
- public RefreshSubscriberJob(SubscriberParticipant participant, String name, IResource[] resources, IRefreshSubscriberListener listener) {
- super(name);
+ public RefreshSubscriberJob(SubscriberParticipant participant, String jobName, String taskName, IResource[] resources, IRefreshSubscriberListener listener) {
+ super(jobName);
Assert.isNotNull(resources);
Assert.isNotNull(participant);
Assert.isNotNull(resources);
this.resources = resources;
this.participant = participant;
+ this.taskName = taskName;
setPriority(Job.DECORATE);
setRefreshInterval(3600 /* 1 hour */);
@@ -285,7 +304,7 @@ public final class RefreshSubscriberJob extends WorkspaceJob {
};
IProgressMonitor group = Platform.getJobManager().createProgressGroup();
- group.beginTask(participant.getName(), 100);
+ group.beginTask(taskName, 100);
setProgressGroup(group, 80);
getCollector().setProgressGroup(group, 20);
setProperty(new QualifiedName("org.eclipse.ui.workbench.progress", "icon"), participant.getImageDescriptor());
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
index 4c0200d57..e8fc36fc4 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
@@ -28,8 +28,10 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc
private SubscriberParticipant participant;
private ISynchronizePageConfiguration configuration;
private Shell shell;
+ private String title;
- public RefreshUserNotificationPolicyInModalDialog(Shell shell, ISynchronizePageConfiguration configuration, SubscriberParticipant participant) {
+ public RefreshUserNotificationPolicyInModalDialog(Shell shell, String title, ISynchronizePageConfiguration configuration, SubscriberParticipant participant) {
+ this.title = title;
this.configuration = configuration;
this.participant = participant;
this.shell = shell;
@@ -82,7 +84,11 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc
protected void compareAndOpenDialog(final IRefreshEvent event, final SubscriberParticipant participant) {
CompareConfiguration cc = new CompareConfiguration();
- ParticipantPageSaveablePart input = new ParticipantPageSaveablePart(Utils.getShell(null), cc, configuration, participant);
+ ParticipantPageSaveablePart input = new ParticipantPageSaveablePart(Utils.getShell(null), cc, configuration, participant) {
+ public String getTitle() {
+ return RefreshUserNotificationPolicyInModalDialog.this.title;
+ }
+ };
ParticipantPageDialog dialog = new ParticipantPageDialog(shell, input, participant);
dialog.setBlockOnOpen(true);
dialog.open();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
index dc41165d1..49624ccfa 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java
@@ -112,7 +112,7 @@ public class SubscriberRefreshSchedule {
}
if(job == null) {
SubscriberParticipant participant = getParticipant();
- job = new RefreshSubscriberJob(participant, Policy.bind("RefreshSchedule.14", participant.getName(), getRefreshIntervalAsString()), participant.getResources(), new RefreshUserNotificationPolicy(getParticipant())); //$NON-NLS-1$
+ job = new RefreshSubscriberJob(participant, Policy.bind("RefreshSchedule.14"), Policy.bind("RefreshSchedule.15", participant.getName(), getRefreshIntervalAsString()), participant.getResources(), new RefreshUserNotificationPolicy(getParticipant())); //$NON-NLS-1$
job.setUser(false);
} else if(job.getState() != Job.NONE){
stopJob();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshWizard.java
index 2277a4f55..7585343b7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshWizard.java
@@ -63,7 +63,7 @@ public class SubscriberRefreshWizard extends Wizard {
schedulePage.performFinish();
if(resources != null && resources.length > 0) {
// We don't know in which site to show progress because a participant could actually be shown in multiple sites.
- participant.refresh(resources, Policy.bind("Participant.synchronizing"), null); //$NON-NLS-1$
+ participant.refresh(resources, Policy.bind("Participant.synchronizing"), Policy.bind("Participant.synchronizingDetail", participant.getName()), null); //$NON-NLS-1$ //$NON-NLS-2$
}
return true;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
index ea1d880ba..a15c0fbdd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
@@ -60,7 +60,7 @@ public final class SubscriberActionContribution extends SynchronizePageActionGro
public void run() {
IStructuredSelection selection = (IStructuredSelection)site.getSelectionProvider().getSelection();
IResource[] resources = Utils.getResources(selection.toArray());
- participant.refresh(resources, Policy.bind("Participant.synchronizing"), site.getWorkbenchSite()); //$NON-NLS-1$
+ participant.refresh(resources, Policy.bind("Participant.synchronizing"), Policy.bind("Participant.synchronizingDetails", participant.getName()), site.getWorkbenchSite()); //$NON-NLS-1$ //$NON-NLS-2$
}
};
Utils.initAction(refreshSelectionAction, "action.refreshWithRemote."); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
index 768ff96a1..0e67da96c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SubscriberParticipant.java
@@ -105,9 +105,9 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
* @param taskName
* @param site
*/
- public final void refreshInDialog(Shell shell, IResource[] resources, String taskName, ISynchronizePageConfiguration configuration, IWorkbenchSite site) {
- IRefreshSubscriberListener listener = new RefreshUserNotificationPolicyInModalDialog(shell, configuration, this);
- internalRefresh(resources, taskName, site, listener);
+ public final void refreshInDialog(Shell shell, IResource[] resources, String jobName, String taskName, ISynchronizePageConfiguration configuration, IWorkbenchSite site) {
+ IRefreshSubscriberListener listener = new RefreshUserNotificationPolicyInModalDialog(shell, taskName, configuration, this);
+ internalRefresh(resources, jobName, taskName, site, listener);
}
/**
@@ -115,16 +115,16 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
*
* @param resources the resources to be refreshed.
*/
- public final void refresh(IResource[] resources, String taskName, IWorkbenchSite site) {
+ public final void refresh(IResource[] resources, String jobName, String taskName, IWorkbenchSite site) {
IRefreshSubscriberListener listener = new RefreshUserNotificationPolicy(this);
- internalRefresh(resources, taskName, site, listener);
+ internalRefresh(resources, jobName, taskName, site, listener);
}
/**
* Refresh a participant. The returned status describes the result of the refresh.
*/
public final IStatus refreshNow(IResource[] resources, String taskName, IProgressMonitor monitor) {
- RefreshSubscriberJob job = new RefreshSubscriberJob(this, taskName, resources, null);
+ RefreshSubscriberJob job = new RefreshSubscriberJob(this, taskName, taskName, resources, null);
return job.runInWorkspace(monitor);
}
@@ -289,8 +289,8 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
* @param site the site in which to run the refresh
* @param listener the listener to handle the refresh workflow
*/
- private void internalRefresh(IResource[] resources, String taskName, IWorkbenchSite site, IRefreshSubscriberListener listener) {
- RefreshSubscriberJob job = new RefreshSubscriberJob(this, taskName, resources, listener);
+ private void internalRefresh(IResource[] resources, String jobName, String taskName, IWorkbenchSite site, IRefreshSubscriberListener listener) {
+ RefreshSubscriberJob job = new RefreshSubscriberJob(this, jobName, taskName, resources, listener);
job.setUser(true);
Utils.schedule(job, site);
}

Back to the top