com.vaadin.flow.component.
Interface HasSize
-
All Superinterfaces:
All Known Subinterfaces:
All Known Implementing Classes:
Anchor, Article, Aside, Button, Checkbox, ComboBox, DatePicker, DescriptionList, DescriptionList.Description, DescriptionList.Term, Dialog, Div, Emphasis, FlexLayout, Footer, FormLayout, Grid, H1, H2, H3, H4, H5, H6, Header, HorizontalLayout, Hr, HtmlComponent, HtmlContainer, Image, Input, IronList, Label, ListItem, Main, NativeButton, Nav, OrderedList, Paragraph, PasswordField, ProgressBar, Section, Span, SplitLayout, Tabs, TextArea, TextField, UnorderedList, Upload, VerticalLayout
public interface HasSize extends HasElement
Any component implementing this interface supports setting the size of the component using
setWidth(String)
andsetHeight(String)
. The sizes are set on the element as inline styles, i.e. usingElement.getStyle()
.Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method and Description default String
getHeight()
Gets the height defined for the component.
default String
getWidth()
Gets the width defined for the component.
default void
setHeight(String height)
Sets the height of the component.
default void
setSizeFull()
Sets the width and the height of the component to "100%".
default void
setSizeUndefined()
Removes the width and the height of the component.
default void
setWidth(String width)
Sets the width of the component.
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
-
-
-
Method Detail
-
setWidth
default void setWidth(String width)
Sets the width of the component.
The width should be in a format understood by the browser, e.g. "100px" or "2.5em".
If the provided
width
value is null then width is removed.Parameters:
width
- the width to set, may benull
-
getWidth
default String getWidth()
Gets the width defined for the component.
Note that this does not return the actual size of the component but the width which has been set using
setWidth(String)
.Returns:
the width which has been set for the component
-
setHeight
default void setHeight(String height)
Sets the height of the component.
The height should be in a format understood by the browser, e.g. "100px" or "2.5em".
If the provided
height
value is null then height is removed.Parameters:
height
- the height to set, may benull
-
getHeight
default String getHeight()
Gets the height defined for the component.
Note that this does not return the actual size of the component but the height which has been set using
setHeight(String)
.Returns:
the height which has been set for the component
-
setSizeFull
default void setSizeFull()
Sets the width and the height of the component to "100%".
This is just a convenience method which delegates its call to the
setWidth(String)
andsetHeight(String)
methods with "100%" as the argument value
-
setSizeUndefined
default void setSizeUndefined()
Removes the width and the height of the component.
This is just a convenience method which delegates its call to the
setWidth(String)
andsetHeight(String)
methods with null as the argument value
-
-