public class FormImpl extends AbstractComponent<JmixFormLayout> implements Form, UiPermissionAware
Form.CaptionAlignment
EditableChangeNotifier.EditableChangeEvent
HasContextHelp.ContextHelpIconClickEvent
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
SupportsCaptionPosition.CaptionPosition
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.util.List<ComponentPosition>> |
columnComponentMapping |
protected boolean |
editable |
protected ValueSourceProvider |
valueSourceProvider |
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
FormImpl() |
Modifier and Type | Method and Description |
---|---|
void |
add(Component childComponent)
Adds a component to the first column.
|
void |
add(Component childComponent,
int column)
Adds a component to the column with the given index.
|
void |
add(Component childComponent,
int column,
int row)
Adds a component to a column with the given index to the given position.
|
void |
add(Component childComponent,
int column,
int colSpan,
int rowSpan)
Adds a component to a column with the given index with the given span.
|
void |
add(Component childComponent,
int column,
int row,
int colSpan,
int rowSpan)
Adds a component to a column with the given index to the given position with the given span.
|
protected void |
addComponentInternal(Component childComponent,
int column,
int row,
int colSpan,
int rowSpan) |
io.jmix.core.common.event.Subscription |
addEditableChangeListener(java.util.function.Consumer<EditableChangeNotifier.EditableChangeEvent> listener)
Adds a listener that is invoked when the
editable property changes. |
protected void |
applyDefaults(Component childComponent) |
void |
applyPermission(UiPermissionDescriptor permissionDescriptor)
Change state of subcomponent according to the
permissionValue . |
protected void |
assignDebugId(com.vaadin.ui.Component composition,
java.lang.String id) |
protected void |
assignTypicalAttributes(Component component) |
void |
attached()
Notifies all listeners that component has been attached.
|
protected java.util.List<ComponentArea> |
calculateComponentAreas() |
protected int |
calculateInsertIndex(int column,
int row,
java.util.List<ComponentPosition> componentPositions) |
protected void |
checkExistingOverlaps(int startColumn,
int startRow,
int colSpan,
int rowSpan) |
protected JmixFormLayout |
createComponent() |
void |
detached()
Notifies all listeners that component has been detached.
|
protected int |
detectRowsCount() |
protected int |
detectRowsCount(int column) |
protected int |
detectRowsCount(int column,
boolean isCheckAreas) |
protected int |
detectStartRowIndex(int column) |
protected void |
fillSpanMatrix(boolean[][] spanMatrix,
int col,
int row,
int colspan,
int rowspan) |
protected ComponentArea |
findComponentArea(java.util.List<ComponentArea> componentAreas,
ComponentPosition position) |
protected ComponentPosition |
findComponentPosition(java.util.List<ComponentPosition> components,
Component component) |
SupportsCaptionPosition.CaptionPosition |
getCaptionPosition() |
Form.CaptionAlignment |
getChildrenCaptionAlignment() |
Form.CaptionAlignment |
getChildrenCaptionAlignment(int column)
Returns alignment of child component captions for a column with the given index.
|
int |
getChildrenCaptionWidth() |
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 |
getColumns() |
Component |
getComponent(int column,
int row) |
Component |
getComponent(java.lang.String id)
Gets a component belonging to the whole components tree below this container.
|
java.util.Collection<Component> |
getComponents()
Gets all components belonging to the whole components tree below this container.
|
java.util.Collection<Component> |
getComponents(int column) |
Component |
getOwnComponent(java.lang.String id)
Gets component directly owned by this container.
|
java.util.Collection<Component> |
getOwnComponents()
Gets all components directly owned by this container.
|
java.util.stream.Stream<Component> |
getOwnComponentsStream()
Gets stream of all components directly owned by this container.
|
ValueSourceProvider |
getValueSourceProvider() |
boolean |
isEditable() |
protected void |
managedComponentAssigned(Component childComponent) |
protected void |
reattachColumnFields() |
void |
remove(Component childComponent)
Removes a component from this container.
|
void |
removeAll()
Removes all components from this container.
|
void |
setCaptionPosition(SupportsCaptionPosition.CaptionPosition captionAlignment)
Sets caption position of form child components.
|
void |
setChildrenCaptionAlignment(Form.CaptionAlignment alignment)
Sets alignment of child component captions in all columns.
|
void |
setChildrenCaptionAlignment(int column,
Form.CaptionAlignment alignment)
Sets alignment of child component captions for a column with the given index.
|
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.
|
void |
setDebugId(java.lang.String id)
INTERNAL.
|
void |
setEditable(boolean editable) |
void |
setValueSourceProvider(ValueSourceProvider provider) |
addAttachListener, addDetachListener, addStyleName, assignDebugId, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFrame, setFrame
getIcon, setIcon, setIconFromSet
remove
focusFirstComponent, getComponentNN
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isEditableWithParent
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
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
protected java.util.List<java.util.List<ComponentPosition>> columnComponentMapping
protected ValueSourceProvider valueSourceProvider
protected boolean editable
protected JmixFormLayout createComponent()
public void setDebugId(@Nullable java.lang.String id)
HasDebugId
setDebugId
in interface HasDebugId
setDebugId
in class AbstractComponent<JmixFormLayout>
public boolean isEditable()
isEditable
in interface Component.Editable
public void setEditable(boolean editable)
setEditable
in interface Component.Editable
public io.jmix.core.common.event.Subscription addEditableChangeListener(java.util.function.Consumer<EditableChangeNotifier.EditableChangeEvent> listener)
EditableChangeNotifier
editable
property changes.addEditableChangeListener
in interface EditableChangeNotifier
listener
- a listener to addpublic void add(Component childComponent)
Form
add
in interface ComponentContainer
add
in interface Form
childComponent
- a component to addpublic void add(Component childComponent, int column)
Form
public void add(Component childComponent, int column, int colSpan, int rowSpan)
Form
public void add(Component childComponent, int column, int row)
Form
public void add(Component childComponent, int column, int row, int colSpan, int rowSpan)
Form
protected void checkExistingOverlaps(int startColumn, int startRow, int colSpan, int rowSpan)
protected void addComponentInternal(Component childComponent, int column, int row, int colSpan, int rowSpan)
protected int calculateInsertIndex(int column, int row, java.util.List<ComponentPosition> componentPositions)
protected void managedComponentAssigned(Component childComponent)
protected void applyDefaults(Component childComponent)
protected void assignTypicalAttributes(Component component)
protected void assignDebugId(@Nullable com.vaadin.ui.Component composition, java.lang.String id)
protected int detectRowsCount(int column)
column
- a column indexprotected int detectStartRowIndex(int column)
column
- a column indexprotected int detectRowsCount(int column, boolean isCheckAreas)
@Nullable protected ComponentArea findComponentArea(java.util.List<ComponentArea> componentAreas, ComponentPosition position)
protected int detectRowsCount()
protected void reattachColumnFields()
protected java.util.List<ComponentArea> calculateComponentAreas()
protected void fillSpanMatrix(boolean[][] spanMatrix, int col, int row, int colspan, int rowspan)
public void remove(Component childComponent)
ComponentContainer
remove
in interface ComponentContainer
childComponent
- a component to remove@Nullable protected ComponentPosition findComponentPosition(java.util.List<ComponentPosition> components, Component component)
public void removeAll()
ComponentContainer
removeAll
in interface ComponentContainer
@Nullable public Component getOwnComponent(java.lang.String id)
HasComponents
getOwnComponent
in interface HasComponents
@Nullable public Component getComponent(java.lang.String id)
HasComponents
getComponent
in interface HasComponents
public java.util.Collection<Component> getOwnComponents()
HasComponents
getOwnComponents
in interface HasComponents
public java.util.stream.Stream<Component> getOwnComponentsStream()
HasComponents
getOwnComponentsStream
in interface HasComponents
public java.util.Collection<Component> getComponents()
HasComponents
getComponents
in interface HasComponents
public java.util.Collection<Component> getComponents(int column)
getComponents
in interface Form
column
- a column indexpublic Component getComponent(int column, int row)
getComponent
in interface Form
column
- a columns indexrow
- a row indexpublic SupportsCaptionPosition.CaptionPosition getCaptionPosition()
getCaptionPosition
in interface Form
getCaptionPosition
in interface SupportsCaptionPosition
public void setCaptionPosition(SupportsCaptionPosition.CaptionPosition captionAlignment)
Form
CaptionPosition#LEFT
- component captions will be placed
in a separate column on the left side of the componentsCaptionPosition#TOP
- component captions will be placed
above the componentssetCaptionPosition
in interface Form
setCaptionPosition
in interface SupportsCaptionPosition
captionAlignment
- component caption positionpublic int getChildrenCaptionWidth()
getChildrenCaptionWidth
in interface Form
public void setChildrenCaptionWidth(int width)
Form
setChildrenCaptionWidth
in interface Form
width
- fixed caption widthpublic int getChildrenCaptionWidth(int column)
Form
getChildrenCaptionWidth
in interface Form
column
- a column indexpublic void setChildrenCaptionWidth(int column, int width)
Form
setChildrenCaptionWidth
in interface Form
column
- a column indexwidth
- fixed caption width for column with a given indexpublic Form.CaptionAlignment getChildrenCaptionAlignment()
getChildrenCaptionAlignment
in interface Form
public void setChildrenCaptionAlignment(Form.CaptionAlignment alignment)
Form
Applicable only when captions position is CaptionPosition#LEFT
.
setChildrenCaptionAlignment
in interface Form
alignment
- captions alignmentpublic Form.CaptionAlignment getChildrenCaptionAlignment(int column)
Form
getChildrenCaptionAlignment
in interface Form
column
- a column index to get captionpublic void setChildrenCaptionAlignment(int column, Form.CaptionAlignment alignment)
Form
setChildrenCaptionAlignment
in interface Form
column
- a column index to set captionalignment
- alignment of child component captions for a column with the given indexpublic int getColumns()
getColumns
in interface Form
public void setColumns(int columns)
Form
setColumns
in interface Form
columns
- the new number of columns in the Formpublic void setColumnFlex(int column, float flex)
Form
setColumnFlex
in interface Form
column
- a column indexflex
- the flex ration for the columnpublic float getColumnFlex(int column)
Form
getColumnFlex
in interface Form
column
- a column index@Nullable public ValueSourceProvider getValueSourceProvider()
getValueSourceProvider
in interface HasValueSourceProvider
public void setValueSourceProvider(@Nullable ValueSourceProvider provider)
setValueSourceProvider
in interface HasValueSourceProvider
public void applyPermission(UiPermissionDescriptor permissionDescriptor)
UiPermissionAware
permissionValue
.applyPermission
in interface UiPermissionAware
permissionDescriptor
- descriptor which contains id of subcomponent and UI permission value
which will be applied to this subcomponent or ids of subcomponent and its action
and UI permission value which will be applied to subcomponent's actionpublic void attached()
AttachNotifier
attached
in interface AttachNotifier
attached
in class AbstractComponent<JmixFormLayout>
public void detached()
AttachNotifier
detached
in interface AttachNotifier
detached
in class AbstractComponent<JmixFormLayout>