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 recordViewEventindicating direction for a next selection.static final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawInternal(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.booleanhasFocus()Gets if thisViewhas a focus.voidsetMenuBarVisible(boolean visible) Sets visibility for amenubar.voidsetStatusBarVisible(boolean visible) Sets visibility for astatusbar.voidsetThemeName(String themeName) Sets a theme name to use.voidsetThemeResolver(ThemeResolver themeResolver) Sets aThemeResolver.voidToggles amenubarvisibility.voidToggles astatusbarvisibility.Methods inherited from class org.springframework.shell.component.view.control.BoxView
getInnerRect, isShowBorder, isTransparent, setBackgroundColor, setBorderPadding, setFocusedTitleColor, setFocusedTitleStyle, setRect, setShowBorder, setTitle, setTitleAlign, setTitleColor, setTitleStyle, setTransparentMethods 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, setLayerMethods 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:AbstractControlSets a theme name to use.- Specified by:
setThemeNamein interfaceControl- Overrides:
setThemeNamein classAbstractControl- Parameters:
themeName- the theme name
-
setThemeResolver
Description copied from class:AbstractControlSets aThemeResolver.- Specified by:
setThemeResolverin interfaceControl- Overrides:
setThemeResolverin classAbstractControl- Parameters:
themeResolver- the theme resolver
-
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
-
getMouseHandler
Description copied from class:AbstractViewHandles mouse events by dispatching registered consumers into an event loop. Override to change default behaviour.- Specified by:
getMouseHandlerin interfaceView- Overrides:
getMouseHandlerin classAbstractView- Returns:
- a view mouse handler
- See Also:
-
getKeyHandler
Description copied from class:AbstractViewHandles keys by dispatching registered command runnable into an event loop. Override to change default behaviour.- Specified by:
getKeyHandlerin interfaceView- Overrides:
getKeyHandlerin classAbstractView- Returns:
- a view mouse handler
- See Also:
-
hasFocus
public boolean hasFocus()Description copied from interface:ViewGets if thisViewhas a focus.- Specified by:
hasFocusin interfaceView- Overrides:
hasFocusin 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 amenubarvisibility. -
toggleStatusBarVisibility
public void toggleStatusBarVisibility()Toggles astatusbarvisibility.
-