Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java5
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/JobUtil.java55
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/CleanupUncomittedChangesDialog.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java6
28 files changed, 150 insertions, 56 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
index 53c14d6e05..8055d706e8 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
@@ -29,6 +29,7 @@ import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -158,10 +159,10 @@ public class IndexDiffCacheEntry {
String jobName = MessageFormat
.format(CoreText.IndexDiffCacheEntry_refreshingProjects,
repositoryName);
- Job job = new Job(jobName) {
+ Job job = new WorkspaceJob(jobName) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
IProject[] validOpenProjects = ProjectUtil
.getValidOpenProjects(repository);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/JobUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/JobUtil.java
index 305a13eb71..ff15183cde 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/JobUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/JobUtil.java
@@ -8,6 +8,7 @@
*******************************************************************************/
package org.eclipse.egit.core.internal.job;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -25,6 +26,7 @@ public class JobUtil {
* Schedule a user job that executes an EGit operation
*
* @param op
+ * EGit operation to run
* @param jobName
* @param jobFamily
*/
@@ -37,6 +39,7 @@ public class JobUtil {
* Schedule a user job that executes an EGit operation
*
* @param op
+ * EGit operation to run
* @param jobName
* @param jobFamily
* @param jobChangeListener
@@ -67,4 +70,56 @@ public class JobUtil {
job.addJobChangeListener(jobChangeListener);
job.schedule();
}
+
+ /**
+ * Schedule a user workspace job that executes an EGit operation which
+ * ensures that resource change events are batched until the job is finished
+ *
+ * @param op
+ * EGit operation to run
+ * @param jobName
+ * @param jobFamily
+ */
+ public static void scheduleUserWorkspaceJob(final IEGitOperation op,
+ String jobName, final Object jobFamily) {
+ scheduleUserWorkspaceJob(op, jobName, jobFamily, null);
+ }
+
+ /**
+ * Schedule a user workspace job that executes an EGit operation which
+ * ensures that resource change events are batched until the job is finished
+ *
+ * @param op
+ * EGit operation to run
+ * @param jobName
+ * @param jobFamily
+ * @param jobChangeListener
+ */
+ public static void scheduleUserWorkspaceJob(final IEGitOperation op,
+ String jobName, final Object jobFamily,
+ IJobChangeListener jobChangeListener) {
+ Job job = new WorkspaceJob(jobName) {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ op.execute(monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public boolean belongsTo(Object family) {
+ if (jobFamily != null && family.equals(jobFamily))
+ return true;
+ return super.belongsTo(family);
+ }
+ };
+ job.setRule(op.getSchedulingRule());
+ job.setUser(true);
+ if (jobChangeListener != null)
+ job.addJobChangeListener(jobChangeListener);
+ job.schedule();
+ }
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 9cdc29da4f..b8956adec0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -28,13 +28,13 @@ import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.internal.ConfigurationChecker;
@@ -326,7 +326,8 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
* Refresh projects in repositories that we suspect may have resource
* changes.
*/
- static class ResourceRefreshJob extends Job implements IndexChangedListener {
+ static class ResourceRefreshJob extends WorkspaceJob implements
+ IndexChangedListener {
ResourceRefreshJob() {
super(UIText.Activator_refreshJobName);
@@ -336,7 +337,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
private Set<Repository> repositoriesChanged = new HashSet<Repository>();
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
monitor.beginTask(UIText.Activator_refreshingProjects, projects.length);
@@ -421,7 +422,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
* A Job that looks at the repository meta data and triggers a refresh of
* the resources in the affected projects.
*/
- static class RepositoryChangeScanner extends Job {
+ static class RepositoryChangeScanner extends WorkspaceJob {
RepositoryChangeScanner() {
super(UIText.Activator_repoScanJobName);
}
@@ -436,7 +437,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
}
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
Repository[] repos = org.eclipse.egit.core.Activator.getDefault()
.getRepositoryCache().getAllRepositories();
if (repos.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
index 455e178869..3bbc40c300 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
@@ -15,6 +15,7 @@ package org.eclipse.egit.ui.internal.actions;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -48,9 +49,9 @@ public class DiscardChangesActionHandler extends RepositoryActionHandler {
if (operation == null)
return null;
String jobname = UIText.DiscardChangesAction_discardChanges;
- Job job = new Job(jobname) {
+ Job job = new WorkspaceJob(jobname) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
operation.execute(monitor);
} catch (CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
index 5c00359f8f..8f39b52f32 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
@@ -13,6 +13,7 @@ package org.eclipse.egit.ui.internal.actions;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -59,9 +60,9 @@ public class MergeActionHandler extends RepositoryActionHandler {
op.setSquash(mergeTargetSelectionDialog.isMergeSquash());
op.setFastForwardMode(mergeTargetSelectionDialog.getFastForwardMode());
op.setCommit(mergeTargetSelectionDialog.isCommit());
- Job job = new Job(jobname) {
+ Job job = new WorkspaceJob(jobname) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
} catch (final CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
index b553863a71..307ce2fe7f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
@@ -49,7 +49,8 @@ public class ResetActionHandler extends RepositoryActionHandler {
String jobname = NLS.bind(UIText.ResetAction_reset, refName);
final ResetOperation operation = new ResetOperation(repository,
refName, type);
- JobUtil.scheduleUserJob(operation, jobname, JobFamilies.RESET);
+ JobUtil.scheduleUserWorkspaceJob(operation, jobname,
+ JobFamilies.RESET);
}
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
index ce95977e2e..87ee52e483 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
@@ -16,6 +16,7 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -224,9 +225,10 @@ public class BranchOperationUI {
final BranchOperation bop = new BranchOperation(repository, target,
!restore);
- Job job = new Job(jobname) {
+ Job job = new WorkspaceJob(jobname) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
if (restore) {
final BranchProjectTracker tracker = new BranchProjectTracker(
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/CleanupUncomittedChangesDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/CleanupUncomittedChangesDialog.java
index c4677b0d32..14b8317f17 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/CleanupUncomittedChangesDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/CleanupUncomittedChangesDialog.java
@@ -88,7 +88,8 @@ public class CleanupUncomittedChangesDialog extends MessageDialog {
final ResetOperation operation = new ResetOperation(repository,
Constants.HEAD, ResetType.HARD);
String jobname = NLS.bind(UIText.ResetAction_reset, Constants.HEAD);
- JobUtil.scheduleUserJob(operation, jobname, JobFamilies.RESET);
+ JobUtil.scheduleUserWorkspaceJob(operation, jobname,
+ JobFamilies.RESET);
shouldContinue = true;
break;
case IDialogConstants.SKIP_ID:
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
index 82763bfcb8..6324da1485 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
@@ -25,6 +25,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -346,10 +347,10 @@ public abstract class AbstractGitCloneWizard extends Wizard {
final IWorkingSet[] sets) {
String repoName = Activator.getDefault().getRepositoryUtil()
.getRepositoryName(repository);
- Job importJob = new Job(MessageFormat.format(
+ Job importJob = new WorkspaceJob(MessageFormat.format(
UIText.GitCloneWizard_jobImportProjects, repoName)) {
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
List<File> files = new ArrayList<File>();
ProjectUtil.findProjectFiles(files, repository.getWorkTree(),
true, monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
index 88a7790d4d..5579a31b1f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
@@ -83,7 +83,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
private void startRebaseJob(final RebaseOperation rebase,
final Repository repository, final RebaseCommand.Operation operation) {
- JobUtil.scheduleUserJob(rebase, jobname, JobFamilies.REBASE,
+ JobUtil.scheduleUserWorkspaceJob(rebase, jobname, JobFamilies.REBASE,
new JobChangeAdapter() {
@Override
public void aboutToRun(IJobChangeEvent event) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
index fca9f4a2e5..ae2211af34 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
@@ -19,6 +19,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -64,10 +65,11 @@ public class CherryPickHandler extends SelectionHandler {
final CherryPickOperation op = new CherryPickOperation(repo, commit);
- Job job = new Job(MessageFormat.format(
+ Job job = new WorkspaceJob(MessageFormat.format(
UIText.CherryPickHandler_JobName, commit.name())) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
CherryPickResult cherryPickResult = op.getResult();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
index e370bfea75..e715de16fe 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -55,10 +56,11 @@ public class RevertHandler extends CommitCommandHandler {
final RevertCommitOperation op = new RevertCommitOperation(repo,
commit);
- Job job = new Job(MessageFormat.format(
+ Job job = new WorkspaceJob(MessageFormat.format(
UIText.RevertHandler_JobName, commit.name())) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
RevCommit newHead = op.getNewHead();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
index c0c8bf1891..38436ed02a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
@@ -23,6 +23,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -531,9 +532,11 @@ public class FetchGerritChangePage extends WizardPage {
storeRunInBackgroundSelection();
if (runInBackgroud.getSelection()) {
- Job job = new Job(UIText.FetchGerritChangePage_GetChangeTaskName) {
+ Job job = new WorkspaceJob(
+ UIText.FetchGerritChangePage_GetChangeTaskName) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
internalDoFetch(spec, uri, doCheckout, doCreateTag,
doCreateBranch, doActivateAdditionalRefs,
textForTag, textForBranch, monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
index ac3c5307ed..e3e437b891 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchOperationUI.java
@@ -13,6 +13,7 @@ package org.eclipse.egit.ui.internal.fetch;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -109,10 +110,12 @@ public class FetchOperationUI {
* completion
*/
public void start() {
- Job job = new Job(NLS.bind(UIText.FetchOperationUI_FetchJobName,
+ Job job = new WorkspaceJob(NLS.bind(
+ UIText.FetchOperationUI_FetchJobName,
sourceString)) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
execute(monitor);
} catch (CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java
index d3564a35e2..2c19f54a4e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java
@@ -18,6 +18,7 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -85,9 +86,10 @@ public class MergeHandler extends AbstractHistoryCommandHandler {
}
String jobname = NLS.bind(UIText.MergeAction_JobNameMerge, refName);
final MergeOperation op = new MergeOperation(repository, refName);
- Job job = new Job(jobname) {
+ Job job = new WorkspaceJob(jobname) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
} catch (final CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java
index 6ac1eb5d62..42a19b67b8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java
@@ -62,7 +62,7 @@ public class ResetHandler extends AbstractHistoryCommandHandler {
}
ResetOperation operation = new ResetOperation(repo, commit.getName(), resetType);
- JobUtil.scheduleUserJob(operation, jobName, JobFamilies.RESET);
+ JobUtil.scheduleUserWorkspaceJob(operation, jobName, JobFamilies.RESET);
return null;
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
index ad8de7175a..ac4cd09be0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
@@ -17,6 +17,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -84,9 +85,10 @@ public class PullOperationUI extends JobChangeAdapter {
shortBranchName, repoName);
} else
jobName = UIText.PullOperationUI_PullingMultipleTaskName;
- Job job = new Job(jobName) {
+ Job job = new WorkspaceJob(jobName) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
execute(monitor);
// we always return OK and handle display of errors on our own
return Status.OK_STATUS;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java
index cace701355..384a5f07e4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java
@@ -17,6 +17,7 @@ import java.io.IOException;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -95,9 +96,10 @@ public class MergeCommand extends
}
String jobname = NLS.bind(UIText.MergeAction_JobNameMerge, refName);
- Job job = new Job(jobname) {
+ Job job = new WorkspaceJob(jobname) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
} catch (final CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
index 0eb91a1a5d..334d4a3165 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
@@ -24,6 +24,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -143,13 +144,12 @@ public class RemoveCommand extends
final boolean deleteWorkDir = deleteWorkingDir;
final boolean removeProj = removeProjects;
- Job job = new Job(UIText.RemoveCommand_RemoveRepositoriesJob) {
+ Job job = new WorkspaceJob(UIText.RemoveCommand_RemoveRepositoriesJob) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
- monitor
- .setTaskName(UIText.RepositoriesView_DeleteRepoDeterminProjectsMessage);
+ monitor.setTaskName(UIText.RepositoriesView_DeleteRepoDeterminProjectsMessage);
if (removeProj) {
// confirmed deletion
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java
index 5fbf8d0875..4af1a81c9f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java
@@ -99,8 +99,8 @@ public class ResetCommand extends
final ResetOperation operation = new ResetOperation(
node.getRepository(), targetBranch,
resetType);
- JobUtil.scheduleUserJob(operation, jobname,
- JobFamilies.RESET);
+ JobUtil.scheduleUserWorkspaceJob(operation,
+ jobname, JobFamilies.RESET);
}
});
} catch (InvocationTargetException ite) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java
index b32601784e..f7763522ba 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -46,10 +47,11 @@ public class StashApplyCommand extends
return null;
final StashApplyOperation op = new StashApplyOperation(repo, commit);
- Job job = new Job(MessageFormat.format(
+ Job job = new WorkspaceJob(MessageFormat.format(
UIText.StashApplyCommand_jobTitle, commit.name())) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
} catch (CoreException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java
index 4e9a98bf9d..bc69c9985d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -52,10 +53,11 @@ public class SubmoduleAddCommand extends
final String uri = wizard.getUri().toPrivateASCIIString();
final SubmoduleAddOperation op = new SubmoduleAddOperation(repo,
path, uri);
- Job job = new Job(MessageFormat.format(
+ Job job = new WorkspaceJob(MessageFormat.format(
UIText.SubmoduleAddCommand_JobTitle, path, uri)) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
try {
op.execute(monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java
index be9a5352ef..77fe3ef6a1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java
@@ -16,6 +16,7 @@ import java.util.Map.Entry;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -39,9 +40,10 @@ public class SubmoduleSyncCommand extends
final Map<Repository, List<String>> repoPaths = getSubmodules(getSelectedNodes(event));
if (!repoPaths.isEmpty()) {
- Job job = new Job(UIText.SubmoduleSyncCommand_Title) {
+ Job job = new WorkspaceJob(UIText.SubmoduleSyncCommand_Title) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask("", repoPaths.size()); //$NON-NLS-1$
try {
for (Entry<Repository, List<String>> entry : repoPaths
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java
index 4712c04ca3..b74f38532a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java
@@ -17,6 +17,7 @@ import java.util.Map.Entry;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -40,9 +41,10 @@ public class SubmoduleUpdateCommand extends
final Map<Repository, List<String>> repoPaths = getSubmodules(getSelectedNodes(event));
if (!repoPaths.isEmpty()) {
- Job job = new Job(UIText.SubmoduleUpdateCommand_Title) {
+ Job job = new WorkspaceJob(UIText.SubmoduleUpdateCommand_Title) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask("", repoPaths.size()); //$NON-NLS-1$
try {
for (Entry<Repository, List<String>> entry : repoPaths
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
index 4d7f5037c9..05901962e5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
@@ -18,6 +18,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -56,11 +57,11 @@ public class SynchronizeCommand extends
final boolean includeLocal = getSelectedNodes(event).size() == 1;
final Repository repo = node.getRepository();
- Job job = new Job(NLS.bind(UIText.SynchronizeCommand_jobName,
+ Job job = new WorkspaceJob(NLS.bind(UIText.SynchronizeCommand_jobName,
repo.getDirectory())) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
GitSynchronizeData data;
try {
data = new GitSynchronizeData(repo, secondRefNameParam,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
index 6a39be1b5c..289692434b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
@@ -11,6 +11,7 @@
*****************************************************************************/
package org.eclipse.egit.ui.internal.stash;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -62,9 +63,10 @@ public class StashCreateUI {
message = null;
final StashCreateOperation op = new StashCreateOperation(repo, message);
- Job job = new Job(UIText.StashCreateCommand_jobTitle) {
+ Job job = new WorkspaceJob(UIText.StashCreateCommand_jobTitle) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask("", 1); //$NON-NLS-1$
try {
op.execute(monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
index ae2cfd7f29..970d0d46e2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
@@ -19,6 +19,7 @@ import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
@@ -240,9 +241,11 @@ public class GitModelSynchronize {
final GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
gsdSet);
- Job syncJob = new Job(UIText.GitModelSynchonize_fetchGitDataJobName) {
+ Job syncJob = new WorkspaceJob(
+ UIText.GitModelSynchonize_fetchGitDataJobName) {
+
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
subscriber.init(monitor);
return Status.OK_STATUS;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java
index 4534cbd233..45d340d217 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java
@@ -10,11 +10,11 @@ package org.eclipse.egit.ui.internal.synchronize;
import java.net.URISyntaxException;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.synchronize.dto.GitSynchronizeData;
import org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet;
import org.eclipse.egit.ui.Activator;
@@ -30,7 +30,7 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
-class SynchronizeFetchJob extends Job {
+class SynchronizeFetchJob extends WorkspaceJob {
private final int timeout;
@@ -44,7 +44,7 @@ class SynchronizeFetchJob extends Job {
}
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask(UIText.SynchronizeFetchJob_TaskName, gsdSet.size());
for (GitSynchronizeData gsd : gsdSet) {

Back to the top