- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.layout.Pane
-
- javafx.scene.layout.BorderPane
-
- is.codion.javafx.framework.ui.EntityEditView
-
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
public abstract class EntityEditView extends javafx.scene.layout.BorderPane
A View for editing entity instances
-
-
Constructor Summary
Constructors Constructor Description EntityEditView(FXEntityEditModel editModel)
Instantiates a newEntityEditView
instance
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description javafx.scene.Node
createButtonPanel()
protected javafx.scene.control.DatePicker
createDatePicker(Attribute<LocalDate> attribute)
Creates aDatePicker
for the given attribute, assuming the property is date basedprotected javafx.scene.control.ComboBox<Entity>
createForeignKeyComboBox(ForeignKey foreignKey)
Creates aComboBox
based on the entities referenced by the given foreign keyprotected EntitySearchField
createForeignKeySearchField(ForeignKey foreignKey)
Creates aEntitySearchField
based on the entities referenced by the given foreign keyprotected javafx.scene.layout.BorderPane
createInputPanel(Attribute<?> attribute)
protected <T> javafx.scene.control.ComboBox<Item<T>>
createItemComboBox(Attribute<T> attribute)
Creates aComboBox
based on the items of the given propertyprotected javafx.scene.control.Label
createLabel(Attribute<?> attribute)
Creates aLabel
with caption associated with the given attributeprotected <T> javafx.scene.control.TextField
createTextField(Attribute<T> attribute)
Creates aTextField
for the given attributeFXEntityEditModel
editModel()
void
excludeControlsFromSelection(Attribute<?>... attributes)
Specifies that the given attributes should be excluded when presenting a control selection list.protected abstract javafx.scene.Node
initializeEditPanel()
EntityEditView
initializePanel()
Initializes this edit viewvoid
requestInitialFocus()
Transfers focus to the component associated with the initial focus propertyvoid
selectInputControl()
Displays a dialog for choosing an input control to receive focusvoid
setAfterInsertFocusAttribute(Attribute<?> afterInsertFocusAttribute)
Sets the given property as the property which component should receive focus after an insert has been performedvoid
setInitialFocusAttribute(Attribute<?> initialFocusAttribute)
Sets the given attribute as the attribute which component should receive focus when this edit view is initializedvoid
setRequestFocusAfterInsert(boolean requestFocusAfterInsert)
protected void
validateData()
for overriding, called before insert/update-
Methods inherited from class javafx.scene.layout.BorderPane
bottomProperty, centerProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getBottom, getCenter, getContentBias, getLeft, getMargin, getRight, getTop, layoutChildren, leftProperty, rightProperty, setAlignment, setBottom, setCenter, setLeft, setMargin, setRight, setTop, topProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, 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
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, 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, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, 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
-
-
-
-
Constructor Detail
-
EntityEditView
public EntityEditView(FXEntityEditModel editModel)
Instantiates a newEntityEditView
instance- Parameters:
editModel
- the edit model to base this edit view on
-
-
Method Detail
-
initializePanel
public final EntityEditView initializePanel()
Initializes this edit view- Returns:
- the initialized view
-
editModel
public final FXEntityEditModel editModel()
- Returns:
- the underlying edit model
-
requestInitialFocus
public final void requestInitialFocus()
Transfers focus to the component associated with the initial focus property- See Also:
setInitialFocusAttribute(Attribute)
-
createButtonPanel
public final javafx.scene.Node createButtonPanel()
- Returns:
- the button panel for this edit view
-
selectInputControl
public final void selectInputControl()
Displays a dialog for choosing an input control to receive focus
-
excludeControlsFromSelection
public final void excludeControlsFromSelection(Attribute<?>... attributes)
Specifies that the given attributes should be excluded when presenting a control selection list.- Parameters:
attributes
- the attributes to exclude from selection- See Also:
selectInputControl()
-
setInitialFocusAttribute
public final void setInitialFocusAttribute(Attribute<?> initialFocusAttribute)
Sets the given attribute as the attribute which component should receive focus when this edit view is initialized- Parameters:
initialFocusAttribute
- the attribute
-
setAfterInsertFocusAttribute
public final void setAfterInsertFocusAttribute(Attribute<?> afterInsertFocusAttribute)
Sets the given property as the property which component should receive focus after an insert has been performed- Parameters:
afterInsertFocusAttribute
- the attribute
-
setRequestFocusAfterInsert
public void setRequestFocusAfterInsert(boolean requestFocusAfterInsert)
- Parameters:
requestFocusAfterInsert
- if true then the input focus is set after insert- See Also:
setInitialFocusAttribute(Attribute)
-
initializeEditPanel
protected abstract javafx.scene.Node initializeEditPanel()
- Returns:
- the edit view containing the input components
-
validateData
protected void validateData() throws ValidationException
for overriding, called before insert/update- Throws:
ValidationException
- in case of a validation failure
-
createForeignKeySearchField
protected final EntitySearchField createForeignKeySearchField(ForeignKey foreignKey)
Creates aEntitySearchField
based on the entities referenced by the given foreign key- Parameters:
foreignKey
- the foreign key- Returns:
- a
EntitySearchField
based on the given foreign key
-
createForeignKeyComboBox
protected final javafx.scene.control.ComboBox<Entity> createForeignKeyComboBox(ForeignKey foreignKey)
Creates aComboBox
based on the entities referenced by the given foreign key- Parameters:
foreignKey
- the foreign key- Returns:
- a
ComboBox
based on the given foreign key
-
createItemComboBox
protected final <T> javafx.scene.control.ComboBox<Item<T>> createItemComboBox(Attribute<T> attribute)
Creates aComboBox
based on the items of the given property- Type Parameters:
T
- the property type- Parameters:
attribute
- the attribute- Returns:
- a
ComboBox
for the given property
-
createTextField
protected final <T> javafx.scene.control.TextField createTextField(Attribute<T> attribute)
Creates aTextField
for the given attribute- Type Parameters:
T
- the value type- Parameters:
attribute
- the attribute- Returns:
- a
TextField
for the given attribute
-
createDatePicker
protected final javafx.scene.control.DatePicker createDatePicker(Attribute<LocalDate> attribute)
Creates aDatePicker
for the given attribute, assuming the property is date based- Parameters:
attribute
- the attribute- Returns:
- a
DatePicker
based on the given attribute
-
createLabel
protected final javafx.scene.control.Label createLabel(Attribute<?> attribute)
Creates aLabel
with caption associated with the given attribute- Parameters:
attribute
- the attribute- Returns:
- a
Label
for the given attribute
-
createInputPanel
protected final javafx.scene.layout.BorderPane createInputPanel(Attribute<?> attribute)
-
-