* A progression event.
*
* @param progress
- * the {@link Progress} object that generated it
+ * the {@link Progress} object that generated it, not
+ * necessarily the same as the one where the listener was
+ * attached (it could be a child {@link Progress} of this
+ * {@link Progress}).
* @param name
* the first non-null name of the {@link Progress} step that
* generated this event
/**
* Add a {@link ProgressListener} that will trigger on progress changes.
+ * <p>
+ * Note: the {@link Progress} that will be reported will be the active
+ * progress, not necessarily the same as the current one (it could be a
+ * child {@link Progress} of this {@link Progress}).
*
* @param l
* the listener
@Override
public void test() throws Exception {
- Progress p = new Progress();
+ final Progress p = new Progress();
Progress child1 = new Progress();
Progress child2 = new Progress();
p.addProgress(child1, 50);
p.addProgressListener(new Progress.ProgressListener() {
public void progress(Progress progress, String name) {
- pg = progress.getProgress();
+ pg = p.getProgress();
}
});
@Override
public void test() throws Exception {
- Progress p = new Progress();
+ final Progress p = new Progress();
p.setMax(1000);
Progress child1 = new Progress();
p.addProgressListener(new Progress.ProgressListener() {
public void progress(Progress progress, String name) {
- pg = progress.getProgress();
+ pg = p.getProgress();
}
});
@Override
public void test() throws Exception {
- Progress p = new Progress();
+ final Progress p = new Progress();
p.setMax(1000);
Progress child1 = new Progress();
p.addProgressListener(new Progress.ProgressListener() {
public void progress(Progress progress, String name) {
- pg = progress.getProgress();
+ pg = p.getProgress();
}
});