https://github.com/duckasteroid/progress
A Java library for reporting progress - with console implementation and bindings for various UI tookits
https://github.com/duckasteroid/progress
gradle java progress travis-ci
Last synced: 5 months ago
JSON representation
A Java library for reporting progress - with console implementation and bindings for various UI tookits
- Host: GitHub
- URL: https://github.com/duckasteroid/progress
- Owner: duckAsteroid
- License: apache-2.0
- Created: 2014-09-27T21:07:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-01-06T18:33:16.000Z (6 months ago)
- Last Synced: 2025-02-01T05:23:17.604Z (5 months ago)
- Topics: gradle, java, progress, travis-ci
- Language: Java
- Homepage:
- Size: 1.48 MB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
progress
========
[](https://github.com/duckAsteroid/progress/actions/workflows/gradle.yml)
[](https://snyk.io//test/github/duckAsteroid/progress?targetFile=build.gradle)
[](https://sonarcloud.io/dashboard?id=com.asteroid.duck.progress%3Aprogress)
An implementation agnostic Java library for reporting progress - with bindings for various logging and UI toolkits.
Think of it like [SLF4J](https://www.slf4j.org/) but for progress reporting, rather than logging.
If you are passed a `ProgressMonitor` instance into your code - it is very straightforward to use. Here is the most basic
example:```java
public void someMethod(ProgressMonitor monitor) {
monitor.setSize(100);
monitor.setStatus("Starting to do some stuff");
try {
for(int i=0; i < 10; i++) {
monitor.setStatus("Doing stuff " + i +" of 10");
// do something sensible that takes time
Thread.sleep(1000);
monitor.worked(10);
// Note we might also check if the monitor is cancelled?
// if(monitor.isCancelled()) { break; }
}
}
catch(InterruptedException e) {
// could be any exception
e.printStackTrace();
}
finally {
// regardless what state of progress was when exception happened
// we are now done!
monitor.done();
}
}
```Whats most important is that this brings no other dependencies into the client code - however the underlying `ProgressMonitor` instance may be implemented (and mapped through to corresponding monitor classes) for Console, Swing, Eclipse ...
Getting Started
===============To use the library to report on progress (regardless of where it reports to) you need to add the
dependency for the pure API as follows:
```groovy
dependencies {
implementation 'com.asteroid.duck.progress:api:1.1.0'
}
```Applications that wish to render that progress would need to use one of the bindings for different
destinations:
* Console/terminal output (e.g. `System.out`)
* SLF4J Loggers messages in some form
* Java Logging framework
* Swing progress reportingMore will be added in future.