WidgetStyleHandler (install4j API)
Description: declaration: package: com.install4j.api.formcomponents, interface: WidgetStyleHandler

# Interface WidgetStyleHandler

public interface WidgetStyleHandler
With the widget style handler, you can apply a widget style to certain Swing components. This is only required if you create such components in a custom form component or custom screen.

All methods take a widget style ID. You can pass the empty string for the widget style that has been selected for the current screen style. If you want the user to select a widget style, you can add a property of type `String` to your bean with a context of `CONTEXT_WIDGET_STYLE_ID`. The user can also select the inherited style, in which case the property will contain the empty string.

See Also:
  - `FormEnvironment.getWidgetStyleHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default <T extends JButton>
  T`
  `applyWidgetStyle(T button)`
  Apply the default widget style to a button.
  `default <T extends JComboBox>
  T`
  `applyWidgetStyle(T comboBox)`
  Apply the default widget style to a combo box.
  `default <T extends JLabel>
  T`
  `applyWidgetStyle(T label)`
  Apply the default widget style to a label.
  `default <T extends JList>
  T`
  `applyWidgetStyle(T list)`
  Apply the default widget style to a list.
  `default <T extends JProgressBar>
  T`
  `applyWidgetStyle(T progressBar)`
  Apply the default widget style to a progress bar.
  `default <T extends JSlider>
  T`
  `applyWidgetStyle(T slider)`
  Apply the default widget style to a slider.
  `default <T extends JSpinner>
  T`
  `applyWidgetStyle(T spinner)`
  Apply the default widget style to a spinner.
  `default <T extends JToggleButton>
  T`
  `applyWidgetStyle(T toggleButton)`
  Apply the default widget style to a toggle button.
  `default <T extends JTree>
  T`
  `applyWidgetStyle(T tree)`
  Apply the default widget style to a tree.
  `default <T extends JTextComponent>
  T`
  `applyWidgetStyle(T textComponent)`
  Apply the default widget style to a text component.
  `<T extends JButton>
  T`
  `applyWidgetStyle(T button, String widgetStyleId)`
  Apply a widget style to a button.
  `<T extends JComboBox>
  T`
  `applyWidgetStyle(T comboBox, String widgetStyleId)`
  Apply a widget style to a combo box.
  `<T extends JLabel>
  T`
  `applyWidgetStyle(T label, String widgetStyleId)`
  Apply a widget style to a label.
  `<T extends JList>
  T`
  `applyWidgetStyle(T list, String widgetStyleId)`
  Apply a widget style to a list.
  `<T extends JProgressBar>
  T`
  `applyWidgetStyle(T progressBar, String widgetStyleId)`
  Apply a widget style to a progress bar.
  `<T extends JSlider>
  T`
  `applyWidgetStyle(T slider, String widgetStyleId)`
  Apply a widget style to a slider.
  `<T extends JSpinner>
  T`
  `applyWidgetStyle(T spinner, String widgetStyleId)`
  Apply a widget style to a spinner.
  `<T extends JToggleButton>
  T`
  `applyWidgetStyle(T toggleButton, String widgetStyleId)`
  Apply a widget style to a toggle button.
  `<T extends JTree>
  T`
  `applyWidgetStyle(T tree, String widgetStyleId)`
  Apply a widget style to a tree.
  `<T extends JTextComponent>
  T`
  `applyWidgetStyle(T textComponent, String widgetStyleId)`
  Apply a widget style to a text component.

