Interface FxComponent

All Superinterfaces:
ErrorPopupSupported, FxControl, InfoPopupSupported
All Known Subinterfaces:
FxTextComponent
All Known Implementing Classes:
AbstractTextFieldDelegate, FxCheckBox, FxCheckBoxDelegate, FxChoiceBox, FxChoiceBoxDelegate, FxColorPicker, FxColorPickerDelegate, FxComboBox, FxComboBoxDelegate, FxComponentDelegate, FxDatePicker, FxDatePickerDelegate, FxHTMLEditor, FxHTMLEditorDelegate, FxListView, FxListViewDelegate, FxPasswordField, FxPasswordFieldDelegate, FxRadioButton, FxRadioButtonDelegate, FxTableView, FxTableViewDelegate, FxTextArea, FxTextAreaDelegate, FxTextComponentDelegate, FxTextField, FxTextFieldDelegate, FxToggleButton, FxToggleButtonDelegate, FxTreeTableView, FxTreeTableViewDelegate, FxTreeView, FxTreeViewDelegate, TotalsTableView

public interface FxComponent extends FxControl, ErrorPopupSupported, InfoPopupSupported
Interface all tentackle Fx components must implement.
Author:
harald
  • Property Details

  • Method Details

    • getDelegate

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

      void setType(Class<?> type)
      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.

      Parameters:
      type - the type
      Throws:
      FxRuntimeException - if component cannot handle that type
    • getType

      Class<?> getType()
      Gets the type this component returns via getViewValue().
      Returns:
      the type
    • setGenericType

      void setGenericType(Type genericType)
      Sets the generic type.
      Parameters:
      genericType - the generic type
    • getGenericType

      Type getGenericType()
      Gets the generic type.
      Returns:
      the generic type
    • setValueTranslator

      void setValueTranslator(ValueTranslator<?,?> valueTranslator)
      Sets a value translator.
      Parameters:
      valueTranslator - the translator
    • getValueTranslator

      ValueTranslator<?,?> getValueTranslator()
      Gets the value translator.
      Returns:
      the translator
    • setViewValue

      void setViewValue(Object value)
      Sets a value in this component.
      The value's type is that of the model.
      Parameters:
      value - is the value to set
    • getViewValue

      <V> V getViewValue()
      Retrieves the value from this component.
      The value's type is that of the model.
      Type Parameters:
      V - the value's type
      Returns:
      the value shown by the component
    • getViewObject

      Object getViewObject()
      Retrieves the internal native object of the component.
      Returns:
      the component's object
    • setViewObject

      void setViewObject(Object viewObject)
      Sets the internal native object of the component.
      Parameters:
      viewObject - the internal object
    • isSavedViewObjectValid

      boolean isSavedViewObjectValid()
      Returns whether the view object is saved.
      Returns:
      true if saved, false if invalid
    • getSavedViewObject

      Object getSavedViewObject()
      Retrieves the view value saved with FxControl.saveView().
      The returned type is the internal native type of the component.
      Returns:
      the saved view value
    • setMandatory

      void setMandatory(boolean mandatory)
      Sets the mandatory option.
      Mandatory fields are differently visualized. There is no further functional difference.
      Parameters:
      mandatory - true if mandatory
    • isMandatory

      boolean isMandatory()
      Gets the mandatory option.
      Returns:
      true if mandatory
    • mandatoryProperty

      javafx.beans.property.BooleanProperty mandatoryProperty()
      Gets the mandatory property.
      See Also:
    • setBindingPath

      void setBindingPath(String bindingPath)
      Sets the path to bind this component to.

      Usually the binding path will be determined from the components declared name. However, it can be set programmatically as well.

      Parameters:
      bindingPath - the binding path, for ex. "invoiceNumber", null if autobinding
      See Also:
    • getBindingPath

      String getBindingPath()
      Gets the binding path.
      Returns:
      the field path, null if autobinding (default)
    • setComponentPath

      void setComponentPath(String componentPath)
      Sets the component path.

      The path is <declaring-class-name>.<field-name>. Example "de.krake.invoicer.InvoicePanel.customerNumberField".

      Notice: the component path is set during binding.

      Parameters:
      componentPath - the component path
    • getComponentPath

      String getComponentPath()
      Gets the component path.
      Returns:
      the component path, null if not bound
    • setBinding

      void setBinding(FxComponentBinding binding)
      Sets the binding.
      Parameters:
      binding - the binding, null if none.
    • getBinding

      FxComponentBinding getBinding()
      Gets the binding.
      Returns:
      the binding, null if none
    • isModelUpdated

      boolean isModelUpdated()
      Returns whether model was updated and FxControl.updateView() not invoked since then.
      Some components, such as FxTableView, never update the model because this is already done by the ObservableList. On those cases, false will be returned.
      Returns:
      true if updateView could make sense
    • setTableCell

      void setTableCell(FxTableCell<?,?> tableCell)
      Sets the table cell if the component is used as a table cell editor.
      Parameters:
      tableCell - the cell, null to disconnect from table cell
    • getTableCell

      FxTableCell<?,?> getTableCell()
      Gets the table cell if the component is used as a table cell editor.
      Returns:
      the cell, null if not a cell editor
    • setTreeTableCell

      void setTreeTableCell(FxTreeTableCell<?,?> treeTableCell)
      Sets the treetable cell if the component is used as a treetable cell editor.
      Parameters:
      treeTableCell - the cell, null to disconnect from treetable cell
    • getTreeTableCell

      FxTreeTableCell<?,?> getTreeTableCell()
      Gets the treetable cell if the component is used as a treetable cell editor.
      Returns:
      the cell, null if not a cell editor
    • isCellEditor

      default boolean isCellEditor()
      Returns whether this component is a table- or treetable cell editor.
      Returns:
      true if cell editor
    • isListenerSuppressedIfModelUnchanged

      boolean isListenerSuppressedIfModelUnchanged()
      Returns whether the ViewToModelListeners should be invoked even if the model's value did not change at all.
      By default, the listener will always be invoked.
      Returns:
      true if suppress invocation
    • setListenerSuppressedIfModelUnchanged

      void setListenerSuppressedIfModelUnchanged(boolean listenerSuppressedIfModelUnchanged)
      Sets whether the ViewToModelListeners should be invoked even if the model's value did not change at all.
      Parameters:
      listenerSuppressedIfModelUnchanged - true if suppress invocation
    • isListenerSuppressedIfViewUnchanged

      boolean isListenerSuppressedIfViewUnchanged()
      Returns whether the ModelToViewListeners should be invoked even if the view's value will not change at all.
      By default, the listener will always be invoked.
      Returns:
      true if suppress invocation
    • setListenerSuppressedIfViewUnchanged

      void setListenerSuppressedIfViewUnchanged(boolean listenerSuppressedIfViewUnchanged)
      Sets whether the ModelToViewListeners should be invoked even if the view's value will not change at all.
      Parameters:
      listenerSuppressedIfViewUnchanged - true if suppress invocation