19 package org.turro.zkoss.dialog;
21 import java.util.ArrayList;
22 import java.util.List;
24 import java.util.function.Consumer;
25 import org.turro.zul.frame.Framework;
26 import org.zkoss.zk.ui.Executions;
27 import org.zkoss.zk.ui.HtmlBasedComponent;
28 import org.zkoss.zk.ui.Page;
29 import org.zkoss.zk.ui.event.Event;
30 import org.zkoss.zk.ui.event.EventListener;
31 import org.zkoss.zk.ui.event.Events;
32 import org.zkoss.zk.ui.ext.AfterCompose;
33 import org.zkoss.zul.Html;
34 import org.zkoss.zul.Include;
35 import org.zkoss.zul.Space;
36 import org.zkoss.zul.Window;
44 private final List<HtmlBasedComponent> components;
77 setContentStyle(
"overflow-y:auto");
83 EventListener el = (EventListener) (Event event) -> {
87 addEventListener(Events.ON_CLOSE, el);
93 components.add(
new Space());
98 components.add(component);
103 Include include =
new Include(
"/WEB-INF/_zul" + uri);
105 args.forEach((k, v) -> include.setDynamicProperty((String) k, v));
107 components.add(include);
127 Html component =
new Html(html);
142 private static final int
147 super(
title,
"normal",
false);
148 components =
new ArrayList<>();
149 setPosition(
"center");
154 private void createComponents() {
155 if(getPage() ==
null) {
156 if(Framework.getCurrent() !=
null) {
157 setPage(Framework.getCurrent().getPage());
159 setPage(Executions.getCurrent().getDesktop().getFirstPage());
162 components.forEach(component -> {
163 appendChild(component);
164 if(component instanceof AfterCompose) {
165 ((AfterCompose) component).afterCompose();
static Windows title(String title)
Windows addComponent(HtmlBasedComponent component)
Windows adaptHeight(int height)
Windows width(String width)
Windows position(String position)
static void showHtml(String title, String html)
Windows onClose(Consumer< Windows > onClose)
Windows adaptWidth(int width)
Windows addComponent(String uri, Map args)
Windows height(String height)