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

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

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

Button.setData介绍

暂无

代码示例

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

private void resizeButtonClick(ClickEvent event) {
  boolean minimize = (Boolean) resize.getData();
  if (minimize) {
    historyContainer.setHeight("27px");
    history.setHeight("22px");
  } else {
    historyContainer.setHeight("90px");
    history.setHeight("85px");
  }
  resize.setData(!minimize);
}

代码示例来源:origin: stackoverflow.com

Button button = ...
button.setData("row.id", rowId); // Can also use row index here or something

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

resize.setData(false);
resize.setWidth("100%");
resize.setHeight("10px");

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

@Override
  public void buttonClick(ClickEvent event) {
    close();
    Button button = (com.vaadin.ui.Button)(event.getSource());
    button.setData((launcher?WorkflowForm.LAUNCH:WorkflowForm.OK)+processId);
    fireEvent(event);
  }});
ret.addComponent(actions);

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

protected Button createButton(String name,
    ButtonPainter painter, ClickListener listener, Object data)
{
  Button ret = m_maduraFieldFactory.createButton(name, listener, painter);
  painter.setForm(this);
  m_myButtons.add(ret);
  if (data != null)
  {
    ret.setData(data);
  }
  return ret;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button customMetadataDetailButton(final String metadataKey) {
  final Button viewIcon = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), metadataKey,
      "View " + metadataKey + "  Metadata details", null, false, null, SPUIButtonStyleNoBorder.class);
  viewIcon.setData(metadataKey);
  viewIcon.addStyleName(ValoTheme.BUTTON_TINY + " " + ValoTheme.BUTTON_LINK + " " + "on-focus-no-border link"
      + " " + "text-style");
  viewIcon.addClickListener(event -> showMetadataDetails(metadataKey));
  return viewIcon;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button createSearchIcon() {
  searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "",
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
      SPUIButtonStyleNoBorder.class);
  searchIcon.addClickListener(event -> onSearchIconClick());
  searchIcon.setEnabled(false);
  searchIcon.setData(false);
  return searchIcon;
}

代码示例来源:origin: eclipse/hawkbit

private Button createSearchIcon() {
  searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "",
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
      SPUIButtonStyleNoBorder.class);
  searchIcon.addClickListener(event -> onSearchIconClick());
  searchIcon.setEnabled(false);
  searchIcon.setData(false);
  return searchIcon;
}

代码示例来源:origin: eclipse/hawkbit

private Button customMetadataDetailButton(final String metadataKey) {
  final Button viewIcon = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), metadataKey,
      "View " + metadataKey + "  Metadata details", null, false, null, SPUIButtonStyleNoBorder.class);
  viewIcon.setData(metadataKey);
  viewIcon.addStyleName(ValoTheme.BUTTON_TINY + " " + ValoTheme.BUTTON_LINK + " " + "on-focus-no-border link"
      + " " + "text-style");
  viewIcon.addClickListener(event -> showMetadataDetails(metadataKey));
  return viewIcon;
}

代码示例来源:origin: eclipse/hawkbit

private Button getDeleteButton(final Long itemId) {
  final Item row = getItem(itemId);
  final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue();
  final Button deleteIcon = SPUIComponentProvider.getButton(getDeleteIconId(tfName), "",
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE_CUSTOM_FILTER),
      ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
  deleteIcon.setData(itemId);
  deleteIcon.addClickListener(this::onDelete);
  return deleteIcon;
}

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

