Package org.eclipse.jface.wizard
Class ProgressMonitorPart
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.jface.wizard.ProgressMonitorPart
- All Implemented Interfaces:
- IProgressMonitor,- IProgressMonitorWithBlocking,- Drawable
A standard implementation of an IProgressMonitor. It consists
 of a label displaying the task and subtask name, and a
 progress indicator to show progress. In contrast to
 
ProgressMonitorDialog this class only implements
 IProgressMonitor.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected IStatuscurrent blocked statusprotected Controlthe cancel componentprotected Listenerthe cancel lister attached to the cancel componentprotected booleantrue if canceledprotected Labelthe labelprotected ProgressIndicatorthe progress indicatorprotected Stringthe current sub task nameprotected Stringthe current task nameFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoomFields inherited from interface org.eclipse.core.runtime.IProgressMonitorUNKNOWN
- 
Constructor SummaryConstructorsConstructorDescriptionProgressMonitorPart(Composite parent, Layout layout) Creates aProgressMonitorPartthat does not provide a stop button.ProgressMonitorPart(Composite parent, Layout layout, boolean createStopButton) Creates aProgressMonitorPart.ProgressMonitorPart(Composite parent, Layout layout, int progressIndicatorHeight) Creates aProgressMonitorPartthat does not provide a stop button.
- 
Method SummaryModifier and TypeMethodDescriptionvoidattachToCancelComponent(Control cancelComponent) Attaches the progress monitor part to the given cancel component.voidNotifies that the main task is beginning.voidClears the blocked state of the running operation.voiddone()Notifies that the work is done; that is, either the main task is completed or the user canceled it.protected static StringEscapes 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 voidinitialize(Layout layout, int progressIndicatorHeight) Creates the progress monitor's UI parts and layouts them according to the given layout.voidinternalWorked(double work) Internal method to handle scaling correctly.booleanReturns whether cancelation of current operation has been requested.protected voidEnqueues a label update for asynchronous execution.voidremoveFromCancelComponent(Control cancelComponent) Detach the progress monitor part from the given cancel component.voidsetBlocked(IStatus reason) Indicates that this operation is blocked by some background activity.voidsetCanceled(boolean b) Sets the cancel state to the given value.voidSets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.voidsetTaskName(String name) Sets the task name to the given value.voidNotifies that a subtask of the main task is beginning.protected voidUpdates the label with the current task and subtask names.voidworked(int work) Notifies that a given number of work unit of the main task has been completed.Methods inherited from class org.eclipse.swt.widgets.Compositechanged, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.DrawableisAutoScalableMethods inherited from interface org.eclipse.core.runtime.IProgressMonitorslice
- 
Field Details- 
fLabelthe label
- 
fTaskNamethe current task name
- 
fSubTaskNamethe current sub task name
- 
fProgressIndicatorthe progress indicator
- 
fCancelComponentthe cancel component
- 
fIsCanceledprotected volatile boolean fIsCanceledtrue if canceled
- 
blockedStatuscurrent blocked status
- 
fCancelListenerthe cancel lister attached to the cancel component
 
- 
- 
Constructor Details- 
ProgressMonitorPartCreates aProgressMonitorPartthat does not provide a stop button.- Parameters:
- parent- The SWT parent of the part.
- layout- The SWT grid layout used by the part. A client can supply the layout to control how the progress monitor part is laid out. If- nullis passed the part uses its default layout.
 
- 
ProgressMonitorPartCreates aProgressMonitorPartthat does not provide a stop button.- Parameters:
- parent- The SWT parent of the part.
- layout- The SWT grid layout used by the part. A client can supply the layout to control how the progress monitor part is laid out. If- nullis passed the part uses its default layout.
- progressIndicatorHeight- The height of the progress indicator in pixels. This value may be SWT.DEFAULT in order to get the default height as calculated by the widget and its layout.
 
- 
ProgressMonitorPartCreates aProgressMonitorPart.- Parameters:
- parent- the SWT parent of the part
- layout- the SWT grid layout used by the part. A client can supply the layout to control how the progress monitor part is laid out. If- nullis passed the part uses its default layout.
- createStopButton-- trueif the progress indicator should include a stop button that can be used to cancel any currently running task, and- falseif no such stop button should be created.
- Since:
- 3.6
 
 
- 
- 
Method Details- 
attachToCancelComponentAttaches the progress monitor part to the given cancel component.- Parameters:
- cancelComponent- the control whose selection will trigger a cancel. This parameter will be ignored and hence can be- nullif a stop button was requested upon construction and instead the stop button will enabled and serve as the cancel component.
- See Also:
 
