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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumCaption 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.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.EditableChangeNotifier
EditableChangeNotifier.EditableChangeEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.SupportsCaptionPosition
SupportsCaptionPosition.CaptionPosition -
Field Summary
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a component to the first column.default voidSequentially adds components to the first column.voidAdds a component to the column with the given index.voidAdds a component to a column with the given index to the given position.voidAdds a component to a column with the given index with the given span.voidAdds 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.intintgetChildrenCaptionWidth(int column) Returns fixed caption width for column with a given index.floatgetColumnFlex(int column) Returns the flex layout ratio for column with a given index.intgetComponent(int column, int row) getComponents(int column) voidSets caption position of form child components.voidsetChildrenCaptionAlignment(int column, Form.CaptionAlignment alignment) Sets alignment of child component captions for a column with the given index.voidsetChildrenCaptionAlignment(Form.CaptionAlignment alignment) Sets alignment of child component captions in all columns.voidsetChildrenCaptionWidth(int width) Sets fixed captions width for all columns.voidsetChildrenCaptionWidth(int column, int width) Set fixed captions width for column with a given index.voidsetColumnFlex(int column, float flex) Sets flex layout ratio for column with a given index.voidsetColumns(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, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.ComponentContainer
remove, remove, removeAllMethods inherited from interface io.jmix.ui.component.EditableChangeNotifier
addEditableChangeListenerMethods inherited from interface io.jmix.ui.component.HasComponents
focusFirstComponent, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, getOwnComponentsStreamMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods 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:
addin interfaceComponentContainer- Parameters:
childComponent- a component to add
-
add
Sequentially adds components to the first column.- Specified by:
addin 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:
getCaptionPositionin 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:
setCaptionPositionin 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
-