Package io.jmix.ui.component
Interface Component
- All Known Subinterfaces:
Accordion
,ActionsHolder
,AngularGaugeChart
,AppMenu
,AppWorkArea
,BoxLayout
,BpmnModeler
,BpmnViewer
,BrowserFrame
,Button
,ButtonsPanel
,Calendar<V>
,CanvasLayout
,CapsLockIndicator
,Chart<T>
,CheckBox
,CheckBoxGroup<I>
,ChildEditableController
,Collapsable
,ColorPicker
,ComboBox<V>
,Component.BelongToFrame
,Component.Editable
,Component.Focusable
,Component.Wrapper
,ComponentContainer
,CoordinateChart<T>
,CssLayout
,CurrencyField<V>
,CustomChart
,Dashboard
,DataGrid<E>
,DateField<V>
,DatePicker<V>
,DialogWindow
,Drawer
,EntityComboBox<V>
,EntityLinkField<V>
,EntityPicker<V>
,EntitySuggestionField<V>
,ExpandingLayout
,Field<V>
,FileMultiUploadField
,FileStorageUploadField
,FileUploadField
,Filter
,FilterComponent
,FlowBoxLayout
,Form
,Fragment
,FragmentImplementation
,Frame
,FullTextFilter
,FunnelChart
,GanttChart
,GeoMap
,GrapesJsHtmlEditor
,GrapesJsNewsletterHtmlEditor
,GrapesJsWebpageHtmlEditor
,GridLayout
,GroupBoxLayout
,GroupFilter
,GroupTable<E>
,HasItemCaptionProvider<I>
,HasOptionCaptionProvider<I>
,HasOptionDescriptionProvider<T>
,HasOptionIconProvider<T>
,HasOptionImageProvider<T>
,HasOptionStyleProvider<I>
,HasValue<V>
,HBoxLayout
,HtmlBoxLayout
,Image<T>
,JavaScriptComponent
,JpqlFilter<V>
,Label<V>
,Link
,LinkButton
,ListComponent<E>
,LogicalFilterComponent
,LogoutButton
,LookupComponent<E>
,LookupComponent.LookupSelectionChangeNotifier<T>
,MaskedField<V>
,MultiSelectList<V>
,NewWindowButton
,NotificationsIndicator
,OptionsField<V,
,I> OrderedContainer
,OutcomesPanel
,Pagination
,PaginationComponent
,PasswordField
,PieChart
,PivotTable
,PopupButton
,PopupView
,ProgressBar
,PropertyFilter<V>
,RadarChart
,RadioButtonGroup<I>
,RectangularChart<T>
,RelatedEntities<E>
,ResizableTextArea<V>
,ResourceView
,ResponsiveGridLayout
,RichTextArea
,RootWindow
,ScrollBoxLayout
,SearchField
,SecuredActionsHolder
,SelectList<V,
,I> SerialChart
,SeriesBasedChart<T>
,SideMenu
,SimplePagination
,SingleFileUploadField
,SingleFilterComponent<V>
,SingleSelectList<V>
,SlicedChart<T>
,Slider<V>
,SourceCodeEditor
,SplitPanel
,StockChart
,SuggestionField<V>
,SuggestionFieldComponent<V,
,I> SupportsChildrenSelection
,Table<E>
,TabSheet
,TabWindow
,TagField<V>
,TagPicker<V>
,TextArea<V>
,TextField<V>
,TextInputField<V>
,TimeField<V>
,TimeZoneIndicator
,Tree<E>
,TreeDataGrid<E>
,TreeTable<E>
,TwinColumn<V>
,UploadField
,UserActionsButton
,UserIndicator
,ValuePicker<V>
,ValuesPicker<V>
,VBoxLayout
,WebdavDocumentLink
,WebdavDocumentUploadField
,WebdavDocumentVersionLink
,Window
,WindowImplementation
,XYChart
- All Known Implementing Classes:
AbstractActionsHolderComponent
,AbstractBox
,AbstractCanvasLayout
,AbstractComponent
,AbstractDataGrid
,AbstractField
,AbstractFileStorageUploadField
,AbstractOrderedLayout
,AbstractPagination
,AbstractResourceView
,AbstractSelectList
,AbstractSingleFileUploadField
,AbstractSingleFilterComponent
,AbstractSuggestionField
,AbstractTable
,AbstractTextArea
,AbstractValueComponent
,AbstractViewComponent
,AccordionImpl
,AngularGaugeChartImpl
,AppMenuImpl
,AppWorkAreaImpl
,BpmnModelerImpl
,BpmnViewerImpl
,BrowserFrameImpl
,ButtonImpl
,ButtonsPanelImpl
,CalendarImpl
,CanvasCssLayout
,CanvasGridLayout
,CanvasHorizontalLayout
,CanvasResponsiveLayout
,CanvasRootLayout
,CanvasVerticalLayout
,CanvasWidgetLayout
,CapsLockIndicatorImpl
,ChartImpl
,CheckBoxGroupImpl
,CheckBoxImpl
,ColorPickerImpl
,ComboBoxImpl
,CompositeComponent
,CoordinateChartImpl
,CssLayoutImpl
,CurrencyFieldImpl
,CustomChartImpl
,DashboardImpl
,DataGridImpl
,DateFieldImpl
,DatePickerImpl
,DialogWindowImpl
,DrawerImpl
,DynamicAttributesPanel
,EntityComboBoxImpl
,EntityLinkFieldImpl
,EntityPickerImpl
,EntitySuggestionFieldImpl
,FileMultiUploadFieldImpl
,FileStorageUploadFieldImpl
,FileUploadFieldImpl
,FilterImpl
,FlowBoxLayoutImpl
,FormImpl
,FragmentImpl
,FullTextFilterImpl
,FunnelChartImpl
,GanttChartImpl
,GeoMapImpl
,GrapesJsHtmlEditorImpl
,GrapesJsNewsletterHtmlEditorImpl
,GrapesJsWebpageHtmlEditorImpl
,GridLayoutImpl
,GroupBoxImpl
,GroupFilterImpl
,GroupTableImpl
,HBoxLayoutImpl
,HtmlBoxLayoutImpl
,ImageImpl
,JavaScriptComponentImpl
,JpqlFilterImpl
,LabelImpl
,LinkButtonImpl
,LinkImpl
,LogoutButtonImpl
,MaskedFieldImpl
,MultiSelectListImpl
,NewWindowButtonImpl
,NotificationsIndicatorImpl
,OutcomesPanelImpl
,PaginationImpl
,PaletteButton
,PasswordFieldImpl
,PieChartImpl
,PivotTableImpl
,PopupButtonImpl
,PopupViewImpl
,ProgressBarImpl
,PropertyFilterImpl
,RadarChartImpl
,RadioButtonGroupImpl
,RectangularChartImpl
,RelatedEntitiesImpl
,ResizableTextAreaImpl
,ResponsiveGridLayoutImpl
,RichTextAreaImpl
,RootWindowImpl
,ScrollBoxLayoutImpl
,SearchFieldImpl
,SerialChartImpl
,SeriesBasedChartImpl
,SideMenuImpl
,SimplePaginationImpl
,SingleSelectListImpl
,SlicedChartImpl
,SliderImpl
,SourceCodeEditorImpl
,SplitPanelImpl
,StockChartImpl
,SuggestionFieldImpl
,Table.PlainTextCell
,TableImpl
,TabSheetImpl
,TabWindowImpl
,TagFieldImpl
,TagPickerImpl
,TextAreaImpl
,TextFieldImpl
,TimeFieldImpl
,TimeZoneIndicatorImpl
,TreeDataGridImpl
,TreeImpl
,TreeTableImpl
,TwinColumnImpl
,UserActionsButtonImpl
,UserIndicatorImpl
,ValuePickerImpl
,ValuesPickerImpl
,VBoxLayoutImpl
,WebdavDocumentLinkImpl
,WebdavDocumentUploadFieldImpl
,WebdavDocumentVersionLinkImpl
,WindowImpl
,XYChartImpl
public interface Component
Root of the Generic UI components hierarchy.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static interface
Component belonging to a framestatic interface
static interface
Component supporting "editable" state.static interface
Component supporting "focusable" state.static interface
Object having a caption.static interface
Object having a description.static interface
Component having an icon.static interface
Object having an XML descriptor attached.static interface
Component delegating work to some "wrapped" client-specific implementation. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStyleName
(String styleName) Adds one or more style names to this component.float
Get component height ingetHeightSizeUnit()
Gets the height property units.getId()
Component ID as defined inid
attributeStyles implementation is client-type-specific.float
getWidth()
Get component width ingetWidthSizeUnit()
Gets the width property units.boolean
Is the component enabled?
Note that this method only returns the status of the component and does not take parents into account.boolean
boolean
Is the component responsive?boolean
Is the component visible?
A component is visible only if all its parents are also visible.boolean
void
removeStyleName
(String styleName) Removes one or more style names from component.void
setAlignment
(Component.Alignment alignment) void
setEnabled
(boolean enabled) Sets the component enabled state.void
Set component height ingetHeightSizeUnit()
default void
Set component height toAUTO_SIZE
default void
Set component height to 100%void
Set component IDvoid
INTERNAL.
ComponentContainer.add(Component)
is normally used for adding components to a parent and the used method will call this method implicitly.void
setResponsive
(boolean responsive) Sets component to be responsive by width and height.default void
Set component width and height toAUTO_SIZE
default void
Set component width and height to 100%void
setStyleName
(String styleName) Sets one or more style names of the component, replacing any previous styles.void
setVisible
(boolean visible) Sets visibility value for the component.void
Set component width ingetWidthSizeUnit()
}default void
Set component width toAUTO_SIZE
default void
Set component width to 100%<X> X
Get client specific component instance.<X> X
unwrapComposition
(Class<X> internalCompositionClass) Get the outmost external container of client specific component instance.<X> X
unwrapCompositionOrNull
(Class<X> internalCompositionClass) Get the outmost external container of client specific component instance.<X> X
unwrapOrNull
(Class<X> internalComponentClass) Get client specific component instance.<X> void
withUnwrapped
(Class<X> internalComponentClass, Consumer<X> action) Performs the givenaction
with underlying component if it can be casted to the giveninternalComponentClass
.<X> void
withUnwrappedComposition
(Class<X> internalCompositionClass, Consumer<X> action) Get the outmost external container of client specific component instance and performs the givenaction
.
-
Field Details
-
AUTO_SIZE
- See Also:
-
AUTO_SIZE_PX
static final int AUTO_SIZE_PX- See Also:
-
FULL_SIZE
- See Also:
-
-
Method Details
-
getId
Component ID as defined inid
attribute -
setId
Set component ID -
getParent
- Returns:
- parent of component.
-
setParent
INTERNAL.
ComponentContainer.add(Component)
is normally used for adding components to a parent and the used method will call this method implicitly.- Parameters:
parent
- Parent component
-
isEnabled
boolean isEnabled()Is the component enabled?
Note that this method only returns the status of the component and does not take parents into account. Even though this method returns true the component can be disabled to the user if a parent is disabled.- Returns:
- true if the component enabled flag is set to true
-
setEnabled
Sets the component enabled state.
The user can not interact with disabled components, which are shown with a style that indicates the status. Components are enabled by default.- Parameters:
enabled
- enabled flag
-
isResponsive
boolean isResponsive()Is the component responsive?- Returns:
- true if the component applies conditional CSS rules for width / height sizes.
-
setResponsive
Sets component to be responsive by width and height.
If responsive flag is true then you can use conditional CSS rules that respond to size changes in the browser. You can set specific rules using "width-range" or "height-range" properties in CSS files.- Parameters:
responsive
- responsive flag
-
isVisible
boolean isVisible()Is the component visible?
A component is visible only if all its parents are also visible. This is not checked by this method though, so even if this method returns true, the component can be hidden from the user because a parent is set to invisible.- Returns:
- true if the component visibility is set to true
-
setVisible
Sets visibility value for the component.
Visible components are drawn in the user interface, while invisible ones are not. The effect is not a cosmetic CSS change - no information about an invisible component will be sent to the client. The effect is thus the same as removing the component from its parent.- Parameters:
visible
- visible flag
-
isVisibleRecursive
boolean isVisibleRecursive()- Returns:
- true if the component and all its parent components are visible
-
isEnabledRecursive
boolean isEnabledRecursive()- Returns:
- true if the component and all its parent components are enabled
-
getHeight
float getHeight()Get component height ingetHeightSizeUnit()
-
getHeightSizeUnit
SizeUnit getHeightSizeUnit()Gets the height property units.- Returns:
- units used in height property.
-
setHeight
Set component height ingetHeightSizeUnit()
-
setHeightAuto
default void setHeightAuto()Set component height toAUTO_SIZE
-
setHeightFull
default void setHeightFull()Set component height to 100% -
getWidth
float getWidth()Get component width ingetWidthSizeUnit()
-
getWidthSizeUnit
SizeUnit getWidthSizeUnit()Gets the width property units.- Returns:
- units used in the width property.
-
setWidth
Set component width ingetWidthSizeUnit()
} -
setWidthAuto
default void setWidthAuto()Set component width toAUTO_SIZE
-
setWidthFull
default void setWidthFull()Set component width to 100% -
setSizeFull
default void setSizeFull()Set component width and height to 100% -
setSizeAuto
default void setSizeAuto()Set component width and height toAUTO_SIZE
-
getAlignment
Component.Alignment getAlignment() -
setAlignment
@StudioProperty(name="align", type=ENUMERATION, defaultValue="TOP_LEFT") void setAlignment(Component.Alignment alignment) -
getStyleName
String getStyleName()Styles implementation is client-type-specific.- Returns:
- current style name.
-
setStyleName
@StudioProperty(name="stylename", type=CSS_CLASSNAME_LIST) void setStyleName(@Nullable String styleName) Sets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Parameters:
styleName
- one or more style names separated by space.
-
addStyleName
Adds one or more style names to this component. Multiple styles can be specified as a space-separated list of style names.- Parameters:
styleName
- one or more style names separated by space.
-
removeStyleName
Removes one or more style names from component. Multiple styles can be specified as a space-separated list of style names.- Parameters:
styleName
- one or more style names separated by space.
-
unwrap
Get client specific component instance. Can be used in client module to simplify invocation of underlying API.
Example:com.vaadin.ui.TextField vTextField = textField.unwrap(com.vaadin.ui.TextField.class);
- Type Parameters:
X
- type of internal class- Parameters:
internalComponentClass
- class of underlying component implementation based on Vaadin or Swing- Returns:
- internal client specific component
-
unwrapOrNull
Get client specific component instance. Can be used in client module to simplify invocation of underlying API.
Returnsnull
if underlying component cannot be casted to the giveninternalComponentClass
. Example:com.vaadin.ui.TextField vTextField = textField.unwrapOrNull(com.vaadin.ui.TextField.class);
- Type Parameters:
X
- type of internal class- Parameters:
internalComponentClass
- class of underlying component implementation based on Vaadin or Swing- Returns:
- internal client specific component or null if it cannot be casted to given class
-
withUnwrapped
Performs the givenaction
with underlying component if it can be casted to the giveninternalComponentClass
. Example:textField.withUnwrapped(com.vaadin.ui.TextField.class, vTextField -> { // do something });
- Type Parameters:
X
- type of internal class- Parameters:
internalComponentClass
- class of underlying component implementation based on Vaadin or Swingaction
- action to perform if underlying component can be casted to given class
-
unwrapComposition
Get the outmost external container of client specific component instance. Can be used in client module to simplify invocation of underlying API.
Example:com.vaadin.ui.Layout vLayout = table.unwrapComposition(com.vaadin.ui.Layout.class);
- Type Parameters:
X
- type of internal class- Parameters:
internalCompositionClass
- class of underlying composition implementation based on Vaadin or Swing- Returns:
- internal client specific component
-
unwrapCompositionOrNull
Get the outmost external container of client specific component instance. Can be used in client module to simplify invocation of underlying API.
Returns null if composition cannot be casted to giveninternalCompositionClass
. Example:com.vaadin.ui.Layout vLayout = table.unwrapCompositionOrNull(com.vaadin.ui.Layout.class);
- Type Parameters:
X
- type of internal class- Parameters:
internalCompositionClass
- class of underlying composition implementation based on Vaadin or Swing- Returns:
- internal client specific component or null if cannot be casted to given class
-
withUnwrappedComposition
Get the outmost external container of client specific component instance and performs the givenaction
.
Can be used in client module to simplify invocation of underlying API.
Example:table.withUnwrappedComposition(com.vaadin.ui.Layout.class, vLayout -> { // do something });
- Type Parameters:
X
- type of internal class- Parameters:
internalCompositionClass
- class of underlying composition implementation based on Vaadin or Swingaction
- to perform if underlying composition can be casted to given class
-