diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-08-01 11:41:39 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-01 11:41:39 +0300 |
commit | 7cf466fa7f0a1fbf48664a6c8211809f9932a997 (patch) | |
tree | 20b03e17583c38479481a09013e9a4db360b7991 /server | |
parent | 2af2783f502aac67ff01460b4bd00cd5a2e8a88c (diff) | |
download | vaadin-framework-7cf466fa7f0a1fbf48664a6c8211809f9932a997.tar.gz vaadin-framework-7cf466fa7f0a1fbf48664a6c8211809f9932a997.zip |
Add header and footer visibility setting to Grid (#9706)
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 46 | ||||
-rw-r--r-- | server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java | 24 |
2 files changed, 70 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index dbaff46181..70e947ccd8 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -3207,6 +3207,29 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** + * Sets the visibility of the Header in this Grid. + * + * @param headerVisible + * {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public void setHeaderVisible(boolean headerVisible) { + getHeader().setVisible(headerVisible); + } + + /** + * Gets the visibility of the Header in this Grid. + * + * @return {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public boolean isHeaderVisible() { + return getHeader().isVisible(); + } + + /** * Returns the current default row of the header. * * @return the default row or null if no default row set @@ -3357,6 +3380,29 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** + * Sets the visibility of the Footer in this Grid. + * + * @param footerVisible + * {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public void setFooterVisible(boolean footerVisible) { + getFooter().setVisible(footerVisible); + } + + /** + * Gets the visibility of the Footer in this Grid. + * + * @return {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public boolean isFooterVisible() { + return getFooter().isVisible(); + } + + /** * Returns the footer section of this grid. * * @return the footer section diff --git a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java index 947be8f522..da5cafb9d6 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java @@ -798,4 +798,28 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> return Collections.unmodifiableList(rows); } + /** + * Sets the visibility of this section. + * + * @param visible + * {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public void setVisible(boolean visible) { + if (getState(false).visible != visible) { + getState(true).visible = visible; + } + } + + /** + * Gets the visibility of this section. + * + * @return {@code true} if visible; {@code false} if not + * + * @since 8.1.1 + */ + public boolean isVisible() { + return getState(false).visible; + } } |