本文整理了Java中com.vaadin.flow.dom.Element.setEnabled()
方法的一些代码示例,展示了Element.setEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.setEnabled()
方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称:Element
方法名:setEnabled
[英]Sets the enabled state of the element.
[中]
代码示例来源:origin: com.vaadin/flow-server
/**
* Sets the UI object explicitly disabled or enabled.
*
* @param enabled
* if {@code false} then explicitly disables the object, if
* {@code true} then enables the object so that its state depends
* on parent
*/
default void setEnabled(boolean enabled) {
/*
* XXX WARNING Do not override this method. Propagating the enabled
* state to the element in this way is critical to fulfill generic
* assumptions with regards to application security.
*/
getElement().setEnabled(enabled);
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
@Override
public void setEnabled(boolean enabled) {
components.stream().map(b -> b.getElement()).forEach(i -> {
if (i.hasEnabled().isPresent()) {
i.hasEnabled().get().setEnabled(enabled);
} else {
i.getComponent().getElement().setEnabled(enabled);
}
});
}
代码示例来源:origin: com.vaadin/vaadin-select-flow
private void updateItemEnabled(VaadinItem<T> item) {
boolean itemEnabled = isItemEnabled(item.getItem());
boolean disabled = isDisabledBoolean() || !itemEnabled;
// The disabled attribute should be set when the item is disabled,
// but not if only the select is disabled, because setting disabled
// attribute clears the selected value of an item.
item.getElement().setEnabled(!disabled);
item.getElement().setAttribute("disabled", !itemEnabled);
}
代码示例来源:origin: com.vaadin/vaadin-iron-list-flow
Component component = componentRenderer
.createComponent(placeholderItem);
component.getElement().setEnabled(isEnabled());
placeholderTemplate = component.getElement().getOuterHTML();
} else {
内容来源于网络,如有侵权,请联系作者删除!