java.lang.Object
org.tentackle.fx.FxControlDelegate
- All Implemented Interfaces:
FxControl
- Direct Known Subclasses:
FxComponentDelegate,FxContainerDelegate
Base implementation for all fx delegates.
- Author:
- harald
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyBooleanPropertyThe changeable property in fact is a read-write property, but exported as readonly.javafx.beans.property.BooleanPropertyGets the viewModified property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelToViewListener(ModelToViewListener listener) 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.voidaddViewToModelListener(ViewToModelListener listener) 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.javafx.beans.property.ReadOnlyBooleanPropertyThe changeable property in fact is a read-write property, but exported as readonly.protected javafx.beans.property.ReadOnlyBooleanWrappercreateChangeableProperty(boolean changeable) Creates the changeable property.voidFires all model-to-view listeners.voidFires all model-to-view listeners.Gets the lazily created component delegate.Gets the online-help URL.Gets the model-to-view listeners with lazy collection creation.Gets the view-to-model listeners with lazy collection creation.booleanDetermines whether this container is bindable.booleanGets the value of the property changeable.booleanReturns whether setContainerChangeable is ignored by this control.protected booleanGets the last intended changeability for this control.
Might differ from effective changeability if container changed its changeability.booleanGets the value of the property viewModified.voidremoveModelToViewListener(ModelToViewListener listener) Removes a model-to-view listener.voidremoveViewToModelListener(ViewToModelListener listener) Removes a view-to-model listener.voidsetBindable(boolean bindable) Sets whether this control is bindable, i.e.voidsetChangeable(boolean changeable) Sets the value of the property changeable.voidsetContainerChangeableIgnored(boolean containerChangeableIgnored) Sets whether to ignore setContainerChangeable.voidsetHelpUrl(String helpUrl) 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.voidsetViewModified(boolean viewModified) Sets the value of the property viewModified.voidshowHelp()Displays online help if configured.protected voidupdateChangeable(boolean changeable) Updates other properties if changeable is bound to something else.javafx.beans.property.BooleanPropertyGets the viewModified property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.fx.FxControl
getParentContainer, invalidateSavedView, saveView, setContainerChangeable, toGenericString, triggerViewModified, updateModel, updateView
-
Property Details
-
viewModified
public javafx.beans.property.BooleanProperty viewModifiedProperty- Specified by:
viewModifiedPropertyin interfaceFxControl- See Also:
-
changeable
public javafx.beans.property.ReadOnlyBooleanProperty changeablePropertyThe changeable property in fact is a read-write property, but exported as readonly.- Specified by:
changeablePropertyin interfaceFxControl- See Also:
-
-
Constructor Details
-
FxControlDelegate
public FxControlDelegate()Creates a control delegate.
-
-
Method Details
-
getDelegate
Description copied from interface:FxControlGets the lazily created component delegate.- Specified by:
getDelegatein interfaceFxControl- Returns:
- the delegate
-
setViewModified
public void setViewModified(boolean viewModified) Sets the value of the property viewModified.- Specified by:
setViewModifiedin interfaceFxControl- 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:
isViewModifiedin interfaceFxControl- Property description:
- Returns:
- true if user changed the visual representation
-
viewModifiedProperty
public javafx.beans.property.BooleanProperty viewModifiedProperty()Description copied from interface:FxControlGets the viewModified property.- Specified by:
viewModifiedPropertyin interfaceFxControl- See Also:
-
setChangeable
public void setChangeable(boolean changeable) Sets the value of the property changeable.- Specified by:
setChangeablein interfaceFxControl- 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:
isChangeablein interfaceFxControl- 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:
changeablePropertyin interfaceFxControl- 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:FxControlSets whether to ignore setContainerChangeable.- Specified by:
setContainerChangeableIgnoredin interfaceFxControl- Parameters:
containerChangeableIgnored- true if ignore, default is false
-
isContainerChangeableIgnored
public boolean isContainerChangeableIgnored()Description copied from interface:FxControlReturns whether setContainerChangeable is ignored by this control.- Specified by:
isContainerChangeableIgnoredin interfaceFxControl- Returns:
- true if ignore
-
setBindable
public void setBindable(boolean bindable) Description copied from interface:FxControlSets whether this control is bindable, i.e. should be checked within a binding hierarchy.- Specified by:
setBindablein interfaceFxControl- Parameters:
bindable- true if bindable, else not eligible for the binding process
-
isBindable
public boolean isBindable()Description copied from interface:FxControlDetermines whether this container is bindable.- Specified by:
isBindablein interfaceFxControl- Returns:
- true if bindable, else not eligible for the binding process
-
setHelpUrl
Description copied from interface:FxControlSets 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:
setHelpUrlin interfaceFxControl- Parameters:
helpUrl- the help url
-
getHelpUrl
Description copied from interface:FxControlGets the online-help URL.- Specified by:
getHelpUrlin interfaceFxControl- Returns:
- the help url, default is null
-
showHelp
public void showHelp()Description copied from interface:FxControlDisplays online help if configured. -
addModelToViewListener
Description copied from interface:FxControlAdds 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:
addModelToViewListenerin interfaceFxControl- Parameters:
listener- the value listener to add
-
removeModelToViewListener
Description copied from interface:FxControlRemoves a model-to-view listener.- Specified by:
removeModelToViewListenerin interfaceFxControl- Parameters:
listener- the value listener to remove
-
addViewToModelListener
Description copied from interface:FxControlAdds 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:
addViewToModelListenerin interfaceFxControl- Parameters:
listener- the value listener to add
-
removeViewToModelListener
Description copied from interface:FxControlRemoves a view-to-model listener.- Specified by:
removeViewToModelListenerin interfaceFxControl- Parameters:
listener- the value listener to remove
-
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
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.
-