|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.richclient.application.support.ApplicationServicesAccessor
org.springframework.richclient.factory.AbstractControlFactory
org.springframework.richclient.application.statusbar.support.StatusBarProgressMonitor
public class StatusBarProgressMonitor
ProgressMonitor implementation that handles its own controls:
JProgressBar to show the progress to the userJButton to allow the user to cancel the
current task
Initally the progress bar and button are hidden, and shown when a task is
running longer than the delayProgress property (default is 500
ms).
| Field Summary | |
|---|---|
static int |
DEFAULT_DELAY_PROGRESS
Progress bar creation is delayed by this ms |
static int |
UNKNOWN
|
| Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
|---|
logger |
| Constructor Summary | |
|---|---|
StatusBarProgressMonitor()
|
|
| Method Summary | |
|---|---|
protected JButton |
createCancelButton()
|
protected JComponent |
createControl()
Subclasses must override this method to create a new instance of the control that this factory produces. |
protected JProgressBar |
createProgressBar()
|
void |
done()
Notifies that the work is done; that is, either the main task is completed or the user cancelled it. |
Icon |
getCancelIcon()
|
protected JProgressBar |
getProgressBar()
|
protected void |
hideProgress()
|
boolean |
isCanceled()
Returns true if the user does some UI action to cancel this operation. |
void |
setCanceled(boolean b)
Attempts to cancel the monitored task. |
void |
setCancelEnabled(boolean enabled)
|
void |
setCancelIcon(Icon icon)
|
void |
setDelayProgress(int delayProgress)
|
void |
subTaskStarted(String name)
Notifies that a subtask of the main task is beginning. |
void |
taskStarted(String name,
int totalWork)
Notifies that the main task is beginning. |
void |
worked(int work)
Notifies that a percentage of the work has been completed. |
| Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory |
|---|
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton |
| Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
|---|
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_DELAY_PROGRESS
public static final int UNKNOWN
| Constructor Detail |
|---|
public StatusBarProgressMonitor()
| Method Detail |
|---|
protected JButton createCancelButton()
protected JComponent createControl()
AbstractControlFactory
createControl in class AbstractControlFactoryprotected JProgressBar createProgressBar()
public void done()
ProgressMonitor
done in interface ProgressMonitorpublic Icon getCancelIcon()
protected JProgressBar getProgressBar()
protected void hideProgress()
public boolean isCanceled()
ProgressMonitor
isCanceled in interface ProgressMonitorpublic void setCanceled(boolean b)
ProgressMonitor
setCanceled in interface ProgressMonitorpublic void setCancelEnabled(boolean enabled)
public void setCancelIcon(Icon icon)
public void subTaskStarted(String name)
ProgressMonitor
subTaskStarted in interface ProgressMonitorname - the name (or description) of the subtask
public void taskStarted(String name,
int totalWork)
ProgressMonitor
taskStarted in interface ProgressMonitorname - 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 0 or UNKNOWN the
implemenation is free to indicate progress in a way which
doesn't require the total number of work units in advance. In
general users should use the UNKNOWN value if they don't know
the total amount of work units.public void worked(int work)
ProgressMonitor
worked in interface ProgressMonitorwork - the percentage complete (0..100)public void setDelayProgress(int delayProgress)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||