public void setShotcutLabel(String action, int number) { NativeButton itemButton = shotcutMaps.get(action); if (itemButton != null) { ShotcutItem item = (ShotcutItem) itemButton.getData(); if (item.getNumber() != number) { if (number == 0) { itemButton.setCaption(message.getString(item.getLabel())); item.setNumber(Long.valueOf(number)); } else { itemButton.setCaption( message.getString(item.getLabel()) + " <span style=\"" + InnerStyle.notify_Number + "\">" + number + "</span>"); item.setNumber(Long.valueOf(number)); } } } }
public NativeButton createNativeButton(ShotcutItem item) { NativeButton itemButton = new NativeButton(message.getString(item.getLabel())); itemButton.setHtmlContentAllowed(true); itemButton.setWidth("100%"); String icon = item.getIcon(); if (icon != null) { itemButton.setIcon(new ThemeResource(icon)); } itemButton.setData(item); itemButton.addListener(this); if (PresenterProperty.HOME.equals(item.getAction())) { itemButton.addStyleName("v-nativebutton-selected"); } if (PresenterProperty.NOTIFICATION.equals(item.getAction())) { notifyButton = itemButton; } shotcuts.add(itemButton); shotcutMaps.put(item.getAction(), itemButton); return itemButton; }