com.vaadin.ui.Button.setCaption()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中com.vaadin.ui.Button.setCaption()方法的一些代码示例,展示了Button.setCaption()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setCaption()方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:setCaption

Button.setCaption介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Creates a new push button with the given caption.
 *
 * @param caption
 *            the Button caption.
 */
public Button(String caption) {
  this();
  setCaption(caption);
}

代码示例来源:origin: com.vaadin/vaadin-server

@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());
  }
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * 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);
}

代码示例来源:origin: OpenNMS/opennms

/**
 * 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;
}

代码示例来源:origin: OpenNMS/opennms

/**
 * 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;
}

代码示例来源:origin: OpenNMS/opennms

/**
 * 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;
}

代码示例来源:origin: org.opennms.features.vaadin-components/core

/**
 * 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;
}

代码示例来源:origin: OpenNMS/opennms

/**
 * 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;
}

代码示例来源:origin: OpenNMS/opennms

public ConfirmationDialog withCancelLabel(String cancelLabel) {
  cancelButton.setCaption(cancelLabel);
  return this;
}

代码示例来源:origin: org.opennms.features.vaadin-components/core

/**
 * 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;
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

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);
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-widgets

@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);
  }
}

代码示例来源:origin: viritin/viritin

public void setSaveCaption(String saveCaption) {
  this.saveCaption = saveCaption;
  if (saveButton != null) {
    getSaveButton().setCaption(getSaveCaption());
  }
}

代码示例来源:origin: uk.q3c.krail/krail

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());
}

代码示例来源:origin: OpenNMS/opennms

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;
}

代码示例来源:origin: org.opennms.features/jmxconfiggenerator.webui

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;
}

代码示例来源:origin: org.opennms.features.vaadin-components/core

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;
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

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);
}

代码示例来源:origin: org.activiti/activiti-explorer

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);
  }
 });
}

代码示例来源:origin: nz.co.senanque/madura-vaadinsupport

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);  
}

相关文章