Interface FxComponent

    • Method Detail

      • setType

        void setType​(java.lang.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 memleaks.

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

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

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

        java.lang.reflect.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​(java.lang.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

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

        void setViewObject​(java.lang.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

        java.lang.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.
        Returns:
        the property
      • setBindingPath

        void setBindingPath​(java.lang.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 programatically as well.

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

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

        void setComponentPath​(java.lang.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

        java.lang.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 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