Package org.zkoss.zul

Examples of org.zkoss.zul.Window


  private void doPrint() {
    String printKey=""+System.currentTimeMillis();
    Session session=this.getDesktop().getSession();
    session.setAttribute("zssFromHi"+printKey,spreadsheet);

    Window win = (Window) getFellow("menuPrintWin");
    Button printBtn=(Button) win.getFellow("printBtn");
    printBtn.setTarget("_blank");
    printBtn.setHref("print.zul?printKey="+printKey);

    win.setPosition("parent");
    win.setTop("30px");
    win.setLeft("5px");
    win.doPopup();
  }
View Full Code Here


    win.setLeft("5px");
    win.doPopup();
  }
 
  public void onOpenFileMenu(ForwardEvent event){
    Window win = (Window) Path.getComponent("//p2/mainWin/fileOpenViewWin");

    reloadMenu("open");
    try {
      win.setTop("30px");
      win.setLeft("5px");
      win.doPopup();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  public static void openDetails(Window source, String gridName, String option, String targetDetailsWindow){
    Map<String, ArrayList<String>> parameters=new HashMap<String, ArrayList<String>>();
    ArrayList<String> options=new ArrayList<String>();
    options.add(option);
    parameters.put("options", options);
    Window child=(Window)Executions.createComponents(targetDetailsWindow, source, parameters);
    ArrayList<String> ids=new ArrayList<String>();
    Rows rows=((Grid)source.getFellow(gridName)).getRows();
    List rowList=rows.getChildren();
    Iterator it=rowList.iterator();
    while(it.hasNext()){
      Object next=it.next();
      if(next instanceof Row){
        Iterator fit=((Row)next).getChildren().iterator();
        if(((Checkbox)fit.next()).isChecked()){
          ids.add(((Label)fit.next()).getValue());
        }
      }
    }
    parameters.put("ids", ids);
    child.setClosable(true);
    try {
      child.doModal();
    } catch (SuspendNotAllowedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
View Full Code Here

  }

 
  @SuppressWarnings("unchecked")
  private void openDetails(Map map) throws Exception{
    Window child=(Window)Executions.createComponents("./LocationDetails.zul", null, map);
    ArrayList<String> ids=new ArrayList<String>();
    Rows rows=((Grid)getFellow("locationsGrid")).getRows();
    List rowList=rows.getChildren();
    Iterator it=rowList.iterator();
    while(it.hasNext()){
      Object next=it.next();
      if(next instanceof Row){
        Iterator fit=((Row)next).getChildren().iterator();
        if(((Checkbox)fit.next()).isChecked()){
          ids.add(((Label)fit.next()).getValue());
        }
      }
    }
    map.put("ids", ids);
    child.setClosable(true);
    child.doModal();
    refresh();
  }
View Full Code Here

  }

 
  @SuppressWarnings("unchecked")
  private void openDetails(Map map) throws Exception{
    Window child=(Window)Executions.createComponents("./UOMDetails.zul", null, map);
    ArrayList<String> ids=new ArrayList<String>();
    Rows rows=((Grid)getFellow("uomGrid")).getRows();
    List rowList=rows.getChildren();
    Iterator it=rowList.iterator();
    while(it.hasNext()){
      Object next=it.next();
      if(next instanceof Row){
        Iterator fit=((Row)next).getChildren().iterator();
        if(((Checkbox)fit.next()).isChecked()){
          ids.add(((Label)fit.next()).getValue());
        }
      }
    }
    map.put("ids", ids);
    child.setClosable(true);
    child.doModal();
    refresh();
  }
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

    public void print() {
        if (!isPrintEnabled()) {
            throw new UnsupportedOperationException("print is not supported");
        }

        final Window printProperties = (Window) Executions.createComponents(
                "/planner/print_configuration.zul", planner, null);

        Button printButton = (Button) printProperties.getFellow("printButton");
        printButton.addEventListener(Events.ON_CLICK, new EventListener() {
            @Override
            public void onEvent(Event event) {
                printProperties.detach();
                configuration.print(buildParameters(printProperties),planner);
            }
        });
        printButton.setParent(printProperties);

        try {
            printProperties.doModal();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
View Full Code Here

                QualityFormAssignerComponent.class);
        c.useModel(model);
    }

    private void bindEditTemplateWindowWithController() {
        Window editTemplateWindow = (Window) editWindow
                .getFellow("editTemplateWindow");
        editTemplateController = EditTemplateWindowController.bindTo(model,
                editTemplateWindow);
    }
View Full Code Here

@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class ReassignController extends GenericForwardComposer {

    public static void openOn(org.zkoss.zk.ui.Component component,
            IConfigurationResult configurationResult) {
        Window result = (Window) Executions.createComponents(
                "/planner/reassign.zul", component, Collections.emptyMap());
        ReassignController controller = (ReassignController) result
                .getAttribute("controller");
        controller.showWindow(configurationResult);
    }
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.