- java.lang.Object
-
- org.tentackle.fx.FxControlDelegate
-
- org.tentackle.fx.FxContainerDelegate
-
- All Implemented Interfaces:
FxContainer,FxControl
- Direct Known Subclasses:
FxAccordionDelegate,FxAnchorPaneDelegate,FxBorderPaneDelegate,FxButtonBarDelegate,FxDialogPaneDelegate,FxFlowPaneDelegate,FxGridPaneDelegate,FxHBoxDelegate,FxPaneDelegate,FxScrollPaneDelegate,FxSplitPaneDelegate,FxStackPaneDelegate,FxTabDelegate,FxTabPaneDelegate,FxTextFlowDelegate,FxTilePaneDelegate,FxTitledPaneDelegate,FxToolBarDelegate,FxVBoxDelegate
public abstract class FxContainerDelegate extends FxControlDelegate implements FxContainer
Delegate implementing FxContainer.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description FxContainerDelegate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclearErrors()Clears all error messages in all components.abstract FxContainergetContainer()Gets the container of this delegate.FxControllergetController()Gets the controller of this container.<C extends FxController>
CgetController(java.lang.Class<C> clazz)Gets the controller along the parent hierarchy that is an instanceof the given class.javafx.scene.NodegetNode()Gets the container as a node.FxContainergetParentContainer()Gets the parent container.voidinvalidateSavedView()Invalidates the saved view.voidsaveView()Creates a copy of the value shown to the user.voidsetBindable(boolean bindable)Sets whether this control is bindable, i.e.voidsetChangeable(boolean changeable)Set the control to be changeable.
This is a unified abstraction and will be translated to setEditable or setDisabled, whatever is appropriate to this control.voidsetContainerChangeable(boolean containerChangeable)Invoked when setChangeable() is invoked on the container of this component.protected voidsetContainerChangeable(java.util.List<?> components, boolean changeable)Updates the container changeable flag of all components.voidsetController(FxController controller)Sets the controller of this container.java.lang.StringtoGenericString()Returns the classname plus optional fx:id.java.lang.StringtoString()voidtriggerViewModified()Walks up the component hierarchy and updates the viewModified property.
This is done by comparing the saved view value with the current view.voidupdateModel()Updates the model according to the view.voidupdateView()Updates the view according to the model.voidupdateViewNonFocused()Updates the view according to the model.
The method is the same asFxControl.updateView()but skips any focused component.-
Methods inherited from class org.tentackle.fx.FxControlDelegate
addModelToViewListener, addViewToModelListener, changeableProperty, createChangeableProperty, fireModelToViewListeners, fireViewToModelListeners, getDelegate, getHelpUrl, getModelToViewListeners, getViewToModelListeners, isBindable, isChangeable, isContainerChangeableIgnored, isControlChangeable, isViewModified, removeModelToViewListener, removeViewToModelListener, setContainerChangableIgnored, setHelpUrl, setViewModified, showHelp, updateChangeable, viewModifiedProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tentackle.fx.FxContainer
getComponents
-
Methods inherited from interface org.tentackle.fx.FxControl
addModelToViewListener, addViewToModelListener, changeableProperty, getDelegate, getHelpUrl, isBindable, isChangeable, isContainerChangeableIgnored, isViewModified, removeModelToViewListener, removeViewToModelListener, setContainerChangableIgnored, setHelpUrl, setViewModified, showHelp, viewModifiedProperty
-
-
-
-
Method Detail
-
getContainer
public abstract FxContainer getContainer()
Gets the container of this delegate.- Returns:
- the container
-
getParentContainer
public FxContainer getParentContainer()
Description copied from interface:FxControlGets the parent container.- Specified by:
getParentContainerin interfaceFxControl- Returns:
- the parent, null if not a component of a container
-
getController
public FxController getController()
Description copied from interface:FxContainerGets the controller of this container.- Specified by:
getControllerin interfaceFxContainer- Returns:
- the controller, null if nested container without a controller
-
setController
public void setController(FxController controller)
Description copied from interface:FxContainerSets the controller of this container.- Specified by:
setControllerin interfaceFxContainer- Parameters:
controller- the controller, null if nested container without a controller
-
getController
public <C extends FxController> C getController(java.lang.Class<C> clazz)
Description copied from interface:FxContainerGets the controller along the parent hierarchy that is an instanceof the given class.- Specified by:
getControllerin interfaceFxContainer- Type Parameters:
C- the controller type- Parameters:
clazz- the controller class- Returns:
- the controller, null if no such controller
-
toGenericString
public java.lang.String toGenericString()
Description copied from interface:FxControlReturns the classname plus optional fx:id.- Specified by:
toGenericStringin interfaceFxControl- Returns:
- the generic string for diagnostics and logging
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getNode
public javafx.scene.Node getNode()
Gets the container as a node.- Returns:
- the node
-
updateViewNonFocused
public void updateViewNonFocused()
Description copied from interface:FxContainerUpdates the view according to the model.
The method is the same asFxControl.updateView()but skips any focused component.- Specified by:
updateViewNonFocusedin interfaceFxContainer
-
updateView
public void updateView()
Description copied from interface:FxControlUpdates the view according to the model.- Specified by:
updateViewin interfaceFxControl
-
updateModel
public void updateModel()
Description copied from interface:FxControlUpdates the model according to the view.- Specified by:
updateModelin interfaceFxControl
-
triggerViewModified
public void triggerViewModified()
Description copied from interface:FxControlWalks up the component hierarchy and updates the viewModified property.
This is done by comparing the saved view value with the current view.- Specified by:
triggerViewModifiedin interfaceFxControl
-
saveView
public void saveView()
Description copied from interface:FxControlCreates a copy of the value shown to the user.
-
invalidateSavedView
public void invalidateSavedView()
Description copied from interface:FxControlInvalidates the saved view.- Specified by:
invalidateSavedViewin interfaceFxControl
-
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- Overrides:
setBindablein classFxControlDelegate- Parameters:
bindable- true if bindable, else not eligible for the binding process
-
setChangeable
public void setChangeable(boolean changeable)
Description copied from interface:FxControlSet the control to be changeable.
This is a unified abstraction and will be translated to setEditable or setDisabled, whatever is appropriate to this control.- Specified by:
setChangeablein interfaceFxControl- Overrides:
setChangeablein classFxControlDelegate- Parameters:
changeable- true the user can edit the data, false if show only
-
setContainerChangeable
public void setContainerChangeable(boolean containerChangeable)
Description copied from interface:FxControlInvoked when setChangeable() is invoked on the container of this component.- Specified by:
setContainerChangeablein interfaceFxControl- Parameters:
containerChangeable- true if container is changeable, false if all components readonly
-
setContainerChangeable
protected void setContainerChangeable(java.util.List<?> components, boolean changeable)Updates the container changeable flag of all components.- Parameters:
components- the componentschangeable- true if changeable
-
clearErrors
public void clearErrors()
Description copied from interface:FxContainerClears all error messages in all components.- Specified by:
clearErrorsin interfaceFxContainer
-
-