Package io.jmix.dynattrui.panel
Class DynamicAttributesPanel
- All Implemented Interfaces:
AttachNotifier
,Component
,Component.BelongToFrame
,HasDebugId
,HasHtmlSanitizer
,HasMargin
,Validatable
@StudioComponent(category="Components",
unsupportedProperties={"enable","responsive"},
xmlns="http://jmix.io/schema/dynattr/ui",
xmlnsAlias="dynattr",
icon="io/jmix/dynattrui/icon/component/dynamicAttributesPanel.svg",
canvasIcon="io/jmix/dynattrui/icon/component/dynamicAttributesPanel_canvas.svg",
canvasIconSize=LARGE)
public class DynamicAttributesPanel
extends CompositeComponent<VBoxLayout>
implements Validatable, HasMargin
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.component.CompositeComponent
CompositeComponent.CreateEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
-
Field Summary
Modifier and TypeFieldDescriptionprotected HBoxLayout
protected Integer
static final String
protected DynAttrMetadata
protected String
protected String
protected InstanceContainer<?>
protected Messages
static final String
protected Form
protected Integer
protected UiComponents
protected UiComponentsGenerator
Fields inherited from class io.jmix.ui.component.CompositeComponent
applicationContext, frame, id, prefixId, root
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFieldsToForm
(Form newPropertiesForm, Map<AttributeDefinition, Component> fields) protected Component
generateFieldComponent
(AttributeDefinition attribute) protected Collection<AttributeDefinition>
protected Collection<CategoryDefinition>
protected Category
protected int
getRowsPerColumn
(int propertiesCount) protected void
initCategoryField
(InstanceContainer<?> instanceContainer) protected void
initFieldCaptionWidth
(Form newRuntimeForm) protected void
boolean
isValid()
protected void
onCreate
(CompositeComponent.CreateEvent createEvent) protected void
void
setCategoryFieldVisible
(boolean visible) Sets visibility of theCategoryField
component.void
setColumnsCount
(Integer cols) Sets the number of columns.void
setFieldCaptionWidth
(String fieldCaptionWidth) Sets the width of the fields caption.void
setFieldWidth
(String fieldWidth) Sets the width of the fields.void
setInstanceContainer
(InstanceContainer<Object> container) Defines InstanceContainer for DynamicAttributesPanel.void
setMargin
(MarginInfo marginInfo) void
setRowsCount
(Integer rows) Sets the number of rows.protected void
setWidth
(Component component, AttributeDefinition attribute) void
validate()
Methods inherited from class io.jmix.ui.component.CompositeComponent
addAttachListener, addCreateListener, addDetachListener, addStyleName, assignDebugId, attached, detached, disableEventListeners, enableEventListeners, getAlignment, getComposition, getCompositionOrNull, getDebugId, getEventHub, getFrame, getFullId, getHeight, getHeightSizeUnit, getId, getInnerComponent, getInnerComponentOptional, getParent, getPrefixId, getStyleName, getUiEventListeners, getWidth, getWidthSizeUnit, hasSubscriptions, isAttached, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, publish, removeStyleName, setAlignment, setApplicationContext, setComposition, setDebugId, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setId, setParent, setResponsive, setStyleName, setUiEventListeners, setVisible, setWidth, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, updateComponentIds, updateIdIfNeeded, withUnwrapped, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.ui.component.Component
setHeightAuto, setHeightFull, setSizeAuto, setSizeFull, setWidthAuto, setWidthFull
Methods inherited from interface io.jmix.ui.component.Validatable
isValidateOnCommit
-
Field Details
-
NAME
- See Also:
-
DEFAULT_FIELD_WIDTH
-
uiComponentsGenerator
-
uiComponents
-
messages
-
dynAttrMetadata
-
instanceContainer
-
cols
-
rows
-
fieldWidth
-
fieldCaptionWidth
-
propertiesForm
-
categoryFieldBox
-
categoryField
-
-
Constructor Details
-
DynamicAttributesPanel
public DynamicAttributesPanel()
-
-
Method Details
-
onCreate
-
initPropertiesForm
protected void initPropertiesForm() -
addFieldsToForm
-
getRowsPerColumn
protected int getRowsPerColumn(int propertiesCount) -
getAttributesByCategory
-
generateFieldComponent
-
setWidth
-
initCategoryField
-
getDefaultCategory
-
getCategoryDefinitions
-
getCategoriesOptionsList
-
initFieldCaptionWidth
-
onInstanceContainerItemChangeEvent
-
setInstanceContainer
@StudioProperty(name="dataContainer", type=DATACONTAINER_REF, required=true) public void setInstanceContainer(InstanceContainer<Object> container) Defines InstanceContainer for DynamicAttributesPanel.- Parameters:
container
-InstanceContainer
object with editing entity
-
setColumnsCount
Sets the number of columns. Ifnull
value is passed, columns count will be determined based on therows
parameter.- Parameters:
cols
- positive integer ornull
-
setRowsCount
Sets the number of rows. This parameter will only be taken into account ifcols == null
.- Parameters:
rows
- positive integer ornull
-
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
-
setFieldCaptionWidth
Sets the width of the fields caption.fieldCaptionWidth
with '%' unit is unsupported.- Parameters:
fieldCaptionWidth
- width of the fields caption
-
setCategoryFieldVisible
public void setCategoryFieldVisible(boolean visible) Sets visibility of theCategoryField
component.- Parameters:
visible
- visibility flag
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceValidatable
-
validate
- Specified by:
validate
in interfaceValidatable
- Throws:
ValidationException
-
setMargin
-
getMargin
-