Package io.jmix.dynattrflowui.panel
Class DynamicAttributesPanel
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
io.jmix.dynattrflowui.panel.DynamicAttributesPanel
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,ComponentContainer,Serializable
public class DynamicAttributesPanel
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
implements com.vaadin.flow.component.HasSize, ComponentContainer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JmixComboBox<Category>protected com.vaadin.flow.component.orderedlayout.VerticalLayoutprotected com.vaadin.flow.component.html.H3static final Stringprotected final DynAttrMetadataprotected Stringprotected InstanceContainer<?>protected final Messagesstatic final Stringprotected JmixFormLayoutprotected com.vaadin.flow.component.orderedlayout.VerticalLayoutprotected final UiComponentsprotected final UiComponentsGeneratorprotected final ViewValidation -
Constructor Summary
ConstructorsConstructorDescriptionDynamicAttributesPanel(UiComponentsGenerator uiComponentsGenerator, UiComponents uiComponents, Messages messages, DynAttrMetadata dynAttrMetadata, ViewValidation viewValidation) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFieldsToForm(com.vaadin.flow.component.formlayout.FormLayout newPropertiesForm, Map<AttributeDefinition, com.vaadin.flow.component.Component> fields) Optional<com.vaadin.flow.component.Component>Finds a component within immediate children of the container by its unique identifier.protected com.vaadin.flow.component.ComponentgenerateFieldComponent(AttributeDefinition attribute) protected Collection<AttributeDefinition>protected Collection<CategoryDefinition>protected CategoryCollection<com.vaadin.flow.component.Component>Returns a collection of components that are direct children (immediate descendants) of the container.protected voidinitCategoryField(InstanceContainer<?> instanceContainer) protected com.vaadin.flow.component.orderedlayout.VerticalLayoutprotected voidprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidprotected voidonValidation(StandardDetailView.ValidationEvent validationEvent) voidsetCategoryFieldVisible(boolean visible) Sets the visibility of the category field.voidsetFieldWidth(String fieldWidth) Sets the width of the fields.voidsetInstanceContainer(InstanceContainer<Object> container) Defines InstanceContainer for DynamicAttributesPanel.protected voidsetWidth(com.vaadin.flow.component.Component component, AttributeDefinition attribute) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface io.jmix.flowui.component.ComponentContainer
findComponent, getComponent, getComponents, getOwnComponentMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
NAME
- See Also:
-
DEFAULT_FIELD_WIDTH
-
uiComponentsGenerator
-
uiComponents
-
messages
-
dynAttrMetadata
-
viewValidation
-
instanceContainer
-
fieldWidth
-
rootPanel
protected com.vaadin.flow.component.orderedlayout.VerticalLayout rootPanel -
categoryFieldBox
protected com.vaadin.flow.component.orderedlayout.VerticalLayout categoryFieldBox -
categoryFieldLabel
protected com.vaadin.flow.component.html.H3 categoryFieldLabel -
categoryField
-
propertiesForm
-
-
Constructor Details
-
DynamicAttributesPanel
public DynamicAttributesPanel(UiComponentsGenerator uiComponentsGenerator, UiComponents uiComponents, Messages messages, DynAttrMetadata dynAttrMetadata, ViewValidation viewValidation)
-
-
Method Details
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onValidation
-
initContent
protected com.vaadin.flow.component.orderedlayout.VerticalLayout initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
-
initPropertiesForm
protected void initPropertiesForm() -
addFieldsToForm
protected void addFieldsToForm(com.vaadin.flow.component.formlayout.FormLayout newPropertiesForm, Map<AttributeDefinition, com.vaadin.flow.component.Component> fields) -
getAttributesByCategory
-
generateFieldComponent
-
setWidth
protected void setWidth(com.vaadin.flow.component.Component component, AttributeDefinition attribute) -
initCategoryField
-
getDefaultCategory
-
getCategoryDefinitions
-
getCategoriesOptionsList
-
onInstanceContainerItemChangeEvent
-
findOwnComponent
Description copied from interface:ComponentContainerFinds a component within immediate children of the container by its unique identifier.- Specified by:
findOwnComponentin interfaceComponentContainer- Parameters:
id- the unique identifier of the component to find- Returns:
- an
Optionalcontaining the found component if it exists within the immediate children of the container, or an emptyOptionalif no component with the given identifier is found
-
getOwnComponents
Description copied from interface:ComponentContainerReturns a collection of components that are direct children (immediate descendants) of the container.- Specified by:
getOwnComponentsin interfaceComponentContainer- Returns:
- a collection of
Componentinstances representing the immediate children of the container, or an empty collection if no such components exist
-
setCategoryFieldVisible
public void setCategoryFieldVisible(boolean visible) Sets the visibility of the category field.- Parameters:
visible- true to make the category field visible, false otherwise
-
setInstanceContainer
Defines InstanceContainer for DynamicAttributesPanel.- Parameters:
container-InstanceContainerobject with editing entity
-
setFieldWidth
Sets the width of the fields. This parameter is used if some dynamic attribute does not have own width value.- Parameters:
fieldWidth- width of the fields
-