Class Spinner
java.lang.Object
com.codename1.cli.Spinner
- All Implemented Interfaces:
AutoCloseable
An animated indicator for work of unknown length, ending in a status line:
try (Spinner s = Spinner.start("Resolving dependencies")) {
resolve();
s.succeed("Resolved 42 dependencies");
}
A spinner closed without a status clears its line. Off a terminal it prints the message once when it starts and the status when it ends.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops and clears the line, unless a status was already shown.voidStops with a red cross andtext.frames(Spinner.Frames frames) Chooses the animation; call beforestart(String).voidStops with a blue information sign andtext.voidPrints a line above the spinner.voidsetMessage(String text) Changes the message while spinning.start()Starts animating.static SpinnerMakes a spinner showingmessageand starts it.voidStops with a green check andtext(the message when null).voidStops with a yellow warning sign andtext.
-
Constructor Details
-
Spinner
A spinner showingmessage, not yet started.
-
-
Method Details
-
start
-
frames
Chooses the animation; call beforestart(String). -
start
Starts animating. -
setMessage
Changes the message while spinning. -
println
Prints a line above the spinner. -
succeed
Stops with a green check andtext(the message when null). -
fail
Stops with a red cross andtext. -
warn
Stops with a yellow warning sign andtext. -
info
Stops with a blue information sign andtext. -
close
public void close()Stops and clears the line, unless a status was already shown.- Specified by:
closein interfaceAutoCloseable
-