Class AppView
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.AppView
AppView
provides an opinionated terminal UI application view
controlling main viewing area, menubar, statusbar and modal window system.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
ViewEvent
indicating direction for a next selection.static final record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawInternal
(Screen screen) Possibly draws a box around this view and title in a box top boundary.Handles keys by dispatching registered command runnable into an event loop.Handles mouse events by dispatching registered consumers into an event loop.boolean
hasFocus()
Gets if thisView
has a focus.void
setMenuBarVisible
(boolean visible) Sets visibility for amenubar
.void
setStatusBarVisible
(boolean visible) Sets visibility for astatusbar
.void
setThemeName
(String themeName) Sets a theme name to use.void
setThemeResolver
(ThemeResolver themeResolver) Sets aThemeResolver
.void
Toggles amenubar
visibility.void
Toggles astatusbar
visibility.Methods inherited from class org.springframework.shell.component.view.control.BoxView
getInnerRect, isShowBorder, isTransparent, setBackgroundColor, setBorderPadding, setFocusedTitleColor, setFocusedTitleStyle, setRect, setShowBorder, setTitle, setTitleAlign, setTitleColor, setTitleStyle, setTransparent
Methods inherited from class org.springframework.shell.component.view.control.AbstractView
destroy, dispatch, dispatchMouseRunCommand, dispatchRunCommand, dispatchRunnable, draw, focus, getDrawFunction, getEventLoop, getKeyBindings, getLayer, getMouseBindings, init, initInternal, onDestroy, registerKeyBinding, registerKeyBinding, registerKeyBinding, registerMouseBinding, registerMouseBinding, registerMouseBinding, setDrawFunction, setEventLoop, setLayer
Methods inherited from class org.springframework.shell.component.view.control.AbstractControl
getRect, getThemeName, getThemeResolver, resolveThemeBackground, resolveThemeForeground, resolveThemeStyle
-
Constructor Details
-
AppView
-
-
Method Details
-
setThemeName
Description copied from class:AbstractControl
Sets a theme name to use.- Specified by:
setThemeName
in interfaceControl
- Overrides:
setThemeName
in classAbstractControl
- Parameters:
themeName
- the theme name
-
setThemeResolver
Description copied from class:AbstractControl
Sets aThemeResolver
.- Specified by:
setThemeResolver
in interfaceControl
- Overrides:
setThemeResolver
in classAbstractControl
- Parameters:
themeResolver
- the theme resolver
-
drawInternal
Description copied from class:BoxView
Possibly draws a box around this view and title in a box top boundary. Also calls adraw function
if defined.- Overrides:
drawInternal
in classBoxView
- Parameters:
screen
- the screen
-
getMouseHandler
Description copied from class:AbstractView
Handles mouse events by dispatching registered consumers into an event loop. Override to change default behaviour.- Specified by:
getMouseHandler
in interfaceView
- Overrides:
getMouseHandler
in classAbstractView
- Returns:
- a view mouse handler
- See Also:
-
getKeyHandler
Description copied from class:AbstractView
Handles keys by dispatching registered command runnable into an event loop. Override to change default behaviour.- Specified by:
getKeyHandler
in interfaceView
- Overrides:
getKeyHandler
in classAbstractView
- Returns:
- a view mouse handler
- See Also:
-
hasFocus
public boolean hasFocus()Description copied from interface:View
Gets if thisView
has a focus.- Specified by:
hasFocus
in interfaceView
- Overrides:
hasFocus
in classAbstractView
- Returns:
- true if view has a focus
-
setMenuBarVisible
public void setMenuBarVisible(boolean visible) Sets visibility for amenubar
.- Parameters:
visible
- the menubar visibility
-
setStatusBarVisible
public void setStatusBarVisible(boolean visible) Sets visibility for astatusbar
.- Parameters:
visible
- the statusbar visibility
-
toggleMenuBarVisibility
public void toggleMenuBarVisibility()Toggles amenubar
visibility. -
toggleStatusBarVisibility
public void toggleStatusBarVisibility()Toggles astatusbar
visibility.
-