aboutsummaryrefslogtreecommitdiffstats
path: root/shared/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/main')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java
index 69bc065cff..553e82a57e 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java
@@ -31,6 +31,18 @@ import com.vaadin.shared.annotations.NoLayout;
*/
public class AbstractDateFieldState extends AbstractFieldState {
+ /**
+ * Navigation elements that have assistive label.
+ *
+ * @since
+ */
+ public enum AccessibleElement {
+ PREVIOUS_YEAR,
+ NEXT_YEAR,
+ PREVIOUS_MONTH,
+ NEXT_MONTH
+ }
+
{
primaryStyleName = "v-datefield";
}
@@ -114,4 +126,19 @@ public class AbstractDateFieldState extends AbstractFieldState {
*/
public Map<String, String> dateStyles = new HashMap<String, String>();
+ /**
+ * Map of elements and their corresponding assistive labels.
+ *
+ * @since
+ */
+ public Map<AccessibleElement, String> assistiveLabels = new HashMap<>();
+
+ // Set default accessive labels
+ {
+ assistiveLabels.put(AccessibleElement.PREVIOUS_YEAR, "Previous year");
+ assistiveLabels.put(AccessibleElement.NEXT_YEAR, "Next year");
+ assistiveLabels.put(AccessibleElement.PREVIOUS_MONTH, "Previous month");
+ assistiveLabels.put(AccessibleElement.NEXT_MONTH, "Next month");
+ }
+
}