Interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>

Type Parameters:
C - the Control type
B - the builder type
All Known Subinterfaces:
Controls.Builder
Enclosing interface:
Control

public static interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>
A builder for Control
  • Method Details

    • name

      B name(String name)
      Parameters:
      name - the name of the control
      Returns:
      this Builder instance
    • enabled

      B enabled(StateObserver enabled)
      Parameters:
      enabled - the state observer which controls the enabled state of the control
      Returns:
      this Builder instance
    • mnemonic

      B mnemonic(char mnemonic)
      Parameters:
      mnemonic - the control mnemonic
      Returns:
      this Builder instance
    • smallIcon

      B smallIcon(Icon smallIcon)
      Parameters:
      smallIcon - the small control icon
      Returns:
      this Builder instance
    • largeIcon

      B largeIcon(Icon largeIcon)
      Parameters:
      largeIcon - the large control icon
      Returns:
      this Builder instance
    • description

      B description(String description)
      Parameters:
      description - a string describing the control
      Returns:
      this Builder instance
    • keyStroke

      B keyStroke(KeyStroke keyStroke)
      Parameters:
      keyStroke - the keystroke to associate with the control
      Returns:
      this Builder instance
    • value

      B value(String key, Object value)
      Note that any values added will overwrite the property, if already present, i.e. setting the 'SmallIcon' value via this method will overwrite the one set via smallIcon(Icon).
      Parameters:
      key - the key
      value - the value
      Returns:
      this builder
      See Also:
    • build

      C build()
      Returns:
      a new Control instance
      Throws:
      IllegalStateException - in case no command has been set