public class NullProgressListener extends Object implements ProgressListener
This implementation supports cancelation and getting/setting the description. The default implementations of the other methods do nothing.
Constructor and Description |
---|
NullProgressListener()
Creates a null progress listener with no description.
|
Modifier and Type | Method and Description |
---|---|
void |
complete()
Notifies this listener that the operation has finished.
|
void |
dispose()
Release any resources used by this listener.
|
void |
exceptionOccurred(Throwable exception)
Reports an exception.
|
String |
getDescription()
Returns the description for the lengthly operation to be reported, or
null if none. |
float |
getProgress()
Returns the current progress as a percent completed.
|
InternationalString |
getTask()
Returns the description of the current task being performed, or
null if none. |
boolean |
isCanceled()
Is this job canceled?
|
void |
progress(float percent)
Notifies this listener of progress in the lengthly operation.
|
void |
setCanceled(boolean cancel)
Indicate that progress should is canceled.
|
void |
setDescription(String description)
Set the description for the lenghtly operation to be reported.
|
void |
setTask(InternationalString task)
Sets the description of the current task being performed.
|
void |
started()
Notifies this listener that the operation begins.
|
void |
warningOccurred(String source,
String location,
String warning)
Reports a warning.
|
public NullProgressListener()
public String getDescription()
ProgressListener
null
if none.getDescription
in interface ProgressListener
public void setDescription(String description)
ProgressListener
setDescription
in interface ProgressListener
description
- The new description, or null
if none.public void started()
ProgressListener
started
in interface ProgressListener
public void progress(float percent)
ProgressListener
progress
in interface ProgressListener
percent
- The progress as a value between 0 and 100 inclusive.public float getProgress()
ProgressListener
getProgress
in interface ProgressListener
public void complete()
ProgressListener
complete
in interface ProgressListener
public void dispose()
ProgressListener
dispose
in interface ProgressListener
public void setCanceled(boolean cancel)
ProgressListener
setCanceled
in interface ProgressListener
cancel
- true
for cancelling the task.public boolean isCanceled()
ProgressListener
isCanceled
in interface ProgressListener
true
if this job is cancelled.public void warningOccurred(String source, String location, String warning)
ProgressListener
warningOccurred
in interface ProgressListener
source
- The source of the warning, or null
if none. This is typically the
filename in process of being parsed.location
- Text to write on the left side of the warning message, or null
if none.
This is typically the line number where the error occured in the source
file.warning
- The warning message.public void exceptionOccurred(Throwable exception)
ProgressListener
exceptionOccurred
in interface ProgressListener
exception
- The exception to report.public InternationalString getTask()
ProgressListener
null
if none. It is
assumed that if the task is null
applications may simply report that the process is
"in progress" or "working" as represented in the current locale.getTask
in interface ProgressListener
null
if none.public void setTask(InternationalString task)
ProgressListener
setTask
in interface ProgressListener
task
- Description of the task being performed, or null
if none.Copyright © 1996–2019 Geotools. All rights reserved.