diff options
Diffstat (limited to 'server/src')
-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; + } } |