public void register(final Button field, ButtonPainter painter)
{
  MaduraPropertyWrapper property = painter.getProperty();        
  ButtonProperty bp = new ButtonProperty(painter,field.getCaption(),m_messageSource);
  field.setData(bp);
  if (property != null)
  {
    Hints hints = getHints();
    hints.setCommonProperties(field, property,m_messageSource);
    setPermissions(property, field);
  }
  registerWidget(field);
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button getDeleteButton(final Long itemId) {
  final Item row = getItem(itemId);
  final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue();
  final Button deleteIcon = SPUIComponentProvider.getButton(getDeleteIconId(tfName), "",
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE_CUSTOM_FILTER),
      ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
  deleteIcon.setData(itemId);
  deleteIcon.addClickListener(this::onDelete);
  return deleteIcon;
}

代码示例来源:origin: eclipse/hawkbit

@Override
  public Button generateCell(final Table source, final Object itemId, final Object columnId) {
    final String fileName = (String) table.getContainerDataSource().getItem(itemId)
        .getItemProperty(PROVIDED_FILE_NAME).getValue();
    final Button deleteIcon = SPUIComponentProvider.getButton(
        fileName + "-" + UIComponentIdProvider.UPLOAD_FILE_DELETE_ICON, "",
        i18n.getMessage(UIMessageIdProvider.CAPTION_DISCARD), ValoTheme.BUTTON_TINY + " " + "blueicon",
        true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
    deleteIcon.setData(itemId);
    deleteIcon.addClickListener(event -> confirmAndDeleteArtifact((Long) itemId, fileName));
    return deleteIcon;
  }
});

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button createFilterButton(final Long id, final String name, final Object itemId) {
  final Button button = SPUIComponentProvider.getButton("", name, name, "", false, null,
      SPUITagButtonStyle.class);
  button.addStyleName("custom-filter-button");
  button.setId(name);
  if (id != null) {
    button.setCaption(name);
  }
  button.setDescription(name);
  button.setData(itemId);
  button.addClickListener(event -> customTargetTagFilterButtonClick.processButtonClick(event));
  return button;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
  public Button generateCell(final Table source, final Object itemId, final Object columnId) {
    final String fileName = (String) table.getContainerDataSource().getItem(itemId)
        .getItemProperty(PROVIDED_FILE_NAME).getValue();
    final Button deleteIcon = SPUIComponentProvider.getButton(
        fileName + "-" + UIComponentIdProvider.UPLOAD_FILE_DELETE_ICON, "",
        i18n.getMessage(UIMessageIdProvider.CAPTION_DISCARD), ValoTheme.BUTTON_TINY + " " + "blueicon",
        true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
    deleteIcon.setData(itemId);
    deleteIcon.addClickListener(event -> confirmAndDeleteArtifact((Long) itemId, fileName));
    return deleteIcon;
  }
});

代码示例来源:origin: eclipse/hawkbit

private Button createFilterButton(final Long id, final String name, final Object itemId) {
  final Button button = SPUIComponentProvider.getButton("", name, name, "", false, null,
      SPUITagButtonStyle.class);
  button.addStyleName("custom-filter-button");
  button.setId(name);
  if (id != null) {
    button.setCaption(name);
  }
  button.setDescription(name);
  button.setData(itemId);
  button.addClickListener(event -> customTargetTagFilterButtonClick.processButtonClick(event));
  return button;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button customFilterDetailButton(final Long itemId) {
  final Item row1 = getItem(itemId);
  final String tfName = (String) row1.getItemProperty(SPUILabelDefinitions.NAME).getValue();
  final Button updateIcon = SPUIComponentProvider.getButton(getDetailLinkId(tfName), tfName,
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE_CUSTOM_FILTER), null, false, null,
      SPUIButtonStyleNoBorder.class);
  updateIcon.setData(tfName);
  updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
  updateIcon.addClickListener(this::onClickOfDetailButton);
  return updateIcon;
}

代码示例来源:origin: eclipse/hawkbit

private Button customFilterDetailButton(final Long itemId) {
  final Item row1 = getItem(itemId);
  final String tfName = (String) row1.getItemProperty(SPUILabelDefinitions.NAME).getValue();
  final Button updateIcon = SPUIComponentProvider.getButton(getDetailLinkId(tfName), tfName,
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE_CUSTOM_FILTER), null, false, null,
      SPUIButtonStyleNoBorder.class);
  updateIcon.setData(tfName);
  updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
  updateIcon.addClickListener(this::onClickOfDetailButton);
  return updateIcon;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button createPinBtn(final Object itemId) {
  final Item item = getContainerDataSource().getItem(itemId);
  final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();
  final String version = (String) item.getItemProperty(SPUILabelDefinitions.VAR_VERSION).getValue();
  final DistributionSetIdName distributionSetIdName = new DistributionSetIdName((Long) itemId, name, version);
  final Button pinBtn = new Button();
  pinBtn.setIcon(FontAwesome.THUMB_TACK);
  pinBtn.setHeightUndefined();
  pinBtn.addStyleName(getPinStyle());
  pinBtn.setData(distributionSetIdName);
  pinBtn.setId(getPinButtonId(name, version));
  pinBtn.setImmediate(true);
  pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN));
  return pinBtn;
}

代码示例来源:origin: eclipse/hawkbit

private Button createPinBtn(final Object itemId) {
  final Item item = getContainerDataSource().getItem(itemId);
  final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();
  final String version = (String) item.getItemProperty(SPUILabelDefinitions.VAR_VERSION).getValue();
  final DistributionSetIdName distributionSetIdName = new DistributionSetIdName((Long) itemId, name, version);
  final Button pinBtn = new Button();
  pinBtn.setIcon(FontAwesome.THUMB_TACK);
  pinBtn.setHeightUndefined();
  pinBtn.addStyleName(getPinStyle());
  pinBtn.setData(distributionSetIdName);
  pinBtn.setId(getPinButtonId(name, version));
  pinBtn.setImmediate(true);
  pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN));
  return pinBtn;
}

相关文章