Package io.jmix.ui.component
Interface Form
- All Superinterfaces:
ChildEditableController
,Component
,Component.BelongToFrame
,Component.Editable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,ComponentContainer
,EditableChangeNotifier
,HasComponents
,HasContextHelp
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasValueSourceProvider
,SupportsCaptionPosition
- All Known Implementing Classes:
FormImpl
@StudioComponent(caption="Form",
category="Components",
xmlElement="form",
icon="io/jmix/ui/icon/component/form.svg",
canvasBehaviour=CONTAINER,
containerType=GRID,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/form.html")
public interface Form
extends Component, Component.BelongToFrame, Component.HasCaption, Component.HasIcon, ComponentContainer, Component.Editable, EditableChangeNotifier, HasContextHelp, ChildEditableController, HasValueSourceProvider, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, SupportsCaptionPosition
A multi-column form component.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Caption alignment of form child components.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
Nested classes/interfaces inherited from interface io.jmix.ui.component.EditableChangeNotifier
EditableChangeNotifier.EditableChangeEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.SupportsCaptionPosition
SupportsCaptionPosition.CaptionPosition
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a component to the first column.default void
Sequentially adds components to the first column.void
Adds a component to the column with the given index.void
Adds a component to a column with the given index to the given position.void
Adds a component to a column with the given index with the given span.void
Adds a component to a column with the given index to the given position with the given span.getChildrenCaptionAlignment
(int column) Returns alignment of child component captions for a column with the given index.int
int
getChildrenCaptionWidth
(int column) Returns fixed caption width for column with a given index.float
getColumnFlex
(int column) Returns the flex layout ratio for column with a given index.int
getComponent
(int column, int row) getComponents
(int column) void
Sets caption position of form child components.void
setChildrenCaptionAlignment
(int column, Form.CaptionAlignment alignment) Sets alignment of child component captions for a column with the given index.void
setChildrenCaptionAlignment
(Form.CaptionAlignment alignment) Sets alignment of child component captions in all columns.void
setChildrenCaptionWidth
(int width) Sets fixed captions width for all columns.void
setChildrenCaptionWidth
(int column, int width) Set fixed captions width for column with a given index.void
setColumnFlex
(int column, float flex) Sets flex layout ratio for column with a given index.void
setColumns
(int columns) Sets the number of columns in the Form.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.ComponentContainer
remove, remove, removeAll
Methods inherited from interface io.jmix.ui.component.EditableChangeNotifier
addEditableChangeListener
Methods inherited from interface io.jmix.ui.component.HasComponents
focusFirstComponent, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, getOwnComponentsStream
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.data.HasValueSourceProvider
getValueSourceProvider, setValueSourceProvider
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
add
Adds a component to the first column.- Specified by:
add
in interfaceComponentContainer
- Parameters:
childComponent
- a component to add
-
add
Sequentially adds components to the first column.- Specified by:
add
in interfaceComponentContainer
- Parameters:
childComponents
- components to add
-
add
Adds a component to the column with the given index.- Parameters:
childComponent
- a component to addcolumn
- a columns index
-
add
Adds a component to a column with the given index with the given span.- Parameters:
childComponent
- a component to addcolumn
- a columns indexcolSpan
- a number of columns a component should spanrowSpan
- a number of rows a component should span
-
add
Adds a component to a column with the given index to the given position.- Parameters:
childComponent
- a component to addcolumn
- a columns indexrow
- a row index
-
add
Adds a component to a column with the given index to the given position with the given span.- Parameters:
childComponent
- a component to addcolumn
- a columns indexrow
- a row indexcolSpan
- a number of columns a component should spanrowSpan
- a number of rows a component should span
-
getComponents
- Parameters:
column
- a column index- Returns:
- a collection of components directly owned by a column with a given index
-
getComponent
- Parameters:
column
- a columns indexrow
- a row index- Returns:
- a component placed in a column with a given index in a given position
-
getCaptionPosition
SupportsCaptionPosition.CaptionPosition getCaptionPosition()- Specified by:
getCaptionPosition
in interfaceSupportsCaptionPosition
- Returns:
- caption position of form child components
-
setCaptionPosition
Sets caption position of form child components.SupportsCaptionPosition.CaptionPosition.LEFT
- component captions will be placed in a separate column on the left side of the componentsSupportsCaptionPosition.CaptionPosition.TOP
- component captions will be placed above the components
- Specified by:
setCaptionPosition
in interfaceSupportsCaptionPosition
- Parameters:
position
- component caption position
-
getChildrenCaptionWidth
int getChildrenCaptionWidth()- Returns:
- columns fixed caption width
-
setChildrenCaptionWidth
void setChildrenCaptionWidth(int width) Sets fixed captions width for all columns. Set -1 to use auto size.- Parameters:
width
- fixed caption width
-
getChildrenCaptionAlignment
Form.CaptionAlignment getChildrenCaptionAlignment()- Returns:
- alignment of child component captions
-
setChildrenCaptionAlignment
@StudioProperty(type=ENUMERATION, defaultValue="LEFT", options={"LEFT","RIGHT"}) void setChildrenCaptionAlignment(Form.CaptionAlignment alignment) Sets alignment of child component captions in all columns.Applicable only when captions position is
SupportsCaptionPosition.CaptionPosition.LEFT
.- Parameters:
alignment
- captions alignment
-
getChildrenCaptionAlignment
Returns alignment of child component captions for a column with the given index.- Parameters:
column
- a column index to get caption- Returns:
- alignment of child component captions for a column with the given index
-
setChildrenCaptionAlignment
Sets alignment of child component captions for a column with the given index.- Parameters:
column
- a column index to set captionalignment
- alignment of child component captions for a column with the given index
-
getChildrenCaptionWidth
int getChildrenCaptionWidth(int column) Returns fixed caption width for column with a given index.- Parameters:
column
- a column index- Returns:
- fixed caption width for column with a given index
-
setChildrenCaptionWidth
@StudioProperty(name="childrenCaptionWidth", type=SIZE, defaultValue="-1px") void setChildrenCaptionWidth(int column, int width) Set fixed captions width for column with a given index. Set -1 to use auto size.- Parameters:
column
- a column indexwidth
- fixed caption width for column with a given index
-
getColumns
int getColumns()- Returns:
- number of columns in the Form
-
setColumns
void setColumns(int columns) Sets the number of columns in the Form. The column count can not be reduced if there are any components that would be outside of the shrunk Form.- Parameters:
columns
- the new number of columns in the Form
-
getColumnFlex
float getColumnFlex(int column) Returns the flex layout ratio for column with a given index.- Parameters:
column
- a column index- Returns:
- flex layout ratio for column with a given index
-
setColumnFlex
void setColumnFlex(int column, float flex) Sets flex layout ratio for column with a given index.- Parameters:
column
- a column indexflex
- the flex ration for the column
-