public abstract class ActionWithProgress extends AbstractAction
| Modifier and Type | Field and Description |
|---|---|
protected List<AbstractAction> |
connectedActions |
protected Component |
parent |
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
ActionWithProgress(Component parent,
String progressTitle,
int total,
boolean indeterminate)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent event) |
void |
addConnectedAction(AbstractAction action) |
abstract void |
backGroundWork(ProgressMonitor monitor)
Implements here the heavy work to be done.
|
void |
onError(Exception e)
Called if an error occurrs.
|
void |
postWork()
This is run once the heavy work is done and the button of the action has been enabled again.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledprotected Component parent
protected List<AbstractAction> connectedActions
public ActionWithProgress(Component parent, String progressTitle, int total, boolean indeterminate)
parent - the parent component.progressTitle - the initial title of the progress.total - the total count of work.indeterminate - if true, the dialog is indeterminate.public void actionPerformed(ActionEvent event)
public abstract void backGroundWork(ProgressMonitor monitor) throws Exception
monitor - the monitor that can be used to update the user.Exceptionpublic void postWork()
throws Exception
Exceptionpublic void addConnectedAction(AbstractAction action)
public void onError(Exception e)
e - the exception thrown.Copyright © 2005-2019 HydroloGIS. All Rights Reserved.