|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The IProgressManager is an interface to the progress manager provided by the workbench. NOTE This interface is not intended to be implemented by other plug-ins.
IWorkbench.getProgressService()
Method Summary | |
---|---|
void |
busyCursorWhile(IRunnableWithProgress runnable)
Set the cursor to busy and run the runnable in a non-UI Thread. |
Image |
getIconFor(Job job)
Get the icon that has been registered for a Job by checking if the job belongs to any of the registered families. |
int |
getLongOperationTime()
The time at which an operation becomes considered a long operation. |
void |
registerIconForFamily(ImageDescriptor icon,
Object family)
Register the ImageDescriptor to be the icon used for all jobs that belong to family within the workbench. |
void |
runInUI(IRunnableContext context,
IRunnableWithProgress runnable,
ISchedulingRule rule)
Runs the given operation in the UI thread using the given runnable context. |
void |
showInDialog(Shell shell,
Job job)
Open a dialog on job when it starts to run and close it when the job is finished. |
Methods inherited from interface org.eclipse.jface.operation.IRunnableContext |
---|
run |
Method Detail |
public int getLongOperationTime()
busyCursorWhile(IRunnableWithProgress)
public void registerIconForFamily(ImageDescriptor icon, Object family)
icon
- ImageDescriptor that will be used when the job is being displayedfamily
- The family to associate withJob.belongsTo(Object)
public void runInUI(IRunnableContext context, IRunnableWithProgress runnable, ISchedulingRule rule) throws InvocationTargetException, InterruptedException
This method can act as a wrapper for uses of IRunnableContext where the fork parameter was false.
Note: Running long operations in the UI thread is generally not recommended. This can result in the UI becoming unresponsive for the duration of the operation. Where possible, busyCursorWhile should be used instead.
Modal dialogs should also be avoided in the runnable as there will already be a modal progress dialog open when this operation runs.
context
- The runnable context to run the operation inrunnable
- The operation to runrule
- A scheduling rule, or null
InvocationTargetException
- wraps any exception or error which occurs
while running the runnable
InterruptedException
- propagated by the context if the runnable
acknowledges cancelation by throwing this exception.Dialog
,
SWT.APPLICATION_MODAL
public Image getIconFor(Job job)
job
-
null
if there isn't one.registerIconForFamily(ImageDescriptor,Object)
public void busyCursorWhile(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException
getLongOperationTime()
replace it with
a ProgressMonitorDialog so that the user may cancel.
Do not open the ProgressMonitorDialog if there is already a modal
dialog open.
runnable
- The runnable to execute and show the progress for.
InvocationTargetException
InterruptedException
getLongOperationTime()
public void showInDialog(Shell shell, Job job)
shell
- The Shell to parent the dialog from or
null
if the active shell is to be used.job
- The Job that will be reported in the dialog. job
must not be null
.
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.