- ## Method Details

  - ### applyWidgetStyle

    <T extends JButton> T applyWidgetStyle(T button, String widgetStyleId)
    Apply a widget style to a button.
    Parameters:
      `button` - the button
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the button, for fluent invocations

  - ### applyWidgetStyle

    <T extends JTextComponent> T applyWidgetStyle(T textComponent, String widgetStyleId)
    Apply a widget style to a text component.
    Parameters:
      `textComponent` - the text component
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the text component, for fluent invocations

  - ### applyWidgetStyle

    <T extends JSpinner> T applyWidgetStyle(T spinner, String widgetStyleId)
    Apply a widget style to a spinner.
    Parameters:
      `spinner` - the spinner
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the spinner, for fluent invocations

  - ### applyWidgetStyle

    <T extends JComboBox> T applyWidgetStyle(T comboBox, String widgetStyleId)
    Apply a widget style to a combo box.
    Parameters:
      `comboBox` - the combo box
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the combo box, for fluent invocations

  - ### applyWidgetStyle

    <T extends JLabel> T applyWidgetStyle(T label, String widgetStyleId)
    Apply a widget style to a label.
    Parameters:
      `label` - the label
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the label, for fluent invocations

  - ### applyWidgetStyle

    <T extends JToggleButton> T applyWidgetStyle(T toggleButton, String widgetStyleId)
    Apply a widget style to a toggle button.
    Parameters:
      `toggleButton` - the toggle button
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the toggle button, for fluent invocations

  - ### applyWidgetStyle

    <T extends JList> T applyWidgetStyle(T list, String widgetStyleId)
    Apply a widget style to a list.
    Parameters:
      `list` - the list
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the list, for fluent invocations

  - ### applyWidgetStyle

    <T extends JTree> T applyWidgetStyle(T tree, String widgetStyleId)
    Apply a widget style to a tree.
    Parameters:
      `tree` - the tree
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the tree, for fluent invocations

  - ### applyWidgetStyle

    <T extends JSlider> T applyWidgetStyle(T slider, String widgetStyleId)
    Apply a widget style to a slider.
    Parameters:
      `slider` - the slider
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the slider, for fluent invocations

  - ### applyWidgetStyle

    <T extends JProgressBar> T applyWidgetStyle(T progressBar, String widgetStyleId)
    Apply a widget style to a progress bar.
    Parameters:
      `progressBar` - the progress bar
      `widgetStyleId` - the widget style ID. Pass the empty string for the default widget style of the current screen style.
    Returns:
      the progress bar, for fluent invocations

  - ### applyWidgetStyle

    default <T extends JButton> T applyWidgetStyle(T button)
    Apply the default widget style to a button.
    Parameters:
      `button` - the button
    Returns:
      the button, for fluent invocations
    See Also:
      - `applyWidgetStyle(JButton, String)`

  - ### applyWidgetStyle

    default <T extends JTextComponent> T applyWidgetStyle(T textComponent)
    Apply the default widget style to a text component.
    Parameters:
      `textComponent` - the text component
    Returns:
      the text component, for fluent invocations
    See Also:
      - `applyWidgetStyle(JTextComponent, String)`

  - ### applyWidgetStyle

    default <T extends JSpinner> T applyWidgetStyle(T spinner)
    Apply the default widget style to a spinner.
    Parameters:
      `spinner` - the spinner
    Returns:
      the spinner, for fluent invocations
    See Also:
      - `applyWidgetStyle(JSpinner, String)`

  - ### applyWidgetStyle

    default <T extends JComboBox> T applyWidgetStyle(T comboBox)
    Apply the default widget style to a combo box.
    Parameters:
      `comboBox` - the combo box
    Returns:
      the combo box, for fluent invocations
    See Also:
      - `applyWidgetStyle(JComboBox, String)`

  - ### applyWidgetStyle

    default <T extends JLabel> T applyWidgetStyle(T label)
    Apply the default widget style to a label.
    Parameters:
      `label` - the label
    Returns:
      the label, for fluent invocations
    See Also:
      - `applyWidgetStyle(JLabel, String)`

  - ### applyWidgetStyle

    default <T extends JToggleButton> T applyWidgetStyle(T toggleButton)
    Apply the default widget style to a toggle button.
    Parameters:
      `toggleButton` - the toggle button
    Returns:
      the toggle button, for fluent invocations
    See Also:
      - `applyWidgetStyle(JToggleButton, String)`

  - ### applyWidgetStyle

    default <T extends JList> T applyWidgetStyle(T list)
    Apply the default widget style to a list.
    Parameters:
      `list` - the list
    Returns:
      the list, for fluent invocations
    See Also:
      - `applyWidgetStyle(JList, String)`

  - ### applyWidgetStyle

    default <T extends JTree> T applyWidgetStyle(T tree)
    Apply the default widget style to a tree.
    Parameters:
      `tree` - the tree
    Returns:
      the tree, for fluent invocations
    See Also:
      - `applyWidgetStyle(JTree, String)`

  - ### applyWidgetStyle

    default <T extends JSlider> T applyWidgetStyle(T slider)
    Apply the default widget style to a slider.
    Parameters:
      `slider` - the slider
    Returns:
      the slider, for fluent invocations
    See Also:
      - `applyWidgetStyle(JSlider, String)`

  - ### applyWidgetStyle

    default <T extends JProgressBar> T applyWidgetStyle(T progressBar)
    Apply the default widget style to a progress bar.
    Parameters:
      `progressBar` - the progress bar
    Returns:
      the progress bar, for fluent invocations
    See Also:
      - `applyWidgetStyle(JProgressBar, String)`