Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-02-27 02:52:12 +0000
committerJean Michel-Lemieux2004-02-27 02:52:12 +0000
commit6366302e5c3738a42d4e84e9287c7e0535aa1fc3 (patch)
tree4a65d2329ba752d7559fa03d3ac0e76d75699460
parent8e57daa1c3d4e8e45658d1ad6822c193feff0590 (diff)
downloadeclipse.platform.team-6366302e5c3738a42d4e84e9287c7e0535aa1fc3.tar.gz
eclipse.platform.team-6366302e5c3738a42d4e84e9287c7e0535aa1fc3.tar.xz
eclipse.platform.team-6366302e5c3738a42d4e84e9287c7e0535aa1fc3.zip
Removed job busy cursor and instead using the view site progress manager.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java116
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java41
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java28
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/JobBusyCursor.java83
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java40
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java32
6 files changed, 133 insertions, 207 deletions
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 76cc66ab9..40597fc31 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
@@ -16,37 +16,91 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+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.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.*;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ccvs.core.*;
+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.CVSTag;
+import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
+import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.ILogEntry;
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.actions.*;
-import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
+import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
+import org.eclipse.team.internal.ccvs.ui.actions.MoveRemoteTagAction;
+import org.eclipse.team.internal.ccvs.ui.actions.OpenLogEntryAction;
+import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.synchronize.viewers.SyncInfoCompareInput;
-import org.eclipse.ui.*;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
/**
@@ -86,7 +140,6 @@ public class HistoryView extends ViewPart {
private IPreferenceStore settings;
private FetchLogEntriesJob fetchLogEntriesJob;
- private JobBusyCursor halfBusyCursor;
private boolean shutdown = false;
@@ -384,7 +437,6 @@ public class HistoryView extends ViewPart {
contributeActions();
setViewerVisibility();
- halfBusyCursor = new JobBusyCursor(parent);
// set F1 help
WorkbenchHelp.setHelp(sashForm, IHelpContextIds.RESOURCE_HISTORY_VIEW);
@@ -431,7 +483,7 @@ public class HistoryView extends ViewPart {
}
}
fetchLogEntriesJob.setRemoteFile(remoteFile);
- schedule(fetchLogEntriesJob);
+ Utils.schedule(fetchLogEntriesJob, getViewSite());
return new Object[0];
}
public void dispose() {
@@ -539,7 +591,6 @@ public class HistoryView extends ViewPart {
}
}
}
- halfBusyCursor.dispose();
getSite().getPage().removePartListener(partListener);
getSite().getPage().removePartListener(partListener2);
}
@@ -844,33 +895,4 @@ public class HistoryView extends ViewPart {
private boolean isLinkingEnabled() {
return linkingEnabled;
}
-
-
- private void schedule(Job job) {
- IViewSite site = getViewSite();
- if(site != null) {
- IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService)getViewSite().getAdapter(IWorkbenchSiteProgressService.class);
- if(siteProgress != null) {
- siteProgress.schedule(job);
- return;
- }
- }
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#getJobChangeListener()
- * Temporary until the following bug is fixed:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51991
- */
- public IJobChangeListener getJobChangeListener() {
- return new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- halfBusyCursor.finished();
- }
- public void running(IJobChangeEvent event) {
- halfBusyCursor.started();
- }
- };
- }
}
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 de47eea72..83e5bafb6 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
@@ -11,27 +11,46 @@
package org.eclipse.team.internal.ui;
import java.lang.reflect.InvocationTargetException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.ResourceBundle;
+import java.util.Set;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.*;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.IResourceVariant;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeModelElement;
-import org.eclipse.ui.*;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
public class Utils {
@@ -439,4 +458,16 @@ public class Utils {
}
}
}
+
+ public static void schedule(Job job, IWorkbenchSite site) {
+ if (site != null) {
+ IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService) site.getAdapter(IWorkbenchSiteProgressService.class);
+ if (siteProgress != null) {
+ siteProgress.useHalfBusyCursor(job);
+ siteProgress.schedule(job);
+ return;
+ }
+ }
+ job.schedule();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
index bca21a756..3eebe1a5b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/JobRunnableContext.java
@@ -13,14 +13,21 @@ package org.eclipse.team.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.*;
+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.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
-import org.eclipse.ui.*;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
/**
* This runnable context executes it's operation in the context of a background job.
@@ -82,18 +89,7 @@ public class JobRunnableContext implements ITeamRunnableContext {
if (listener != null) {
job.addJobChangeListener(listener);
}
- schedule(job, site);
- }
-
- private void schedule(Job job, IWorkbenchSite site) {
- if (site != null) {
- IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService) site.getAdapter(IWorkbenchSiteProgressService.class);
- if (siteProgress != null) {
- siteProgress.schedule(job);
- return;
- }
- }
- job.schedule();
+ Utils.schedule(job, site);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/JobBusyCursor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/JobBusyCursor.java
deleted file mode 100644
index f29974b31..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/JobBusyCursor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.jobs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.*;
-
-/**
- * This is temporary until the UI adds support for this directly into views.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51991
- */
-public class JobBusyCursor {
-
- private Composite composite;
- private Cursor waitCursor;
-
- public JobBusyCursor(Composite composite) {
- this.composite = composite;
- }
-
- private Cursor getWaitCursor() {
- if (waitCursor == null) {
- Display display = Display.getCurrent();
- if (display == null) {
- display = Display.getDefault();
- }
- waitCursor = new Cursor(display, SWT.CURSOR_APPSTARTING);
- }
- return waitCursor;
- }
-
- private void showCursor(final Cursor cursor) {
- if (getComposite() == null || (cursor != null && cursor.isDisposed())) return;
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- synchronized (this) {
- if (cursor != null && cursor.isDisposed()) return;
- setCursorDeep(cursor, getComposite());
- }
- }
- });
- }
-
- private void setCursorDeep(Cursor cursor, Control control) {
- if (control != null && !control.isDisposed()) {
- control.setCursor(cursor);
- if(control instanceof Composite) {
- Composite composite = (Composite)control;
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- setCursorDeep(cursor, children[i]);
- }
- }
- }
- }
-
- public synchronized void dispose() {
- if (waitCursor != null) {
- waitCursor.dispose();
- }
- }
-
- public void started() {
- showCursor(getWaitCursor());
- }
-
- public void finished() {
- showCursor(null);
- }
-
- public Composite getComposite() {
- return composite;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
index 58e036004..bc8fcab53 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ui.synchronize;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.jobs.*;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -22,12 +21,18 @@ import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
import org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.*;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.ui.part.IPageBookViewPage;
+import org.eclipse.ui.part.MessagePage;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageBookView;
/**
* Implements a Synchronize View that contains multiple synchronize participants.
@@ -55,11 +60,6 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
private SynchronizePageDropDownAction fPageDropDown;
/**
- * Half-busy cursor support
- */
- private JobBusyCursor halfBusyCursor;
-
- /**
* Preference key to save
*/
private static final String KEY_LAST_ACTIVE_PARTICIPANT = "lastactiveparticipant"; //$NON-NLS-1$
@@ -173,11 +173,8 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
}
section.put(KEY_LAST_ACTIVE_PARTICIPANT, activeParticipant.getId());
}
-
-
- halfBusyCursor.dispose();
- TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
-
+
+ TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
}
/* (non-Javadoc)
@@ -307,7 +304,6 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
createActions();
IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
configureToolBar(tbm);
- halfBusyCursor = new JobBusyCursor(parent);
updateForExistingParticipants();
getViewSite().getActionBars().updateActionBars();
updateTitle();
@@ -345,18 +341,4 @@ public class SynchronizeView extends PageBookView implements ISynchronizeView, I
private boolean isAvailable() {
return getPageBook() != null && !getPageBook().isDisposed();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#getJobChangeListener()
- */
- public IJobChangeListener getJobChangeListener() {
- return new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- halfBusyCursor.finished();
- }
- public void running(IJobChangeEvent event) {
- halfBusyCursor.started();
- }
- };
- }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
index fa9c8c6a9..a3b999a5a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
@@ -11,18 +11,17 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.*;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
/**
* A general refresh action that will refresh a subscriber in the background.
@@ -64,18 +63,8 @@ public class RefreshAction extends Action {
RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", description), resources, collector); //$NON-NLS-1$
if (listener != null) {
RefreshSubscriberJob.addRefreshListener(listener);
- }
- IProgressMonitor group = Platform.getJobManager().createProgressGroup();
- group.beginTask("Refreshing " + description, 100);
- job.setProgressGroup(group, 70);
- collector.setProgressGroup(group, 30);
-
- schedule(job, site);
- job.addJobChangeListener(new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- collector.setProgressGroup(null, 0);
- }
- });
+ }
+ Utils.schedule(job, site);
}
public void setWorkbenchSite(IWorkbenchSite part) {
@@ -85,15 +74,4 @@ public class RefreshAction extends Action {
public IWorkbenchSite getWorkbenchSite() {
return workbenchSite;
}
-
- private static void schedule(Job job, IWorkbenchSite site) {
- if(site == null) {
- job.schedule();
- return;
- }
- IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService) site.getAdapter(IWorkbenchSiteProgressService.class);
- if (siteProgress != null) {
- siteProgress.schedule(job);
- }
- }
}

Back to the top