From: Anna Koskinen Date: Fri, 20 Dec 2019 11:55:29 +0000 (+0200) Subject: Added helper methods for setting only height or width full. (#11854) X-Git-Tag: 8.10.0.beta1~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=08c748acfffa5c6f94933561de19fd8522ab8cad;p=vaadin-framework.git Added helper methods for setting only height or width full. (#11854) --- diff --git a/server/src/main/java/com/vaadin/server/Sizeable.java b/server/src/main/java/com/vaadin/server/Sizeable.java index 19780ec375..d0a7e6da17 100644 --- a/server/src/main/java/com/vaadin/server/Sizeable.java +++ b/server/src/main/java/com/vaadin/server/Sizeable.java @@ -254,6 +254,20 @@ public interface Sizeable extends Serializable { */ public void setSizeFull(); + /** + * Sets the width to 100%. + * + * @since + */ + public void setWidthFull(); + + /** + * Sets the height to 100%. + * + * @since + */ + public void setHeightFull(); + /** * Clears any size settings. */ diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java index d900f34872..17b2b8229e 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java @@ -30,8 +30,6 @@ import java.util.Objects; import java.util.Set; import java.util.StringTokenizer; -import com.vaadin.annotations.Theme; -import com.vaadin.ui.themes.ValoTheme; import org.jsoup.nodes.Attribute; import org.jsoup.nodes.Attributes; import org.jsoup.nodes.Element; @@ -837,6 +835,26 @@ public abstract class AbstractComponent extends AbstractClientConnector setHeight(100, Unit.PERCENTAGE); } + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setWidthFull() + */ + @Override + public void setWidthFull() { + setWidth(100, Unit.PERCENTAGE); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setHeightFull() + */ + @Override + public void setHeightFull() { + setHeight(100, Unit.PERCENTAGE); + } + /* * (non-Javadoc) *