public class DelegatingProgressIndicator extends java.lang.Object implements WrappedProgressIndicator, StandardProgressIndicator
Constructor and Description |
---|
DelegatingProgressIndicator() |
DelegatingProgressIndicator(ProgressIndicator indicator) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the current process.
|
void |
checkCanceled()
Usually invoked in the thread associated with this indicator, used to check if the computation performed by this thread
has been canceled, and, if yes, stop it immediately (by throwing an exception).
|
void |
finishNonCancelableSection() |
protected ProgressIndicator |
getDelegate() |
double |
getFraction() |
ModalityState |
getModalityState() |
ProgressIndicator |
getOriginalProgressIndicator() |
java.lang.String |
getText() |
java.lang.String |
getText2() |
boolean |
isCanceled() |
boolean |
isIndeterminate() |
boolean |
isModal() |
boolean |
isPopupWasShown() |
boolean |
isRunning() |
boolean |
isShowing() |
void |
popState() |
void |
pushState() |
void |
setFraction(double fraction)
Sets the fraction: a number between 0.0 and 1.0 reflecting the ratio of work that has already be done (0.0 for nothing, 1.0 for all).
|
void |
setIndeterminate(boolean indeterminate)
Marks the progress indeterminate (for processes that can't estimate the amount of work to be done) or determinate (for processes
that can display the fraction of the work done using
ProgressIndicator.setFraction(double) ). |
void |
setModalityProgress(ProgressIndicator modalityProgress)
In many implementations, grants to this progress indicator its own modality state.
|
void |
setText(java.lang.String text)
Sets text above the progress bar
|
void |
setText2(java.lang.String text)
Sets text under the progress bar
|
void |
start()
Marks the process as started.
|
void |
startNonCancelableSection() |
void |
stop()
Marks the process as finished.
|
public DelegatingProgressIndicator(ProgressIndicator indicator)
public DelegatingProgressIndicator()
public void start()
ProgressIndicator
ProgressManager
internals, shouldn't be called from client code
unless you know what you're doing.start
in interface ProgressIndicator
public void stop()
ProgressIndicator
ProgressManager
internals, shouldn't be called from client code
unless you know what you're doing.stop
in interface ProgressIndicator
public boolean isRunning()
isRunning
in interface ProgressIndicator
public final void cancel()
ProgressIndicator
cancel
in interface ProgressIndicator
public final boolean isCanceled()
isCanceled
in interface ProgressIndicator
ProgressIndicator.checkCanceled()
is called instead.ProgressIndicator.cancel()
public void setText(java.lang.String text)
ProgressIndicator
setText
in interface ProgressIndicator
text
- Text to setProgressIndicator.setText2(String)
public java.lang.String getText()
getText
in interface ProgressIndicator
ProgressIndicator.setText(String)
public void setText2(java.lang.String text)
ProgressIndicator
setText2
in interface ProgressIndicator
text
- Text to setProgressIndicator.setText(String)
public java.lang.String getText2()
getText2
in interface ProgressIndicator
ProgressIndicator.setText2(String)
public double getFraction()
getFraction
in interface ProgressIndicator
ProgressIndicator.setFraction(double)
public void setFraction(double fraction)
ProgressIndicator
setFraction
in interface ProgressIndicator
ProgressIndicator.setIndeterminate(boolean)
public void pushState()
pushState
in interface ProgressIndicator
public void popState()
popState
in interface ProgressIndicator
public void startNonCancelableSection()
startNonCancelableSection
in interface ProgressIndicator
public void finishNonCancelableSection()
finishNonCancelableSection
in interface ProgressIndicator
public boolean isModal()
isModal
in interface ProgressIndicator
ProgressIndicator.setModalityProgress(ProgressIndicator)
public ModalityState getModalityState()
getModalityState
in interface ProgressIndicator
ModalityState.defaultModalityState()
on threads associated with this progress.
By default, depending on implementation, it's ModalityState.NON_MODAL
or current modality at the moment of progress indicator creation.
It can be later modified by ProgressIndicator.setModalityProgress(ProgressIndicator)
, but it mostly makes sense for processes showing modal dialogs.public void setModalityProgress(ProgressIndicator modalityProgress)
ProgressIndicator
ProgressIndicator.isModal()
, which, if not accompanied by showing a modal dialog,
might affect the whole IDE adversely: e.g. actions won't be executed, editor typing won't work, and all that with no visible indication.setModalityProgress
in interface ProgressIndicator
public boolean isIndeterminate()
isIndeterminate
in interface ProgressIndicator
public void setIndeterminate(boolean indeterminate)
ProgressIndicator
ProgressIndicator.setFraction(double)
).setIndeterminate
in interface ProgressIndicator
public final void checkCanceled() throws ProcessCanceledException
ProgressIndicator
ProgressManager.checkCanceled()
where you don't need to know current indicator and pass it around.checkCanceled
in interface ProgressIndicator
ProcessCanceledException
- if this progress has been canceled, i.e. ProgressIndicator.isCanceled()
returns true.protected final ProgressIndicator getDelegate()
public ProgressIndicator getOriginalProgressIndicator()
getOriginalProgressIndicator
in interface WrappedProgressIndicator
public boolean isPopupWasShown()
isPopupWasShown
in interface ProgressIndicator
public boolean isShowing()
isShowing
in interface ProgressIndicator