/** * Sets the icon for an item. * * @param itemId the id of the item to be assigned an icon. * @param icon the icon to use or null. * @param altText the alternative text for the icon */ public void setItemIcon(Object itemId, Resource icon, String altText) { if (itemId != null) { super.setItemIcon(itemId, icon); if (icon == null) { itemIconAlts.remove(itemId); } else if (altText == null) { throw new IllegalArgumentException(NULL_ALT_EXCEPTION_MESSAGE); } else { itemIconAlts.put(itemId, altText); } markAsDirty(); } }