public class ProgressMonitorPart extends Composite implements IProgressMonitorWithBlocking
ProgressMonitorDialog this class only implements
IProgressMonitor.| Modifier and Type | Field and Description |
|---|---|
protected IStatus |
blockedStatus |
protected Control |
fCancelComponent |
protected Listener |
fCancelListener |
protected boolean |
fIsCanceled |
protected Label |
fLabel |
protected ProgressIndicator |
fProgressIndicator |
protected String |
fSubTaskName |
protected String |
fTaskName |
UNKNOWN| Constructor and Description |
|---|
ProgressMonitorPart(Composite parent,
Layout layout)
Creates a ProgressMonitorPart.
|
ProgressMonitorPart(Composite parent,
Layout layout,
int progressIndicatorHeight)
Creates a ProgressMonitorPart.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachToCancelComponent(Control cancelComponent)
Attaches the progress monitor part to the given cancel
component.
|
void |
beginTask(String name,
int totalWork)
Implements
IProgressMonitor.beginTask. |
void |
clearBlocked()
Clears the blocked state of the running operation.
|
void |
done()
Implements
IProgressMonitor.done. |
protected static String |
escapeMetaCharacters(String in)
Escapes any occurrence of '&' in the given String so that
it is not considered as a mnemonic
character in SWT ToolItems, MenuItems, Button and Labels.
|
protected void |
initialize(Layout layout,
int progressIndicatorHeight)
Creates the progress monitor's UI parts and layouts them
according to the given layout.
|
void |
internalWorked(double work)
Implements
IProgressMonitor.internalWorked. |
boolean |
isCanceled()
Implements
IProgressMonitor.isCanceled. |
void |
removeFromCancelComponent(Control cc)
Detach the progress monitor part from the given cancel
component
|
void |
setBlocked(IStatus reason)
Indicates that this operation is blocked by some background activity.
|
void |
setCanceled(boolean b)
Implements
IProgressMonitor.setCanceled. |
void |
setFont(Font font)
Sets the progress monitor part's font.
|
void |
setTaskName(String name)
Sets the task name to the given value.
|
void |
subTask(String name)
Notifies that a subtask of the main task is beginning.
|
protected void |
updateLabel()
Updates the label with the current task and subtask names.
|
void |
worked(int work)
Implements
IProgressMonitor.worked. |
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListcomputeTrim, getClientArea, getHorizontalBar, getVerticalBaraddControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, updateaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toStringprotected Label fLabel
protected String fTaskName
protected String fSubTaskName
protected ProgressIndicator fProgressIndicator
protected Control fCancelComponent
protected boolean fIsCanceled
protected IStatus blockedStatus
protected Listener fCancelListener
public ProgressMonitorPart(Composite parent, Layout layout)
parent - The SWT parent of the part.layout - The SWT grid bag layout used by the part. A client
can supply the layout to control how the progress monitor part
is layed out. If null is passed the part uses its default layout.public ProgressMonitorPart(Composite parent, Layout layout, int progressIndicatorHeight)
parent - The SWT parent of the part.layout - The SWT grid bag layout used by the part. A client
can supply the layout to control how the progress monitor part
is layed out. If null is passed the part uses its default layout.progressIndicatorHeight - The height of the progress indicator in pixel.public void attachToCancelComponent(Control cancelComponent)
cancelComponent - the control whose selection will
trigger a cancelpublic void beginTask(String name, int totalWork)
IProgressMonitor.beginTask.beginTask in interface IProgressMonitorname - the name (or description) of the main tasktotalWork - the total number of work units into which
the main task is been subdivided. If the value is UNKNOWN
the implementation is free to indicate progress in a way which
doesn't require the total number of work units in advance.IProgressMonitor.beginTask(java.lang.String, int)public void done()
IProgressMonitor.done.done in interface IProgressMonitorIProgressMonitor.done()protected static String escapeMetaCharacters(String in)
in - the original Stringprotected void initialize(Layout layout, int progressIndicatorHeight)
null
the part's default layout is used.layout - The layoutfor the receiver.progressIndicatorHeight - The suggested height of the indicatorpublic void internalWorked(double work)
IProgressMonitor.internalWorked.internalWorked in interface IProgressMonitorwork - the amount of work doneIProgressMonitor.internalWorked(double)public boolean isCanceled()
IProgressMonitor.isCanceled.isCanceled in interface IProgressMonitortrue if cancellation has been requested,
and false otherwiseIProgressMonitor.isCanceled()public void removeFromCancelComponent(Control cc)
cc - public void setCanceled(boolean b)
IProgressMonitor.setCanceled.setCanceled in interface IProgressMonitorb - true indicates that cancelation has
been requested (but not necessarily acknowledged);
false clears this flagIProgressMonitor.setCanceled(boolean)public void setFont(Font font)
public void setTaskName(String name)
IProgressMonitorsetTaskName in interface IProgressMonitorname - the name (or description) of the main taskIProgressMonitor.beginTask(java.lang.String, int)public void subTask(String name)
IProgressMonitorsubTask in interface IProgressMonitorname - the name (or description) of the subtaskprotected void updateLabel()
public void worked(int work)
IProgressMonitor.worked.worked in interface IProgressMonitorwork - the number of work units just completedIProgressMonitor.worked(int)public void clearBlocked()
IProgressMonitorWithBlockingsetBlocked, it must eventually call
clearBlocked before the operation completes.clearBlocked in interface IProgressMonitorWithBlockingIProgressMonitorWithBlocking.setBlocked(IStatus)public void setBlocked(IStatus reason)
IProgressMonitorWithBlockingsetBlocked, it must
eventually call clearBlocked before the operation
completes.
If the caller is blocked by a currently executing job, this method will return
an IJobStatus indicating the job that is currently blocking
the caller. If this blocking job is not known, this method will return a plain
informational IStatus object.
setBlocked in interface IProgressMonitorWithBlockingreason - an optional status object whose message describes the
reason why this operation is blocked, or null if this
information is not available.IProgressMonitorWithBlocking.clearBlocked(),
IJobStatusGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.