aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/Grid.java
diff options
context:
space:
mode:
authorKnoobie <Knoobie@gmx.de>2017-10-30 09:00:21 +0100
committerPéter Török <31210544+torok-peter@users.noreply.github.com>2017-10-30 10:00:21 +0200
commite65efdfb50bc10bedf506d475f582276f6be0e2f (patch)
tree73c6ef9f6ad9658ea2ff564024f8426433c69b06 /server/src/main/java/com/vaadin/ui/Grid.java
parentfb6e81221bd1b5ab0b81a3ee6c82e4286df57264 (diff)
downloadvaadin-framework-e65efdfb50bc10bedf506d475f582276f6be0e2f.tar.gz
vaadin-framework-e65efdfb50bc10bedf506d475f582276f6be0e2f.zip
add Grid.Column#get/setAssistiveCaption (#10219)
* add Grid#Column#get/setAssistiveCaption * fix test and update doc * move testGridAssistiveCaption to GridTest * delete test file * delete test file * Delete GridAssistiveCaptionTest.java * Create GridAssistiveCaptionTest * Create GridAssistiveCaption * Rename GridAssistiveCaption to GridAssistiveCaption.java * Rename GridAssistiveCaptionTest to GridAssistiveCaptionTest.java * Reformat using eclipse
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/Grid.java')
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java34
1 files changed, 34 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 7282afb44c..1e35578b19 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -1203,6 +1203,36 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
}
/**
+ * Sets the header aria-label for this column.
+ *
+ * @param caption
+ * the header aria-label, null removes
+ * the aria-label from this column
+ *
+ * @return this column
+ *
+ * @since
+ */
+ public Column<T, V> setAssistiveCaption(String caption) {
+ if (Objects.equals(caption, getAssistiveCaption())) {
+ return this;
+ }
+ getState().assistiveCaption = caption;
+ return this;
+ }
+
+ /**
+ * Gets the header caption for this column.
+ *
+ * @return header caption
+ *
+ * @since
+ */
+ public String getAssistiveCaption() {
+ return getState(false).assistiveCaption;
+ }
+
+ /**
* Sets the header caption for this column.
*
* @param caption
@@ -2131,6 +2161,10 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
setHidingToggleCaption(DesignAttributeHandler.readAttribute(
"hiding-toggle-caption", attributes, String.class));
}
+ if (design.hasAttr("assistive-caption")) {
+ setAssistiveCaption(DesignAttributeHandler.readAttribute(
+ "assistive-caption", attributes, String.class));
+ }
// Read size info where necessary.
if (design.hasAttr("width")) {