com.vaadin.flow.dom.Element.setProperty()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(143)

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

Element.setProperty介绍

[英]Sets the given property to the given numeric value.

Note that properties changed on the server are updated on the client but changes made on the client side are not reflected back to the server unless configured using #addSynchronizedProperty(String) and #addSynchronizedPropertyEvent(String).
[中]将给定的属性设置为给定的数值。
请注意,在服务器上更改的属性将在客户端更新,但在客户端所做的更改不会反映回服务器,除非使用#addSynchronizedProperty(字符串)和#addSynchronizedPropertyEvent(字符串)进行配置。

代码示例

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

/**
 * Selects a tab based on its zero-based index.
 *
 * @param selectedIndex
 *            the zero-based index of the selected tab, -1 to unselect all
 */
public void setSelectedIndex(int selectedIndex) {
  getElement().setProperty(SELECTED, selectedIndex);
}

代码示例来源:origin: com.vaadin/vaadin-cookie-consent-flow

/**
 * Sets the dismiss/consent button's text
 *
 * @param dismissLabel
 *            The text of the button.
 */
public void setDismissLabel(String dismissLabel) {
  getElement().setProperty("dismiss", dismissLabel);
}

代码示例来源:origin: com.vaadin/vaadin-cookie-consent-flow

/**
 * Sets the label of the 'learn more' link
 *
 * @param learnMoreLabel
 *            The text to show on the 'learn more' link.
 */
public void setLearnMoreLabel(String learnMoreLabel) {
  getElement().setProperty("learnMore", learnMoreLabel);
}

代码示例来源:origin: com.vaadin/vaadin-custom-field-flow

/**
 * <p>
 * This property is set to true when the control value is invalid.
 * </p>
 *
 * @param invalid the boolean value to set
 */
@Override
public void setInvalid(boolean invalid) {
  getElement().setProperty("invalid", invalid);
}

代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow

/**
 * Whether to show or hide Reject button.
 */
public void setRejectable(boolean rejectable) {
  getElement().setProperty("reject", rejectable);
}

代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow

/**
 * Sets confirmation message text
 */
public void setText(String message) {
  getElement().setProperty("message", message);
}

代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow

/**
 * Sets Reject button theme
 */
public void setRejectButtonTheme(String rejectTheme) {
  getElement().setProperty("rejectTheme", rejectTheme);
}

代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow

/**
 * Sets confirmation dialog header text
 */
public void setHeader(String header) {
  getElement().setProperty("header", header);
}

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

/**
 * Opens the panel at the specified index.
 *
 * @param index the (positive) index of the panel to be open.
 *              The first panel is at index zero.
 */
public void open(int index) {
  if (index < 0) {
    throw new IllegalArgumentException("The index to open cannot be negative");
  }
  getElement().setProperty(OPENED_PROPERTY, index);
}

代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow

/**
 * Whether to show or hide Cancel button.
 */
public void setCancelable(boolean cancelable) {
  getElement().setProperty("cancel", cancelable);
}

代码示例来源:origin: com.vaadin/incubator-tooltip-flow

/**
 * Hides the content of the tooltip.
 */
public void close() {
  getElement().setProperty(HIDDEN_MSG_PROPERTY, true);
}

代码示例来源:origin: com.vaadin/vaadin-radio-button-flow

/**
 * @param name
 *            the String value to set
 */
protected void setName(String name) {
  getElement().setProperty("name", name == null ? "" : name);
}

代码示例来源:origin: com.vaadin/incubator-tooltip-flow

/**
 * Sets the position of the tooltip.
 *
 * @param position "top","right","left" or "bottom"
 */
private void setPosition(String position) {
  getElement().setProperty(POSITION_PROPERTY, position);
}

代码示例来源:origin: com.vaadin/vaadin-cookie-consent-flow

/**
 * Sets the URL of the 'learn more' link
 *
 * @param learnMoreLink
 *            The URL the 'learn more' link should open.
 */
public void setLearnMoreLink(String learnMoreLink) {
  getElement().setProperty("learnMoreLink", learnMoreLink);
}

代码示例来源:origin: com.vaadin/vaadin-cookie-consent-flow

/**
 * Sets the position of the banner on the page.
 *
 * @param position
 *            Determines the position of the banner.
 * @throws NullPointerException
 *             if position is null.
 */
public void setPosition(Position position) {
  getElement().setProperty("position",
      position.name().toLowerCase().replace('_', '-'));
}

代码示例来源:origin: vaadin/spring

public TemplateInjectsTemplate() {
    template.getElement().setProperty("foo", "bar");
    div.setText("baz");
  }
}

代码示例来源:origin: vaadin/spring

@Override
  protected void onAttach(AttachEvent attachEvent) {
    getElement().setProperty("message", backend.getMessage());
  }
}

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

@Override
  public void accept(UI ui) {
    if (this == deferredJob) {
      String appId = ui.getInternals().getAppId();
      int nodeId = container.getNode().getId();
      String template = String.format(
          "<flow-component-renderer appid=\"%s\" nodeid=\"%s\"></flow-component-renderer>",
          appId, nodeId);
      templateElement.setProperty("innerHTML", template);
    }
  }
}

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

VaadinItem(String key, T item) {
  this.item = item;
  getElement().setProperty("value", key);
  getElement().setAttribute("value", key);
}

代码示例来源:origin: com.vaadin/vaadin-context-menu-flow

private void resetContainers(I menuItem) {
  if (!menuItem.isParentItem()) {
    menuItem.getElement().removeProperty("_containerNodeId");
    return;
  }
  SubMenuBase<C, I, S> subMenu = menuItem.getSubMenu();
  int containerNodeId = createNewContainer(subMenu.getChildren());
  menuItem.getElement().setProperty("_containerNodeId", containerNodeId);
  subMenu.getItems().forEach(this::resetContainers);
}

相关文章

微信公众号

最新文章

更多