- 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
Interface all tentackle Fx components must implement.
- Author:
- harald
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.BooleanPropertyGets the mandatory property.Properties inherited from interface org.tentackle.fx.FxControl
changeable, viewModified -
Method Summary
Modifier and TypeMethodDescriptionGets the binding.Gets the binding path.Gets the component path.Gets the lazily created component delegate.Gets the generic type.Retrieves the view value saved withFxControl.saveView().
The returned type is the internal native type of the component.FxTableCell<?,?> Gets the table cell if the component is used as a table cell editor.FxTreeTableCell<?,?> Gets the treetable cell if the component is used as a treetable cell editor.Class<?>getType()Gets the type this component returns viagetViewValue().ValueTranslator<?,?> Gets the value translator.Retrieves the internal native object of the component.<V> VRetrieves the value from this component.
The value's type is that of the model.default booleanReturns whether this component is a table- or treetable cell editor.booleanReturns whether theViewToModelListeners should be invoked even if the model's value did not change at all.
By default, the listener will always be invoked.booleanReturns whether theModelToViewListeners should be invoked even if the view's value will not change at all.
By default, the listener will always be invoked.booleanGets the mandatory option.booleanReturns whether model was updated andFxControl.updateView()not invoked since then.
Some components, such as FxTableView, never update the model because this is already done by the ObservableList.booleanReturns whether the view object is saved.javafx.beans.property.BooleanPropertyGets the mandatory property.voidsetBinding(FxComponentBinding binding) Sets the binding.voidsetBindingPath(String bindingPath) Sets the path to bind this component to.voidsetComponentPath(String componentPath) Sets the component path.voidsetGenericType(Type genericType) Sets the generic type.voidsetListenerSuppressedIfModelUnchanged(boolean listenerSuppressedIfModelUnchanged) Sets whether theViewToModelListeners should be invoked even if the model's value did not change at all.voidsetListenerSuppressedIfViewUnchanged(boolean listenerSuppressedIfViewUnchanged) Sets whether theModelToViewListeners should be invoked even if the view's value will not change at all.voidsetMandatory(boolean mandatory) Sets the mandatory option.
Mandatory fields are differently visualized.voidsetTableCell(FxTableCell<?, ?> tableCell) Sets the table cell if the component is used as a table cell editor.voidsetTreeTableCell(FxTreeTableCell<?, ?> treeTableCell) Sets the treetable cell if the component is used as a treetable cell editor.voidSets the type for this component.voidsetValueTranslator(ValueTranslator<?, ?> valueTranslator) Sets a value translator.voidsetViewObject(Object viewObject) Sets the internal native object of the component.voidsetViewValue(Object value) Sets a value in this component.
The value's type is that of the model.Methods inherited from interface org.tentackle.fx.ErrorPopupSupported
getError, hideErrorPopup, isErrorTemporary, setError, setErrorTemporary, showErrorPopupMethods inherited from interface org.tentackle.fx.FxControl
addModelToViewListener, addViewToModelListener, changeableProperty, getHelpUrl, getParentContainer, invalidateSavedView, isBindable, isChangeable, isContainerChangeableIgnored, isViewModified, removeModelToViewListener, removeViewToModelListener, saveView, setBindable, setChangeable, setContainerChangeable, setContainerChangeableIgnored, setHelpUrl, setViewModified, showHelp, toGenericString, triggerViewModified, updateModel, updateView, viewModifiedPropertyMethods inherited from interface org.tentackle.fx.InfoPopupSupported
getInfo, hideInfoPopup, setInfo, showInfoPopup
-
Property Details
-
mandatory
javafx.beans.property.BooleanProperty mandatoryPropertyGets the mandatory property.- See Also:
-
-
Method Details
-
getDelegate
FxComponentDelegate getDelegate()Description copied from interface:FxControlGets the lazily created component delegate.- Specified by:
getDelegatein interfaceFxControl- Returns:
- the delegate
-
setType
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 viagetViewValue().- Returns:
- the type
-
setGenericType
Sets the generic type.- Parameters:
genericType- the generic type
-
getGenericType
Type getGenericType()Gets the generic type.- Returns:
- the generic type
-
setValueTranslator
Sets a value translator.- Parameters:
valueTranslator- the translator
-
getValueTranslator
ValueTranslator<?,?> getValueTranslator()Gets the value translator.- Returns:
- the translator
-
setViewValue
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
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 withFxControl.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
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
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
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 andFxControl.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
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
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 theViewToModelListeners 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 theViewToModelListeners 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 theModelToViewListeners 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 theModelToViewListeners should be invoked even if the view's value will not change at all.- Parameters:
listenerSuppressedIfViewUnchanged- true if suppress invocation
-