-
- 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FxComponentBindinggetBinding()Gets the binding.java.lang.StringgetBindingPath()Gets the binding path.java.lang.StringgetComponentPath()Gets the component path.FxComponentDelegategetDelegate()Gets the lazily created component delegate.java.lang.reflect.TypegetGenericType()Gets the generic type.java.lang.ObjectgetSavedViewObject()Retrieves the view value saved withFxControl.saveView().
The returned type is the internal native type of the component.FxTableCell<?,?>getTableCell()Gets the table cell if the component is used as a table cell editor.java.lang.Class<?>getType()Gets the type this component returns viagetViewValue().ValueTranslator<?,?>getValueTranslator()Gets the value translator.java.lang.ObjectgetViewObject()Retrieves the internal native object of the component.<V> VgetViewValue()Retrieves the value from this component.
The value's type is that of the model.booleanisMandatory()Gets the mandatory option.booleanisModelUpdated()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.booleanisSavedViewObjectValid()Returns whether the view object is saved.javafx.beans.property.BooleanPropertymandatoryProperty()Gets the mandatory property.voidsetBinding(FxComponentBinding binding)Sets the binding.voidsetBindingPath(java.lang.String bindingPath)Sets the path to bind this component to.voidsetComponentPath(java.lang.String componentPath)Sets the component path.voidsetGenericType(java.lang.reflect.Type genericType)Sets the generic type.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.voidsetType(java.lang.Class<?> type)Sets the type for this component.voidsetValueTranslator(ValueTranslator<?,?> valueTranslator)Sets a value translator.voidsetViewObject(java.lang.Object viewObject)Sets the internal native object of the component.voidsetViewValue(java.lang.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, showErrorPopup
-
Methods inherited from interface org.tentackle.fx.FxControl
addModelToViewListener, addViewToModelListener, changeableProperty, getHelpUrl, getParentContainer, invalidateSavedView, isBindable, isChangeable, isContainerChangeableIgnored, isViewModified, removeModelToViewListener, removeViewToModelListener, saveView, setBindable, setChangeable, setContainerChangableIgnored, setContainerChangeable, setHelpUrl, setViewModified, showHelp, toGenericString, triggerViewModified, updateModel, updateView, viewModifiedProperty
-
Methods inherited from interface org.tentackle.fx.InfoPopupSupported
getInfo, hideInfoPopup, setInfo, showInfoPopup
-
-
-
-
Method Detail
-
getDelegate
FxComponentDelegate getDelegate()
Description copied from interface:FxControlGets the lazily created component delegate.- Specified by:
getDelegatein interfaceFxControl- Returns:
- the delegate
-
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 viagetViewValue().- 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 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.- 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
-
-