Class FxChoiceBoxDelegate

java.lang.Object
org.tentackle.fx.FxControlDelegate
org.tentackle.fx.FxComponentDelegate
org.tentackle.fx.component.delegate.FxChoiceBoxDelegate
All Implemented Interfaces:
ErrorPopupSupported, FxComponent, FxControl, InfoPopupSupported

public class FxChoiceBoxDelegate extends FxComponentDelegate
Delegate for FxChoiceBox.

As a convenience for boolean model types the choicebox can fake the boolean with 2 items: first for TRUE and the second for FALSE. If the application already specified 2 items, they will be kept, otherwise overridden from the name of the model member.

Author:
harald
  • Constructor Details

    • FxChoiceBoxDelegate

      public FxChoiceBoxDelegate(FxChoiceBox<?> component)
      Creates the delegate.
      Parameters:
      component - the component
  • Method Details

    • getComponent

      public FxChoiceBox<?> getComponent()
      Description copied from class: FxComponentDelegate
      Gets the component of this delegate.
      Specified by:
      getComponent in class FxComponentDelegate
      Returns:
      the component
    • getParentContainer

      public FxContainer getParentContainer()
      Description copied from interface: FxControl
      Gets the parent container.
      Specified by:
      getParentContainer in interface FxControl
      Overrides:
      getParentContainer in class FxComponentDelegate
      Returns:
      the parent, null if not a component of a container
    • setType

      public void setType(Class<?> type)
      Description copied from interface: FxComponent
      Sets the type for this component.

      Notice that the type can be applied only once. This is because previously installed listeners could cause memory leaks.

      Specified by:
      setType in interface FxComponent
      Overrides:
      setType in class FxComponentDelegate
      Parameters:
      type - the type
    • setViewObject

      public void setViewObject(Object value)
      Description copied from interface: FxComponent
      Sets the internal native object of the component.
      Parameters:
      value - the internal object
    • getViewObject

      public Object getViewObject()
      Description copied from interface: FxComponent
      Retrieves the internal native object of the component.
      Returns:
      the component's object
    • setViewValue

      public void setViewValue(Object value)
      Description copied from interface: FxComponent
      Sets a value in this component.
      The value's type is that of the model.
      Specified by:
      setViewValue in interface FxComponent
      Overrides:
      setViewValue in class FxComponentDelegate
      Parameters:
      value - is the value to set
    • getViewValue

      public <V> V getViewValue()
      Description copied from interface: FxComponent
      Retrieves the value from this component.
      The value's type is that of the model.
      Specified by:
      getViewValue in interface FxComponent
      Overrides:
      getViewValue in class FxComponentDelegate
      Type Parameters:
      V - the value's type
      Returns:
      the value shown by the component
    • isDeselectAllowed

      public boolean isDeselectAllowed()
      Returns whether deselect is allowed.
      Returns:
      true if allowed