Class FxControlDelegate

java.lang.Object
org.tentackle.fx.FxControlDelegate
All Implemented Interfaces:
FxControl
Direct Known Subclasses:
FxComponentDelegate, FxContainerDelegate

public abstract class FxControlDelegate extends Object implements FxControl
Base implementation for all fx delegates.
Author:
harald
  • Property Details

  • Constructor Details

    • FxControlDelegate

      public FxControlDelegate()
      Creates a control delegate.
  • Method Details

    • getDelegate

      public FxControlDelegate getDelegate()
      Description copied from interface: FxControl
      Gets the lazily created component delegate.
      Specified by:
      getDelegate in interface FxControl
      Returns:
      the delegate
    • setViewModified

      public void setViewModified(boolean viewModified)
      Sets the value of the property viewModified.
      Specified by:
      setViewModified in interface FxControl
      Property description:
      Parameters:
      viewModified - true if user has modified the visual representation
    • isViewModified

      public boolean isViewModified()
      Gets the value of the property viewModified.
      Specified by:
      isViewModified in interface FxControl
      Property description:
      Returns:
      true if user changed the visual representation
    • viewModifiedProperty

      public javafx.beans.property.BooleanProperty viewModifiedProperty()
      Description copied from interface: FxControl
      Gets the viewModified property.
      Specified by:
      viewModifiedProperty in interface FxControl
      See Also:
    • setChangeable

      public void setChangeable(boolean changeable)
      Sets the value of the property changeable.
      Specified by:
      setChangeable in interface FxControl
      Property description:
      The changeable property in fact is a read-write property, but exported as readonly.
      Parameters:
      changeable - true the user can edit the data, false if show only
    • isControlChangeable

      protected boolean isControlChangeable()
      Gets the last intended changeability for this control.
      Might differ from effective changeability if container changed its changeability.
      Returns:
      the control's changeability regardless of the effective changeability
    • isChangeable

      public boolean isChangeable()
      Gets the value of the property changeable.
      Specified by:
      isChangeable in interface FxControl
      Property description:
      The changeable property in fact is a read-write property, but exported as readonly.
      Returns:
      true the user can edit the data, false if show only
    • changeableProperty

      public javafx.beans.property.ReadOnlyBooleanProperty changeableProperty()
      The changeable property in fact is a read-write property, but exported as readonly.
      Specified by:
      changeableProperty in interface FxControl
      See Also:
    • updateChangeable

      protected void updateChangeable(boolean changeable)
      Updates other properties if changeable is bound to something else.
      Parameters:
      changeable - the flag
    • createChangeableProperty

      protected javafx.beans.property.ReadOnlyBooleanWrapper createChangeableProperty(boolean changeable)
      Creates the changeable property.
      Parameters:
      changeable - the initial value
      Returns:
      the property
    • setContainerChangeableIgnored

      public void setContainerChangeableIgnored(boolean containerChangeableIgnored)
      Description copied from interface: FxControl
      Sets whether to ignore setContainerChangeable.
      Specified by:
      setContainerChangeableIgnored in interface FxControl
      Parameters:
      containerChangeableIgnored - true if ignore, default is false
    • isContainerChangeableIgnored

      public boolean isContainerChangeableIgnored()
      Description copied from interface: FxControl
      Returns whether setContainerChangeable is ignored by this control.
      Specified by:
      isContainerChangeableIgnored in interface FxControl
      Returns:
      true if ignore
    • setBindable

      public void setBindable(boolean bindable)
      Description copied from interface: FxControl
      Sets whether this control is bindable, i.e. should be checked within a binding hierarchy.
      Specified by:
      setBindable in interface FxControl
      Parameters:
      bindable - true if bindable, else not eligible for the binding process
    • isBindable

      public boolean isBindable()
      Description copied from interface: FxControl
      Determines whether this container is bindable.
      Specified by:
      isBindable in interface FxControl
      Returns:
      true if bindable, else not eligible for the binding process
    • setHelpUrl

      public void setHelpUrl(String helpUrl)
      Description copied from interface: FxControl
      Sets the online-help URL.
      If a help url is set, a browser will be launched to show that url if there is no help url for the control the help was requested for.
      Specified by:
      setHelpUrl in interface FxControl
      Parameters:
      helpUrl - the help url
    • getHelpUrl

      public String getHelpUrl()
      Description copied from interface: FxControl
      Gets the online-help URL.
      Specified by:
      getHelpUrl in interface FxControl
      Returns:
      the help url, default is null
    • showHelp

      public void showHelp()
      Description copied from interface: FxControl
      Displays online help if configured.
      Specified by:
      showHelp in interface FxControl
    • addModelToViewListener

      public void addModelToViewListener(ModelToViewListener listener)
      Description copied from interface: FxControl
      Adds a model-to-view listener.
      The listener will be invoked before the binding operation.
      If the control is a container, the listener will be invoked if any of the container's components get updated.
      Specified by:
      addModelToViewListener in interface FxControl
      Parameters:
      listener - the value listener to add
    • removeModelToViewListener

      public void removeModelToViewListener(ModelToViewListener listener)
      Description copied from interface: FxControl
      Removes a model-to-view listener.
      Specified by:
      removeModelToViewListener in interface FxControl
      Parameters:
      listener - the value listener to remove
    • addViewToModelListener

      public void addViewToModelListener(ViewToModelListener listener)
      Description copied from interface: FxControl
      Adds a view-to-model listener.
      The listener will be invoked after the binding operation.
      If the control is a container, the listener will be invoked if any of the container's components update the model.
      Specified by:
      addViewToModelListener in interface FxControl
      Parameters:
      listener - the value listener to add
    • removeViewToModelListener

      public void removeViewToModelListener(ViewToModelListener listener)
      Description copied from interface: FxControl
      Removes a view-to-model listener.
      Specified by:
      removeViewToModelListener in interface FxControl
      Parameters:
      listener - the value listener to remove
    • getModelToViewListeners

      public Collection<ModelToViewListener> getModelToViewListeners()
      Gets the model-to-view listeners with lazy collection creation.
      Returns:
      the listeners, never null
    • fireModelToViewListeners

      public void fireModelToViewListeners()
      Fires all model-to-view listeners.
    • getViewToModelListeners

      public Collection<ViewToModelListener> getViewToModelListeners()
      Gets the view-to-model listeners with lazy collection creation.
      Returns:
      the listeners, never null
    • fireViewToModelListeners

      public void fireViewToModelListeners()
      Fires all model-to-view listeners.