public class ProgressDialog<T> extends JDialog implements ComponentListener, ProgressComponent.Listener<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
ProgressDialog.Option |
JDialog.AccessibleJDialogDialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static ProgressDialog.Option |
NO_FOCUS_STEALING
Option to pass to prevent the popup that opens while the task is running
to display its progress, from stealing the keyboard focus.
|
static ProgressDialog.Option |
NOT_CANCELABLE
Option to pass to make the Cancel button inactive, forcing the user to
wait until the task is completed.
|
accessibleContext, rootPane, rootPaneCheckingEnabledDEFAULT_MODALITY_TYPEBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ProgressDialog(Window parent,
ProgressTask<T> task,
ProgressDialog.Option... options)
Creates new form ProgressDialog.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelled() |
void |
componentHidden(ComponentEvent e) |
void |
componentMoved(ComponentEvent e) |
void |
componentResized(ComponentEvent e) |
void |
componentShown(ComponentEvent e) |
void |
done(T result) |
void |
exceptionThrown(Throwable exception) |
static <T> T |
executeTask(Window parent,
ProgressTask<T> task,
ProgressDialog.Option... options)
Execute a task in the background with progress reporting via a modal
dialog with a progress bar.
|
static <T> T |
executeTask(Window parent,
String name,
Callable<T> task,
ProgressDialog.Option... options)
Execute a task in the background with progress reporting via a modal
dialog with a progress bar.
|
void |
setVisible(boolean b)
When invoked with
true, displays the dialog and starts the
configured ProgressTask in a background thread, then blocks until
the task has completed and the dialog is disposed of. |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final ProgressDialog.Option NOT_CANCELABLE
public static final ProgressDialog.Option NO_FOCUS_STEALING
public ProgressDialog(Window parent, ProgressTask<T> task, ProgressDialog.Option... options)
parent - The parent window for the modal dialog.task - The task to execute.options - Optional modifiers to change the behaviour. See
NOT_CANCELABLE and NO_FOCUS_STEALING.public void setVisible(boolean b)
true, displays the dialog and starts the
configured ProgressTask in a background thread, then blocks until
the task has completed and the dialog is disposed of. Events are
dispatched while this method is blocked.setVisible in class Dialogb - true to show the dialog and start the task in a
background thread.public static <T> T executeTask(Window parent, ProgressTask<T> task, ProgressDialog.Option... options)
By default the Cancel button is enabled and the popup will steal the
keyboard focus. Use one or more of the NOT_CANCELABLE and
NO_FOCUS_STEALING options to modify this.
T - The return type of the task. Use Void for tasks which
don't return a value.parent - The parent window for the modal dialog.task - The task to execute.options - Optional modifiers to change the behaviour. See
NOT_CANCELABLE and NO_FOCUS_STEALING.null if the task does not
return a result or if it was cancelled.Error - If the task threw an Error.RuntimeException - If the task threw a RuntimeException.public static <T> T executeTask(Window parent, String name, Callable<T> task, ProgressDialog.Option... options)
By default the Cancel button is enabled and the popup will steal the
keyboard focus. Use one or more of the NOT_CANCELABLE and
NO_FOCUS_STEALING options to modify this.
T - The return type of the task. Use Void for tasks which
don't return a value.parent - The parent window for the modal dialog.name - The name of the task to execute. Will be displayed to the
user.task - The task to execute.options - Optional modifiers to change the behaviour. See
NOT_CANCELABLE and NO_FOCUS_STEALING.null if the task does not
return a result or if it was cancelled.Error - If the task threw an Error.RuntimeException - If the task threw a RuntimeException.public void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void exceptionThrown(Throwable exception)
exceptionThrown in interface ProgressComponent.Listener<T>public void done(T result)
done in interface ProgressComponent.Listener<T>public void cancelled()
cancelled in interface ProgressComponent.Listener<T>Copyright © 2011–2023 pepsoft.org. All rights reserved.