- 
beginTaskDescription copied from interface:IProgressMonitorNotifies that the main task is beginning. This must only be called once on a given progress monitor instance.- Specified by:
- beginTaskin interface- IProgressMonitor
- Parameters:
- name- the name (or description) of the main task
- totalWork- the total number of work units into which the main task is been subdivided. If the value is- UNKNOWNthe implementation is free to indicate progress in a way which doesn't require the total number of work units in advance.
 
- 
donepublic void done()Description copied from interface:IProgressMonitorNotifies that the work is done; that is, either the main task is completed or the user canceled it. This method may be called more than once (implementations should be prepared to handle this case).- Specified by:
- donein interface- IProgressMonitor
 
- 
escapeMetaCharactersEscapes any occurrence of '&' in the given String so that it is not considered as a mnemonic character in SWT ToolItems, MenuItems, Button and Labels.- Parameters:
- in- the original String
- Returns:
- The converted String
 
- 
initializeCreates the progress monitor's UI parts and layouts them according to the given layout. If the layout isnullthe part's default layout is used.- Parameters:
- layout- The layout for the receiver.
- progressIndicatorHeight- The suggested height of the indicator
 
- 
internalWorkedpublic void internalWorked(double work) Description copied from interface:IProgressMonitorInternal method to handle scaling correctly. This method must not be called by a client. Clients should always use the methodworked(int).- Specified by:
- internalWorkedin interface- IProgressMonitor
- Parameters:
- work- the amount of work done
 
- 
isCanceledpublic boolean isCanceled()Description copied from interface:IProgressMonitorReturns whether cancelation of current operation has been requested. Long-running operations should poll to see if cancelation has been requested.- Specified by:
- isCanceledin interface- IProgressMonitor
- Returns:
- trueif cancellation has been requested, and- falseotherwise
- See Also:
 
- 
removeFromCancelComponentDetach the progress monitor part from the given cancel component.- Parameters:
- cancelComponent- the control that was previously used as a cancel component. This parameter will be ignored and hence can be- nullif a stop button was requested upon construction and instead the stop button will be disabled.
- See Also:
 
- 
setCanceledpublic void setCanceled(boolean b) Description copied from interface:IProgressMonitorSets the cancel state to the given value.- Specified by:
- setCanceledin interface- IProgressMonitor
- Parameters:
- b-- trueindicates that cancelation has been requested (but not necessarily acknowledged);- falseclears this flag
- See Also:
 
- 
setFontDescription copied from class:ControlSets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
- 
setTaskNameDescription copied from interface:IProgressMonitorSets the task name to the given value. This method is used to restore the task label after a nested operation was executed. Normally there is no need for clients to call this method.- Specified by:
- setTaskNamein interface- IProgressMonitor
- Parameters:
- name- the name (or description) of the main task
- See Also:
 
- 
subTaskDescription copied from interface:IProgressMonitorNotifies that a subtask of the main task is beginning. Subtasks are optional; the main task might not have subtasks.- Specified by:
- subTaskin interface- IProgressMonitor
- Parameters:
- name- the name (or description) of the subtask
 
- 
queueUpdateLabelprotected void queueUpdateLabel()Enqueues a label update for asynchronous execution. The update is performed throttled to 100ms, i.e. updates within the throttle range are not displayed.- Since:
- 3.14
 
- 
updateLabelprotected void updateLabel()Updates the label with the current task and subtask names.
- 
workedpublic void worked(int work) Description copied from interface:IProgressMonitorNotifies that a given number of work unit of the main task has been completed. Note that this amount represents an installment, as opposed to a cumulative amount of work done to date.- Specified by:
- workedin interface- IProgressMonitor
- Parameters:
- work- a non-negative number of work units just completed
 
- 
clearBlockedpublic void clearBlocked()Description copied from interface:IProgressMonitorClears the blocked state of the running operation. If a running operation ever callssetBlocked, it must eventually callclearBlockedbefore the operation completes.- Specified by:
- clearBlockedin interface- IProgressMonitor
- See Also:
 
- 
setBlockedDescription copied from interface:IProgressMonitorIndicates that this operation is blocked by some background activity. If a running operation ever callssetBlocked, it must eventually callclearBlockedbefore the operation completes.If the caller is blocked by a currently executing job, this method will return an IJobStatusindicating the job that is currently blocking the caller. If this blocking job is not known, this method will return a plain informationalIStatusobject.- Specified by:
- setBlockedin interface- IProgressMonitor
- Parameters:
- reason- an optional status object whose message describes the reason why this operation is blocked, or- nullif this information is not available.
- See Also:
 
 
-