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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic interfaceComponent belonging to a framestatic interfacestatic interfaceComponent supporting "editable" state.static interfaceComponent supporting "focusable" state.static interfaceObject having a caption.static interfaceObject having a description.static interfaceComponent having an icon.static interfaceObject having an XML descriptor attached.static interfaceComponent delegating work to some "wrapped" client-specific implementation. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStyleName(String styleName) Adds one or more style names to this component.floatGet component height ingetHeightSizeUnit()Gets the height property units.getId()Component ID as defined inidattributeStyles implementation is client-type-specific.floatgetWidth()Get component width ingetWidthSizeUnit()Gets the width property units.booleanIs the component enabled?
Note that this method only returns the status of the component and does not take parents into account.booleanbooleanIs the component responsive?booleanIs the component visible?
A component is visible only if all its parents are also visible.booleanvoidremoveStyleName(String styleName) Removes one or more style names from component.voidsetAlignment(Component.Alignment alignment) voidsetEnabled(boolean enabled) Sets the component enabled state.voidSet component height ingetHeightSizeUnit()default voidSet component height toAUTO_SIZEdefault voidSet component height to 100%voidSet component IDvoidINTERNAL.
ComponentContainer.add(Component)is normally used for adding components to a parent and the used method will call this method implicitly.voidsetResponsive(boolean responsive) Sets component to be responsive by width and height.default voidSet component width and height toAUTO_SIZEdefault voidSet component width and height to 100%voidsetStyleName(String styleName) Sets one or more style names of the component, replacing any previous styles.voidsetVisible(boolean visible) Sets visibility value for the component.voidSet component width ingetWidthSizeUnit()}default voidSet component width toAUTO_SIZEdefault voidSet component width to 100%<X> XGet client specific component instance.<X> XunwrapComposition(Class<X> internalCompositionClass) Get the outmost external container of client specific component instance.<X> XunwrapCompositionOrNull(Class<X> internalCompositionClass) Get the outmost external container of client specific component instance.<X> XunwrapOrNull(Class<X> internalComponentClass) Get client specific component instance.<X> voidwithUnwrapped(Class<X> internalComponentClass, Consumer<X> action) Performs the givenactionwith underlying component if it can be casted to the giveninternalComponentClass.<X> voidwithUnwrappedComposition(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 inidattribute -
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.
Returnsnullif 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 givenactionwith 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
-