diff options
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r-- | server/src/com/vaadin/ui/PopupDateField.java | 4 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Tree.java | 27 |
2 files changed, 26 insertions, 5 deletions
diff --git a/server/src/com/vaadin/ui/PopupDateField.java b/server/src/com/vaadin/ui/PopupDateField.java index b113378e74..e95941e3fe 100644 --- a/server/src/com/vaadin/ui/PopupDateField.java +++ b/server/src/com/vaadin/ui/PopupDateField.java @@ -125,7 +125,7 @@ public class PopupDateField extends DateField { * @param descriptionForAssistiveDevices * String with the description */ - public void setDescriptionForAssistiveDevices(String description) { + public void setAssisitiveText(String description) { getState().descriptionForAssistiveDevices = description; } @@ -135,7 +135,7 @@ public class PopupDateField extends DateField { * * @return String with the description */ - public String getDescriptionForAssistiveDevices() { + public String getAssisitiveText() { return getState().descriptionForAssistiveDevices; } } diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java index 64854ebcdf..a5c3819edd 100644 --- a/server/src/com/vaadin/ui/Tree.java +++ b/server/src/com/vaadin/ui/Tree.java @@ -72,6 +72,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /* Private members */ + private static final String NULL_ALT_EXCEPTION_MESSAGE = "Parameter 'altText' needs to be non null"; + /** * Item icons alt texts. */ @@ -182,7 +184,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * the icon to use or null. * * @param altText - * String with the alternative text for the icon + * the alternative text for the icon */ public void setItemIcon(Object itemId, Resource icon, String altText) { if (itemId != null) { @@ -191,8 +193,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, if (icon == null) { itemIconAlts.remove(itemId); } else if (altText == null) { - throw new IllegalArgumentException( - "Parameter 'altText' needs to be non null"); + throw new IllegalArgumentException(NULL_ALT_EXCEPTION_MESSAGE); } else { itemIconAlts.put(itemId, altText); } @@ -201,6 +202,26 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, } /** + * Set the alternate text for an item. + * + * Used when the item has an icon. + * + * @param itemId + * the id of the item to be assigned an icon. + * @param altText + * the alternative text for the icon + */ + public void setItemIconAlternateText(Object itemId, String altText) { + if (itemId != null) { + if (altText == null) { + throw new IllegalArgumentException(NULL_ALT_EXCEPTION_MESSAGE); + } else { + itemIconAlts.put(itemId, altText); + } + } + } + + /** * Return the alternate text of an icon in a tree item. * * @param itemId |