]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added helper methods for setting only height or width full. (#11854)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Fri, 20 Dec 2019 11:55:29 +0000 (13:55 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Dec 2019 11:55:29 +0000 (13:55 +0200)
server/src/main/java/com/vaadin/server/Sizeable.java
server/src/main/java/com/vaadin/ui/AbstractComponent.java

index 19780ec375cab77423492f179c2b42e5a871540a..d0a7e6da175a4bfd041723a9812975724e100b4e 100644 (file)
@@ -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.
      */
index d900f348721c86d950f2db625d0c21d313deb35b..17b2b8229ea37909b70b458cf631dfe5042dc7ba 100644 (file)
@@ -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)
      *