Class ProgressView
java.lang.Object
org.springframework.shell.component.view.control.AbstractControl
org.springframework.shell.component.view.control.AbstractView
org.springframework.shell.component.view.control.BoxView
org.springframework.shell.component.view.control.ProgressView
ProgressView is used to show a progress indicator.
Defaults to -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContext forProgressViewcell components.static final recordEncapsulates a current running state of aProgressView.static final recordViewEventindicating that proggress has been ended.static classDefines an item within a progress view.static final recordViewEventindicating that proggress has been started.static final recordViewEventindicating that proggress state has been changed.static final recordViewEventArgsfor events usingProgressView.ProgressState. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct view withtickStart 0andtickEnd 100.ProgressView(int tickStart, int tickEnd) Construct view withtickStart 0andtickEnd 100.ProgressView(int tickStart, int tickEnd, ProgressView.ProgressViewItem... items) Construct view with given bounds fortickStartandtickEnd.ProgressView(ProgressView.ProgressViewItem... items) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawInternal(Screen screen) Possibly draws a box around this view and title in a box top boundary.Gets a progress description.getState()Gets a state of thisProgressView.voidsetDescription(String description) Sets a progress description.voidsetSpinner(Spinner spinner) Sets an explicit spinner to use.voidsetTickValue(int value) Sets a tick value.voidstart()Starts a runtime logic.voidstop()Stops a runtime logic.voidtickAdvance(int count) AdvancetickValueby a given count.Methods inherited from class org.springframework.shell.component.view.control.BoxView
drawBackground, getBackgroundStyle, getInnerRect, isShowBorder, setBackgroundColor, setBorderPadding, setFocusedTitleColor, setFocusedTitleStyle, setRect, setShowBorder, setTitle, setTitleAlign, setTitleColor, setTitleStyleMethods inherited from class org.springframework.shell.component.view.control.AbstractView
destroy, dispatch, dispatchKeyRunCommand, dispatchMouseRunCommand, dispatchRunnable, draw, focus, getDrawFunction, getEventLoop, getHotKeyBindings, getHotKeyHandler, getKeyBindings, getKeyHandler, getLayer, getMouseBindings, getMouseHandler, getViewCommands, getViewService, hasFocus, init, initInternal, onDestroy, registerHotKeyBinding, registerHotKeyBinding, registerHotKeyBinding, registerKeyBinding, registerKeyBinding, registerKeyBinding, registerMouseBinding, registerMouseBinding, registerMouseBinding, registerViewCommand, runViewCommand, setDrawFunction, setEventLoop, setLayer, setViewService, shortcutMethods inherited from class org.springframework.shell.component.view.control.AbstractControl
getRect, getThemeName, getThemeResolver, resolveThemeBackground, resolveThemeForeground, resolveThemeSpinner, resolveThemeStyle, setThemeName, setThemeResolverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.shell.component.view.control.Control
getRect, setThemeName, setThemeResolver
-
Constructor Details
-
ProgressView
public ProgressView() -
ProgressView
public ProgressView(int tickStart, int tickEnd) - Parameters:
tickStart- the tick starttickEnd- the tick end
-
ProgressView
- Parameters:
items- the progress view items
-
ProgressView
Construct view with given bounds fortickStartandtickEnd.tickStartneeds to be equal or more than zero.tickEndneeds to be higher thantickStart. Uses defined progress view items.- Parameters:
tickStart- the tick starttickEnd- the tick enditems- the progress view items
-
-
Method Details
-
getDescription
Gets a progress description.- Returns:
- a progress description
-
setDescription
Sets a progress description. Used in items as a text item.- Parameters:
description- the progress description
-
setSpinner
Sets an explicit spinner to use.- Parameters:
spinner- the spinner to use
-
start
public void start()Starts a runtime logic. Call to already started progress has no effect. -
stop
public void stop()Stops a runtime logic. -
drawInternal
Description copied from class:BoxViewPossibly draws a box around this view and title in a box top boundary. Also calls adraw functionif defined.- Overrides:
drawInternalin classBoxView- Parameters:
screen- the screen
-
tickAdvance
public void tickAdvance(int count) AdvancetickValueby a given count. Note that negative count will advance backwards.- Parameters:
count- the count to advance tick value
-
setTickValue
public void setTickValue(int value) Sets a tick value. If value is lower or higher thantickStartortickEndrespectivelytickValuewill be set to low/high bounds. This meanstickValueis always kept within range inclusively.- Parameters:
value- the new tick value to set
-
getState
Gets a state of thisProgressView.- Returns:
- a view progress state
-