Package swingtree

Class UIForBox<B extends JBox>


public final class UIForBox<B extends JBox> extends UIForAnySwing<UIForBox<B>,B>
A SwingTree builder node designed for configuring JBox instances.
  • Constructor Details

    • UIForBox

      protected UIForBox(swingtree.BuilderState<B> state)
      UIForAnySwing (sub)types always wrap a builder state which defines how a component is created.
      Parameters:
      state - The BuilderState containing the component which will be managed by this builder.
  • Method Details

    • _state

      protected swingtree.BuilderState<B> _state()
      Description copied from class: UIForAnything
      Returns the state of the builder, which is a container for the wrapped component as well as it's type and current EventProcessor.
      Specified by:
      _state in class UIForAnything<UIForBox<B extends JBox>,B extends JBox,JComponent>
      Returns:
      The state of the builder.
    • _newBuilderWithState

      protected UIForBox<B> _newBuilderWithState(swingtree.BuilderState<B> newState)
      Description copied from class: UIForAnything
      An internal wither method which creates a new builder instance with the provided BuilderState stored inside it.
      Specified by:
      _newBuilderWithState in class UIForAnything<UIForBox<B extends JBox>,B extends JBox,JComponent>
      Parameters:
      newState - The new state which should be stored inside the new builder instance.
      Returns:
      A new builder instance with the provided state stored inside it.
    • withLayout

      public final UIForBox<B> withLayout(sprouts.Val<LayoutConstraint> attr)
      Use this to dynamically set the MigLayout attributes of the MigLayout of the JBox.
      Parameters:
      attr - The layout attributes property which will be dynamically passed to the MigLayout constructor as first argument.
      Returns:
      A builder instance for a new JBox, which enables fluent method chaining.
      Throws:
      IllegalArgumentException - if attr is null.
    • _setEnabled

      protected void _setEnabled(B thisComponent, boolean isEnabled)
      Overrides:
      _setEnabled in class UIForAnySwing<UIForBox<B extends JBox>,B extends JBox>