Interface Disableable


public interface Disableable
This interface is used to coordinate user interactions with an object.

The user is not allowed to invoke an action on a disabled object.

If the disabled object is a user interface component, then it should visualize that actions may not be invoked. For example by disabling buttons.

The object can be disabled by adding Workers to its "disabler" set. Additionally the object can disable itself, when its internal state does not permit the invocation of actions.

The object is enabled when its "disabler" set is empty and its internal state permits the invocation of actions.

Author:
Werner Randelshofer
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyBooleanProperty
    Indicates whether or not this object is disabled.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the disabled property.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addDisabler(Object disabler)
    Adds a disabler.
    javafx.beans.property.ReadOnlyBooleanProperty
    Indicates whether or not this object is disabled.
    javafx.collections.ObservableSet<Object>
    The set of disablers.
    default boolean
    Gets the value of the disabled property.
    default void
    Removes a disabler.
  • Property Details

    • disabled

      javafx.beans.property.ReadOnlyBooleanProperty disabledProperty
      Indicates whether or not this object is disabled.

      The object is disabled when its "disabler" set is not empty or its internal state does not permit the invocation of actions.

      See Also:
  • Field Details

  • Method Details

    • disabledProperty

      javafx.beans.property.ReadOnlyBooleanProperty disabledProperty()
      Indicates whether or not this object is disabled.

      The object is disabled when its "disabler" set is not empty or its internal state does not permit the invocation of actions.

      Returns:
      the disabled property.
      See Also:
    • disablers

      javafx.collections.ObservableSet<Object> disablers()
      The set of disablers.
      Returns:
      The disablers.
    • isDisabled

      default boolean isDisabled()
      Gets the value of the disabled property.
      Property description:
      Indicates whether or not this object is disabled.

      The object is disabled when its "disabler" set is not empty or its internal state does not permit the invocation of actions.

      Returns:
      the value of the disabled property
      See Also:
    • addDisabler

      default void addDisabler(Object disabler)
      Adds a disabler.
      Parameters:
      disabler - a new disabler
    • removeDisabler

      default void removeDisabler(Object disabler)
      Removes a disabler.
      Parameters:
      disabler - an object which does not disable anymore