- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- javafx.scene.control.ToolBar
-
- org.tentackle.fx.container.FxToolBar
-
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,javafx.scene.control.Skinnable,FxContainer,FxControl
public class FxToolBar extends javafx.scene.control.ToolBar implements FxContainer
Extended ToolBar.- Author:
- harald
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddModelToViewListener(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.ReadOnlyBooleanPropertychangeableProperty()Gets the changaeble property.voidclearErrors()Clears all error messages in all components.protected FxToolBarDelegatecreateDelegate()Creates the delegate.javafx.collections.ObservableList<?>getComponents()Gets the fx components maintained by this container.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.FxToolBarDelegategetDelegate()Gets the lazily created component delegate.java.lang.StringgetHelpUrl()Gets the online-help URL.FxContainergetParentContainer()Gets the parent container.voidinvalidateSavedView()Invalidates the saved view.booleanisBindable()Determines whether this container is bindable.booleanisChangeable()Returns if this control is changeable.booleanisContainerChangeableIgnored()Returns whether setContainerChangeable is ignored by this control.booleanisViewModified()Returns whether the user has modified the view since the lastFxControl.updateView().voidremoveModelToViewListener(ModelToViewListener listener)Removes a model-to-view listener.voidremoveViewToModelListener(ViewToModelListener listener)Removes a view-to-model listener.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.voidsetContainerChangableIgnored(boolean containerChangeableIgnored)Sets whether to ignore setContainerChangeable.voidsetContainerChangeable(boolean containerChangeable)Invoked when setChangeable() is invoked on the container of this component.voidsetController(FxController controller)Sets the controller of this container.voidsetHelpUrl(java.lang.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 whether the view has been modified.voidshowHelp()Displays online help if configured.java.lang.StringtoGenericString()Returns the classname plus optional fx:id.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.javafx.beans.property.BooleanPropertyviewModifiedProperty()Gets the viewModified property.-
Methods inherited from class javafx.scene.control.ToolBar
createDefaultSkin, getClassCssMetaData, getControlCssMetaData, getInitialFocusTraversable, getItems, getOrientation, orientationProperty, setOrientation
-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
-
-
-
Method Detail
-
createDelegate
protected FxToolBarDelegate createDelegate()
Creates the delegate.- Returns:
- the delegate
-
getDelegate
public FxToolBarDelegate getDelegate()
Description copied from interface:FxControlGets the lazily created component delegate.- Specified by:
getDelegatein interfaceFxControl- Returns:
- the delegate
-
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
-
getComponents
public javafx.collections.ObservableList<?> getComponents()
Description copied from interface:FxContainerGets the fx components maintained by this container.- Specified by:
getComponentsin interfaceFxContainer- Returns:
- list of components
-
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- Parameters:
changeable- true the user can edit the data, false if show only
-
isChangeable
public boolean isChangeable()
Description copied from interface:FxControlReturns if this control is changeable.- Specified by:
isChangeablein interfaceFxControl- Returns:
- 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
-
setContainerChangableIgnored
public void setContainerChangableIgnored(boolean containerChangeableIgnored)
Description copied from interface:FxControlSets whether to ignore setContainerChangeable.- Specified by:
setContainerChangableIgnoredin 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
-
changeableProperty
public javafx.beans.property.ReadOnlyBooleanProperty changeableProperty()
Description copied from interface:FxControlGets the changaeble property.- Specified by:
changeablePropertyin interfaceFxControl- Returns:
- the property
-
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
-
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
-
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
-
setViewModified
public void setViewModified(boolean viewModified)
Description copied from interface:FxControlSets whether the view has been modified.- Specified by:
setViewModifiedin interfaceFxControl- Parameters:
viewModified- true if user has modified the visual representation
-
isViewModified
public boolean isViewModified()
Description copied from interface:FxControlReturns whether the user has modified the view since the lastFxControl.updateView().- Specified by:
isViewModifiedin interfaceFxControl- 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- Returns:
- the property
-
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
public void setHelpUrl(java.lang.String helpUrl)
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
public java.lang.String 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.
-
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
-
clearErrors
public void clearErrors()
Description copied from interface:FxContainerClears all error messages in all components.- Specified by:
clearErrorsin interfaceFxContainer
-
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
-
addModelToViewListener
public void addModelToViewListener(ModelToViewListener listener)
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
public void removeModelToViewListener(ModelToViewListener listener)
Description copied from interface:FxControlRemoves a model-to-view listener.- Specified by:
removeModelToViewListenerin interfaceFxControl- Parameters:
listener- the value listener to remove
-
addViewToModelListener
public void addViewToModelListener(ViewToModelListener listener)
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
public void removeViewToModelListener(ViewToModelListener listener)
Description copied from interface:FxControlRemoves a view-to-model listener.- Specified by:
removeViewToModelListenerin interfaceFxControl- Parameters:
listener- the value listener to remove
-
-