Package com.tensegrity.wpalo.client.ui.model

Examples of com.tensegrity.wpalo.client.ui.model.TreeNode


    };
    reportsTree = createTree(treeLoader);

    panel.add(reportsTree);   
    panel.setVisible(true);
    TreeNode node = new ReportTreeModel(user).getRoot();
    if (node != null) {
      treeLoader.load(node);
    }
    reportsTree.setVisible(true);
   
View Full Code Here


      rootNode.setId("ReportNavigatorView#RootNode");
      rootNode.addChild(sheetTemplates);
      rootNode.addChild(adhocTemplates);
      rootNode.setHasChildren(true);
     
      root = new TreeNode(null, rootNode);
    }
View Full Code Here

            combo.add(def);
          }       
         
          combo.setEditable(false);
          if (editor.getInput() instanceof TreeNode) {
            TreeNode node = (TreeNode) editor.getInput();
            while (node.getParent() != null) {
              node = node.getParent();
              if (node.getXObject() != null &&
                  node.getXObject() instanceof XDynamicReportFolder) {
                XDynamicReportFolder df = (XDynamicReportFolder) node.getXObject();                           
                if (df.getSourceSubset() != null) {                   
                  XSubset key = df.getSourceSubset();
                  String match = desc.getVariableMapping().get(key);
                  if (match == null) {
                    match = def;
View Full Code Here

      // Create initial tree structure:
      XNode root = new XNode(user, XConstants.TYPE_ROOT_REPORT_STRUCTURE_NODE);
      root.setName("DummyRoot");
      root.setId("ReportStructureNavigatorView#RootNode");
      root.setHasChildren(true);
      rootNode = new TreeNode(null, root);
      Dispatcher.forwardEvent(WPaloEvent.EXPANDED_REPORT_STRUCTURE_SECTION,
          rootNode);
                 
//      Dispatcher.forwardEvent(WPaloEvent.EXPANDED_REPORT_STRUCTURE_SECTION,
//          new ReportTreeModel(user).getRoot());
     
      break;
    case WPaloEvent.EXPANDED_REPORT_STRUCTURE_SECTION: //load tree data
      TreeNode node = (TreeNode) event.data;
      if (node != null) {
        treeLoader.load(node);
      }
      break;
    }
View Full Code Here

          return;
        }
        List <XObject> objs = new ArrayList<XObject>();
        final HashSet <TreeNode> parents = new HashSet<TreeNode>();
        for (TreeItem it: items) {
          TreeNode tn = (TreeNode) it.getModel();
          objs.add(tn.getXObject());
          parents.remove(tn);
          parents.add((TreeNode) tn.getParent());
        }
        WPaloServiceProvider.getInstance().deleteElementTreeNodes(objs, user, new Callback<Boolean>(){
          public void onSuccess(Boolean b) {
            if (b) {
              for (TreeNode p: parents) {
                if (p != null) {
                  reload(p);
                }
              }
            }
          }
        });
      }
    });
    toolbar.add(deleteItem);
   
    toolbar.add(new SeparatorToolItem());
    final ToggleToolItem quickView = new ToggleToolItem("Quick View");
    toolbar.add(quickView);
    quickView.addSelectionListener(new SelectionListener<ComponentEvent>(){
      public void componentSelected(ComponentEvent ce) {
        quickViewEnabled = quickView.isPressed();
        if (rootNode != null) {
          reload(rootNode);
        }
//        store.removeAll();
//        XNode root = new XNode(user, XConstants.TYPE_ROOT_REPORT_STRUCTURE_NODE);
//        root.setName("DummyRoot");
//        root.setId("ReportStructureNavigatorView#RootNode");
//        root.setHasChildren(true);
//        rootNode = new TreeNode(null, root);
//        treeLoader.load(rootNode);
      }
    });
   
    navigator.setTopComponent(toolbar);
   
    reportsTree.addListener(Events.OnDoubleClick, new Listener<BaseEvent>(){
      public void handleEvent(BaseEvent be) {
        TreeNode node = (TreeNode) reportsTree.getSelectedItem().getModel();
        if (node.getXObject() instanceof XTemplate) {
          fireEvent(new AppEvent<TreeNode>(WPaloEvent.EDIT_TEMPLATE_ITEM, node));
        }
      }
    });
   
    navigator.add(reportsTree);
    navigator.addListener(Events.Expand, new Listener<BaseEvent>(){
      public void handleEvent(BaseEvent be) {
        fireEvent(new AppEvent<TreeNode>(WPaloEvent.EDIT_REPORT_STRUCTURE, new TreeNode(null, user)));
      }
    });
    Workbench wb = (Workbench)Registry.get(Workbench.ID);
    wb.addToViewPanel(navigator);
  }
View Full Code Here

    if (selection == null || selection.size() == 0) {
      deleteItem.setEnabled(false);
      return;
    }
    for (ModelData node: selection) {
      TreeNode parent = (TreeNode) ((TreeNode) node).getParent();
      if (parent == null || parent.getXObject() == null) {
        deleteItem.setEnabled(false);
        return;
      }
      if (parent.getXObject().getId().equals("ReportStructureNavigatorView#RootNode")) {   
        deleteItem.setEnabled(false);
        return;
      }
    }
    deleteItem.setEnabled(true);
View Full Code Here

    binder.setDisplayProperty("name");
    binder.setAutoSelect(true);
    binder.addSelectionChangedListener(new SelectionChangedListener<ModelData>() {
      public void selectionChanged(SelectionChangedEvent<ModelData> se) {
        validateButtons(se.getSelection());
        TreeNode node = (TreeNode) se.getSelectedItem();
        if (node != null && node.getXObject() != null) {
          fireEvent(new AppEvent <TreeNode>(
              WPaloEvent.SET_EDITOR_INPUT, node));
        }
      }
    });
View Full Code Here

      }
    };
    listTree = createTree(treeLoader);
    panel.add(listTree);   
    panel.setVisible(true);
    TreeNode node = new ListTreeModel(user).getRoot();
    if (node != null) {
      treeLoader.load(node);
    }
    listTree.setVisible(true);
   
View Full Code Here

        final XDynamicReportFolder xdf = (XDynamicReportFolder) remObj;
        WPaloServiceProvider.getInstance().assignSubsetOrDimension(
            xdf, obj, user, new Callback <Boolean>(){
              public void onSuccess(Boolean arg0) {               
                TreeNode tn = (TreeNode) ti.getModel();
//                if (tn != null) {
//                  tn = (TreeNode) tn.getParent();
//                }
                if (tn != null) {
                  if (obj instanceof XHierarchy) {
View Full Code Here

      //root node
      XNode rootNode = new XNode(user, XConstants.TYPE_ROOT_NODE);
      rootNode.setId("ReportNavigatorView_ListTab#RootNode");
      rootNode.setHasChildren(true);
     
      root = new TreeNode(null, rootNode);
    }
View Full Code Here

TOP

Related Classes of com.tensegrity.wpalo.client.ui.model.TreeNode

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.