Package com.tensegrity.wpalo.client.ui.dialog

Examples of com.tensegrity.wpalo.client.ui.dialog.RequestNameDialog


        final TreeItem item = reportsTree.getSelectedItem();
        if (item == null) {
          return;
        }
        final XObject parent = ((TreeNode) item.getModel()).getXObject();
        RequestNameDialog rnd = new RequestNameDialog(
            "Create new static folder",
            "Name",
            new ResultListener<String>(){
              public void requestCancelled() {               
              }

              public void requestFinished(String result) {
                WPaloServiceProvider.getInstance().
                  createStaticFolder(result, parent, user, new Callback<XStaticReportFolder>(){
                    public void onSuccess(XStaticReportFolder folder) {
                      if (folder == null) {
                        return;
                      }
                      treeLoader.loadChildren((TreeNode) item.getModel());
                    }});
              }
            });
        rnd.show();
      }
    });
    toolbar.add(addStaticFolder);
    TextToolItem addDynamicFolder = new TextToolItem("", "icon-create-dynamic-folder");
    addDynamicFolder.setToolTip("Create a new dynamic folder");
    addDynamicFolder.addSelectionListener(new SelectionListener<ComponentEvent>(){
      public void componentSelected(ComponentEvent ce) {
        final TreeItem item = reportsTree.getSelectedItem();
        if (item == null) {
          return;
        }
        final XObject parent = ((TreeNode) item.getModel()).getXObject();
        RequestNameDialog rnd = new RequestNameDialog(
            "Create new dynamic folder",
            "Name",
            new ResultListener<String>(){
              public void requestCancelled() {               
              }

              public void requestFinished(String result) {
                WPaloServiceProvider.getInstance().
                  createDynamicFolder(result, parent, user, new Callback<XDynamicReportFolder>(){
                    public void onSuccess(XDynamicReportFolder folder) {
                      if (folder == null) {
                        return;
                      }
                      treeLoader.loadChildren((TreeNode) item.getModel());
                    }});
              }
            });
        rnd.show();
      }
    });
    toolbar.add(addDynamicFolder);
   
    TextToolItem addSheet = new TextToolItem("", "icon-create-sheet");
View Full Code Here


      title = "Create new Workbook Template";
    } else {   
      return;
    }
   
    RequestNameDialog rnd = new RequestNameDialog(title,
        "Name", new ResultListener<String>() {
          public void requestCancelled() {
          }

          public void requestFinished(String result) {
            WPaloServiceProvider.getInstance().createWorkbook(
                parent, result,
                new Callback<XWorkbook>() {
                  public void onSuccess(XWorkbook workbook) {
                    if (workbook == null) {
                      System.err
                          .println("Returned workbook == null");
                      return;
                    }
                    Dispatcher.get().dispatch(
                        WPaloEvent.UPDATE_WORKBOOKS, parent);
                  }
                });
          }
        });
    rnd.show();
  }
View Full Code Here

TOP

Related Classes of com.tensegrity.wpalo.client.ui.dialog.RequestNameDialog

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.