本文整理了Java中com.vaadin.flow.dom.Element.appendChild()
方法的一些代码示例,展示了Element.appendChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.appendChild()
方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称:Element
方法名:appendChild
暂无
代码示例来源:origin: com.vaadin/flow-component-demo-helpers
/**
* Default constructor. Creates an empty navigation bar.
*/
public DemoNavigationBar() {
getElement().appendChild(list);
}
代码示例来源:origin: com.vaadin/flow-component-demo-helpers
/**
* Adds an {@link Element} directly into this component, without need to use
* a component for it.
*
* @param element
* The element to be added to this component.
*/
public void add(Element element) {
getElement().appendChild(element);
}
代码示例来源:origin: com.vaadin/vaadin-confirm-dialog-flow
/**
* Sets custom confirmation message element
*
* @param element
* the element to display instead of default
* confirmation text node
*/
public void setText(Element element) {
getElement().appendChild(element);
}
代码示例来源:origin: com.vaadin/vaadin-app-layout-flow
/**
* Sets the displayed content.
*
* @param content {@link Element} to display in the content area
*/
public void setContent(Element content) {
Objects.requireNonNull(content, "Content cannot be null");
removeContent();
this.content = content;
getElement().appendChild(content);
}
代码示例来源:origin: com.vaadin/vaadin-accordion-flow
/**
* Adds a panel.
*
* @param panel the non-null panel to be added
* @return the added panel
*/
public AccordionPanel add(AccordionPanel panel) {
Objects.requireNonNull(panel, "The panel to be added cannot be null");
getElement().appendChild(panel.getElement());
return panel;
}
代码示例来源:origin: com.vaadin/vaadin-context-menu-flow
private int createNewContainer(Stream<Component> components) {
Element subContainer = new Element("div");
container.appendChild(subContainer);
components
.forEach(child -> subContainer.appendChild(child.getElement()));
return subContainer.getNode().getId();
}
代码示例来源:origin: com.vaadin/flow-component-demo-helpers
@Override
public void add(Component... components) {
assert components != null;
for (Component component : components) {
assert component != null;
getElement().appendChild(component.getElement());
getElement().appendChild(getSpacer());
}
}
代码示例来源:origin: appreciated/vaadin-app-layout
@Override
public void setAppLayoutContent(HasElement content) {
if (content != null) {
this.content.getElement().appendChild(content.getElement());
}
}
代码示例来源:origin: appreciated/vaadin-app-layout
private void add(Component component) {
if (component != null) {
getElement().appendChild(component.getElement());
}
}
代码示例来源:origin: com.vaadin/vaadin-app-layout-flow
/**
* Sets the element into branding area
*
* @param branding {@link Element} to set into branding area
*/
public void setBranding(Element branding) {
Objects.requireNonNull(branding, "Branding cannot be null");
removeBranding();
this.branding = branding;
branding.setAttribute("slot", "branding");
getElement().appendChild(branding);
}
代码示例来源:origin: com.vaadin/vaadin-app-layout-flow
/**
* Sets the element to be placed in the menu slot.
*
* @param menu {@link Element} to placed in the menu slot.
*/
public void setMenu(Element menu) {
Objects.requireNonNull(menu, "Menu cannot be null");
removeMenu();
this.menu = menu;
menu.setAttribute("slot", "menu");
getElement().appendChild(menu);
}
代码示例来源:origin: appreciated/vaadin-app-layout
@Override
public void setAppLayoutContent(HasElement content) {
if (content != null) {
this.content.getElement().appendChild(content.getElement());
setUpBackNavigation(content);
}
}
代码示例来源:origin: com.vaadin/flow-component-demo-helpers
private void addSourceCodeBlock(String text, String className) {
Element pre = new Element("pre");
Element code = new Element("code");
pre.appendChild(code);
code.setAttribute("spellcheck", "false");
code.getClassList().add(className);
code.setText(text);
getElement().appendChild(pre);
}
}
代码示例来源:origin: com.vaadin/flow-server
private void setTextContent(String textContent) {
Element child;
if (getChildCount() == 1 && getChild(0).isTextNode()) {
child = getChild(0).setText(textContent);
} else {
child = createText(textContent);
}
removeAllChildren();
appendChild(child);
}
代码示例来源:origin: com.vaadin/vaadin-select-flow
/**
* Constructs a select.
*/
public Select() {
super(null, null, String.class, Select::presentationToModel,
Select::modelToPresentation);
getElement().setProperty("invalid", false);
getElement().setProperty("opened", false);
getElement().appendChild(listBox.getElement());
registerValidation();
}
代码示例来源:origin: appreciated/vaadin-app-layout
@Override
public void add(Component... components) {
if (content == null) {
content = new Div();
content.getElement().getClassList().add("card-content");
getElement().appendChild(content.getElement());
}
content.add(components);
}
代码示例来源:origin: com.vaadin/vaadin-button-flow
private void wrapTextInSpan() {
String text = getText();
getElement().removeChild(getTextNodes());
span = ElementFactory.createSpan(text);
if (iconAfterText) {
getElement().insertChild(0, span);
} else {
getElement().appendChild(span);
}
}
代码示例来源:origin: com.vaadin/vaadin-notification-flow
private void initBaseElementsAndListeners() {
getElement().appendChild(templateElement);
getElement().appendVirtualChild(container);
getElement().addEventListener("opened-changed", event -> {
if (autoAddedToTheUi && !isOpened()) {
getElement().removeFromParent();
autoAddedToTheUi = false;
}
});
}
代码示例来源:origin: appreciated/vaadin-app-layout
public LeftSubmenuComponent(String caption, Icon icon, List<Component> submenuElements) {
super(caption, icon);
getStyle().set("--app-layout-menu-padding", "0");
getItem().getElement().getStyle().set("white-space", "nowrap");
getToggleWrapper().getElement().appendChild(new PaperRipple().getElement());
getToggleWrapper().getElement().getStyle().set("position", "relative");
getMenu().getStyle().set("background", "var(--app-layout-drawer-submenu-background-color)");
submenuElements.forEach(element1 -> getMenu().add(element1));
this.caption = caption;
this.icon = icon;
}
代码示例来源:origin: appreciated/vaadin-app-layout
public AppMenuItem() {
getElement().getClassList().add("app-menu-item");
getElement().setAttribute("href", "javascript:void(0)");
getElement().getStyle().set("position", "relative")
.set("padding", "var(--app-layout-menu-button-padding)")
.set("margin", "var(--app-layout-menu-button-margin)")
.set("border-radius", "var(--app-layout-menu-button-border-radius)")
.set("--lumo-primary-text-color", "var(--app-layout-app-color)")
.set("text-decoration", "none");
getElement().appendChild(new PaperRipple().getElement());
}
内容来源于网络,如有侵权,请联系作者删除!