Package org.zkoss.zul

Examples of org.zkoss.zul.Window


  public void show(Component comp) {
    Components.replace(login.getParent(), comp);
  }

  public LoginWindow() {
    Window window = new Window(getTitle(), "normal", false);
    window.setPosition("center");
    window.setWidth("300px");
    window.doOverlapped();
    window.appendChild(login);   
    appendChild(window);
  }
View Full Code Here


  public void exportFileName() throws SuspendNotAllowedException, InterruptedException {
    if(fileModel.isEmpty()) return;
    final StringBuffer sb = new StringBuffer();
    for(Iterator it = fileModel.iterator();it.hasNext();)
      sb.append(((File)it.next()).getName()).append("\n");
    Window w = new Window();
    w.setTitle("Export File Name - ["+ fileModel.size() +"]");
    w.setWidth("300px");
    w.setClosable(true);
    w.setPage(this.getPage());
    Textbox t = new Textbox();
    t.setWidth("98%");
    t.setMultiline(true);
    t.setRows(20);
    t.setParent(w);
    t.setValue(sb.toString());
    t.focus();
    w.doModal();
  }
View Full Code Here

    t.setValue(sb.toString());
    t.focus();
    w.doModal();
  }
  public void importFileName() throws SuspendNotAllowedException, InterruptedException {
    final Window w = new Window();
    w.setTitle("Import File Name");
    w.setWidth("300px");
    w.setClosable(true);
    w.setPage(this.getPage());
    final Textbox t = new Textbox();
    t.setWidth("98%");
    t.setMultiline(true);
    t.setRows(20);
    t.setParent(w);
    t.setConstraint("no empty");
    final Button ok = new Button("OK");
    final Button cancel = new Button("Cancel");
    ok.setParent(w);
    ok.addEventListener(Events.ON_CLICK,
        new EventListener() {
      public void onEvent(Event e) throws Exception {
        String val = t.getValue();
        String[] vals = val.trim().split("\n");
        final StringBuffer sb = new StringBuffer();
        fileModel.clear();
        final String r = getDesktop().getWebApp().getRealPath("/");
        final File test2 = new File(r, PATH);
        final File[] files = test2.listFiles(new MyFilenameFilter("", false));
        for(int j = 0; j < vals.length; j++) {
          boolean exist = false;
          for (int i = 0; i < files.length; i++) {
            if (vals[j].trim().equalsIgnoreCase(files[i].getName())) {
              fileModel.add(files[i]);
              exist = true;
              break;
            }
          }
          if (!exist) sb.append(vals[j].trim()).append("\n");
        }
        if (sb.toString().trim().length() > 0) t.setValue("Failed File Name:\n" + sb.toString());
        w.insertBefore(new Label(" \nsuccess : [" + fileModel.size() + "] failed : [" + (vals.length - fileModel.size())+ "]"),
            (Component)w.getChildren().get(0));
        ok.detach();
        cancel.detach();
      }
    });
    cancel.setParent(w);
    cancel.addEventListener(Events.ON_CLICK,
        new EventListener() {
      public void onEvent(Event e) throws Exception {
        w.detach();
      }
    });
    t.focus();
    w.doModal();
  }
View Full Code Here

   
    createComponents();
  }

  private void createComponents() {
    mainWindow = new Window();
    mainWindow.setParent(parent);
    mainWindow.setClosable(true);
    mainWindow.setTitle("mainWindow");
    mainWindow.setHeight("50%");
    mainWindow.setWidth("50%");
View Full Code Here

*
* @author tomyeh
*/
public class MyComposer implements Composer {
  public void doAfterCompose(Component comp) {
    final Window w = (Window)comp;
    w.setTitle("Composer: "+w.getTitle());
    w.setBorder("normal");
    Components.wireVariables(comp, this);
  }
View Full Code Here

import org.zkoss.zul.Window;

public class TreeComposer implements Composer {

  public void doAfterCompose(Component comp) throws Exception {
    Window win = ((Window)comp);
    Treeitem treeitem = (Treeitem)win.getFellow("ti");
    Treeitem newitem = new Treeitem("Created by Composer");
    newitem.setParent(treeitem.getTreechildren());
  }
View Full Code Here

        Map args = new HashMap();
        args.put("building", obj);
        args.put("operation", "addBuildingDoc");
        args.put("buildingController", this);

        Window win = (Window) Executions.createComponents("standingData/buildingDoc.zul", this, args);
        try {
            win.doModal();
        } catch (InterruptedException ie) {
        }
    }
View Full Code Here

        args.put("buildingController", this);
        args.put("operation", "updateBuildingDoc");
        args.put("building", obj);
        args.put("buildingDocForm", sub);

        Window win = (Window) Executions.createComponents("standingData/buildingDoc.zul", this, args);

        try {
            win.doModal();
        } catch (InterruptedException ie) {
        }

    }
View Full Code Here

        args.put("operation", "addDuty");
        args.put("user", obj);
        args.put("masterController", this);

        Window win = (Window) Executions.createComponents("pri/duty.zul", this, args);
        try {
            win.doModal();
        } catch (InterruptedException ie) {
        }
    }
View Full Code Here

        args.put("operation", "updateDuty");
        args.put("masterController", this);
        args.put("user", obj);
        args.put("dutyForm", sub);

        Window win = (Window) Executions.createComponents("pri/duty.zul", this, args);

        try {
            win.doModal();
        } catch (InterruptedException ie) {
        }

    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Window

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.