/** * Creates a new push button with the given caption. * * @param caption * the Button caption. */ public Button(String caption) { this(); setCaption(caption); }
@Override public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); Attributes attr = design.attributes(); String content; // plain-text (default is html) Boolean plain = DesignAttributeHandler .readAttribute(DESIGN_ATTR_PLAIN_TEXT, attr, Boolean.class); if (plain == null || !plain) { setCaptionAsHtml(true); content = design.html(); } else { // content is not intended to be interpreted as HTML, // so html entities need to be decoded content = DesignFormatter.decodeFromTextNode(design.html()); } setCaption(content); if (attr.hasKey("icon-alt")) { setIconAlternateText(DesignAttributeHandler .readAttribute("icon-alt", attr, String.class)); } // click-shortcut removeClickShortcut(); ShortcutAction action = DesignAttributeHandler .readAttribute("click-shortcut", attr, ShortcutAction.class); if (action != null) { setClickShortcut(action.getKeyCode(), action.getModifiers()); } }
/** * Creates a new push button with the given caption and icon. * * @param caption * the caption * @param icon * the icon */ public Button(String caption, Resource icon) { this(); setCaption(caption); setIcon(icon); }
/** * Sets the label of the cancel button. * * @param cancelLabel the label to be used * @return the instance itself */ public KeyValueInputDialogWindow withCancelLabel(String cancelLabel) { m_cancelButton.setCaption(cancelLabel); return this; }
/** * Sets the label of the ok button. * * @param okLabel the label to be used * @return the instance itself */ public StringInputDialogWindow withOkLabel(String okLabel) { m_okButton.setCaption(okLabel); return this; }
/** * Sets the label of the ok button. * * @param okLabel the label to be used * @return the instance itself */ public KeyValueInputDialogWindow withOkLabel(String okLabel) { m_okButton.setCaption(okLabel); return this; }
/** * Sets the label of the cancel button. * * @param cancelLabel the label to be used * @return the instance itself */ public StringInputDialogWindow withCancelLabel(String cancelLabel) { m_cancelButton.setCaption(cancelLabel); return this; }
/** * Sets the label of the cancel button. * * @param cancelLabel the label to be used * @return the instance itself */ public StringInputDialogWindow withCancelLabel(String cancelLabel) { m_cancelButton.setCaption(cancelLabel); return this; }
public ConfirmationDialog withCancelLabel(String cancelLabel) { cancelButton.setCaption(cancelLabel); return this; }
/** * Sets the label of the ok button. * * @param okLabel the label to be used * @return the instance itself */ public KeyValueInputDialogWindow withOkLabel(String okLabel) { m_okButton.setCaption(okLabel); return this; }
public void setFileNameButtonCaption(String title) { this.fileName = title; if (StringUtils.isNotEmpty(title)) { fileNameButton.setCaption(title); fileNameButton.removeStyleName(EMPTY_VALUE_STYLENAME); } else { fileNameButton.setCaption(fileNotSelectedMessage); fileNameButton.addStyleName(EMPTY_VALUE_STYLENAME); } }
@Override protected void doSetValue(V newValue) { this.value = newValue; if (captionFormatter == null) { getContent().setCaption(newValue == null ? "" : newValue.toString()); } else { String caption = captionFormatter.convertToPresentation(newValue, getLocale()); getContent().setCaption(caption); } }
public void setSaveCaption(String saveCaption) { this.saveCaption = saveCaption; if (saveButton != null) { getSaveButton().setCaption(getSaveCaption()); } }
protected final void build() { log.debug("building with Locale={}", currentLocale.getLocale()); boolean authenticated = subjectProvider.get() .isAuthenticated(); String caption = (authenticated) ? translate.from(LabelKey.Log_Out) : translate.from(LabelKey.Log_In); log.debug("Caption is '{}'", caption); login_logout_Button.setCaption(caption.toLowerCase()); usernameLabel.setValue(subjectIdentifier.subjectName()); }
public static Button createButton( final String buttonCaption, final String buttonDescription, final Resource icon, final ClickListener clickListener) { Button button = new Button(); button.setCaption(buttonCaption); button.setIcon(icon); if (buttonDescription != null) button.setDescription(buttonDescription); if (clickListener != null) button.addClickListener(clickListener); return button; }
public static Button createButton(final String buttonCaption, final String iconName, final ClickListener clickListener) { Button button = new Button(); button.setCaption(buttonCaption); button.setIcon(IconProvider.getIcon(iconName)); if (clickListener != null) button.addListener(clickListener); return button; }
public static Button createButton( final String buttonCaption, final String buttonDescription, final Resource icon, final ClickListener clickListener) { Button button = new Button(); button.setCaption(buttonCaption); button.setIcon(icon); if (buttonDescription != null) button.setDescription(buttonDescription); if (clickListener != null) button.addClickListener(clickListener); return button; }
protected void onLinkClick() { int count = adapter.getCount(); component.getCountButton().setCaption(String.valueOf(count)); // todo rework with datatype component.getCountButton().addStyleName("c-paging-count-number"); component.getCountButton().setEnabled(false); }
protected void initActions() { Button newCaseButton = new Button(); newCaseButton.setCaption(i18nManager.getMessage(Messages.TASK_NEW)); newCaseButton.setIcon(Images.TASK_16); addButton(newCaseButton); newCaseButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { NewCasePopupWindow newTaskPopupWindow = new NewCasePopupWindow(); viewManager.showPopupWindow(newTaskPopupWindow); } }); }
public void bind (final Button button, List<MaduraPropertyWrapper> properties) { ButtonProperty buttonProperty = (ButtonProperty)button.getPropertyDataSource(); buttonProperty.getPainter().setProperties(properties); button.setCaption(buttonProperty.getCaption()); buttonProperty.getPainter().paint(button); }