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
,Serializable
public class DynamicAttributesPanel
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
implements com.vaadin.flow.component.HasSize
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected JmixComboBox<Category>
protected com.vaadin.flow.component.orderedlayout.VerticalLayout
protected com.vaadin.flow.component.html.H3
static final String
protected final DynAttrMetadata
protected String
protected InstanceContainer<?>
protected final Messages
static final String
protected JmixFormLayout
protected com.vaadin.flow.component.orderedlayout.VerticalLayout
protected final UiComponents
protected final UiComponentsGenerator
protected final ViewValidation
-
Constructor Summary
ConstructorDescriptionDynamicAttributesPanel
(UiComponentsGenerator uiComponentsGenerator, UiComponents uiComponents, Messages messages, DynAttrMetadata dynAttrMetadata, ViewValidation viewValidation) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFieldsToForm
(com.vaadin.flow.component.formlayout.FormLayout newPropertiesForm, Map<AttributeDefinition, com.vaadin.flow.component.Component> fields) protected com.vaadin.flow.component.Component
generateFieldComponent
(AttributeDefinition attribute) protected Collection<AttributeDefinition>
protected Collection<CategoryDefinition>
protected Category
protected void
initCategoryField
(InstanceContainer<?> instanceContainer) protected com.vaadin.flow.component.orderedlayout.VerticalLayout
protected void
protected void
onAttach
(com.vaadin.flow.component.AttachEvent attachEvent) protected void
protected void
onValidation
(StandardDetailView.ValidationEvent validationEvent) void
setCategoryFieldVisible
(boolean visible) Sets the visibility of the category field.void
setFieldWidth
(String fieldWidth) Sets the width of the fields.void
setInstanceContainer
(InstanceContainer<Object> container) Defines InstanceContainer for DynamicAttributesPanel.protected void
setWidth
(com.vaadin.flow.component.Component component, AttributeDefinition attribute) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods 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, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods 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, setWidthFull
Methods 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:
onAttach
in classcom.vaadin.flow.component.Component
-
onValidation
-
initContent
protected com.vaadin.flow.component.orderedlayout.VerticalLayout initContent()- Overrides:
initContent
in 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
-
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
-InstanceContainer
object 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
-