Class AbstractControl
java.lang.Object
org.springframework.shell.component.view.control.AbstractControl
- All Implemented Interfaces:
Control
- Direct Known Subclasses:
AbstractCell,AbstractView
Base implementation of a
Control.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRect()Gets rectanle of a bounded box for thisView.protected StringGets a theme name.protected ThemeResolverGets aThemeResolver.protected intresolveThemeBackground(String tag, int defaultColor, int fallbackColor) Resolve background color using existingThemeResolverandtheme name.protected intresolveThemeForeground(String tag, int defaultColor, int fallbackColor) Resolve foreground color using existingThemeResolverandtheme name.protected SpinnerresolveThemeSpinner(String tag, Spinner defaultSpinner, Spinner fallbackSpinner) protected intresolveThemeStyle(String tag, int defaultStyle) Resolve style using existingThemeResolverandtheme name.voidsetRect(int x, int y, int width, int height) Sets bounds where thisControlshould operate.voidsetThemeName(String themeName) Sets a theme name to use.voidsetThemeResolver(ThemeResolver themeResolver) Sets aThemeResolver.
-
Constructor Details
-
AbstractControl
public AbstractControl()
-
-
Method Details
-
setRect
public void setRect(int x, int y, int width, int height) Description copied from interface:ControlSets bounds where thisControlshould operate. -
getRect
Description copied from interface:ControlGets rectanle of a bounded box for thisView. -
setThemeResolver
Sets aThemeResolver.- Specified by:
setThemeResolverin interfaceControl- Parameters:
themeResolver- the theme resolver
-
getThemeResolver
Gets aThemeResolver.- Returns:
- a theme resolver
-
setThemeName
Sets a theme name to use.- Specified by:
setThemeNamein interfaceControl- Parameters:
themeName- the theme name
-
getThemeName
Gets a theme name.- Returns:
- a theme name
-
resolveThemeStyle
Resolve style using existingThemeResolverandtheme name. UsedefaultStyleif resolving cannot happen.- Parameters:
tag- the style tag to usedefaultStyle- the default style to use- Returns:
- resolved style
-
resolveThemeForeground
Resolve foreground color using existingThemeResolverandtheme name.defaultColoris used if it's value is not negative.fallbackColoris used if theme resolver cannot be used.- Parameters:
tag- the style tag to usedefaultColor- the default foreground color to usefallbackColor- the fallback foreground color to use- Returns:
- resolved foreground color
-
resolveThemeBackground
Resolve background color using existingThemeResolverandtheme name.defaultColoris used if it's value is not negative.fallbackColoris used if theme resolver cannot be used.- Parameters:
tag- the style tag to usedefaultColor- the default background color to usefallbackColor- the fallback background color to use- Returns:
- resolved background color
-
resolveThemeSpinner
ResolveSpinnerusing existingThemeResolverandtheme name.defaultSpinneris used if it's notnull.fallbackSpinneris used if theme resolver cannot be used.- Parameters:
tag- the spinner tag to usedefaultSpinner- the default spinner to usefallbackSpinner- the fallback spinner to use- Returns:
- resolved spinner
-