summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2019-12-20 13:55:29 +0200
committerGitHub <noreply@github.com>2019-12-20 13:55:29 +0200
commit08c748acfffa5c6f94933561de19fd8522ab8cad (patch)
tree5666eb5b0024a2c23fc0ac4656ae93440de3d45c /server
parent7f733bc2aab41963a9ef44be252f3ee2462fa70a (diff)
downloadvaadin-framework-08c748acfffa5c6f94933561de19fd8522ab8cad.tar.gz
vaadin-framework-08c748acfffa5c6f94933561de19fd8522ab8cad.zip
Added helper methods for setting only height or width full. (#11854)
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/server/Sizeable.java14
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractComponent.java22
2 files changed, 34 insertions, 2 deletions
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
@@ -255,6 +255,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.
*/
public void setSizeUndefined();
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;
@@ -840,6 +838,26 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (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)
+ *
* @see com.vaadin.server.Sizeable#setSizeUndefined()
*/
@Override