Package org.sgx.yuigwt.yuigallery.yui_treeview

Examples of org.sgx.yuigwt.yuigallery.yui_treeview.TreeLeafConfig


  treeViewParentNode.setStyles(Style.create().overflow("scroll"));  
}

private TreeLeafConfig buildLeaf(JsObject module) {
  String moduleName = module.objProps().get(0);   
  TreeLeafConfig leaf = TreeLeafConfig.create()
    .label(moduleName).id(moduleName).type("TreeView").cast();
 
  TreeLeafConfig submodulesLeaf = TreeLeafConfig.create()
    .label("submodules").type("TreeView").cast();
 
  TreeLeafConfig useLeaf = TreeLeafConfig.create()
    .label("use").type("TreeView").cast();
 
  TreeLeafConfig requiresLeaf = TreeLeafConfig.create()
    .label("requires").type("TreeView").cast();
 
  leaf.children(submodulesLeaf, useLeaf, requiresLeaf);
 
  JsObject modObj = module.objGetObj(moduleName);
 
  //do submodules
  JsObject submodules = modObj.objGetObj("submodules");
  if(submodules!=null) {
    JsArrayString submodulesNames =submodules.objProps();
    JsArray<TreeLeafConfig> submoduleChildren = JsArray.createArray().cast();
    for (int i = 0; i < submodulesNames.length(); i++) {
      String smn = submodulesNames.get(i);
      TreeLeafConfig leaf2 = TreeLeafConfig.create().label(smn).id(moduleName+"-"+smn).cast();
      submoduleChildren.push(leaf2);
    }
    submodulesLeaf.children(submoduleChildren);
  }
 
  //do use
  JsArrayString useArray = modObj.objGetArr("use").cast();
  if(useArray!=null) {
    JsArray<TreeLeafConfig> useChildren = JsArray.createArray().cast();
    for (int i = 0; i < useArray.length(); i++) {
      TreeLeafConfig leaf2 = TreeLeafConfig.create().label(useArray.get(i)).cast();
      useChildren.push(leaf2);
    }
    useLeaf.children(useChildren);
  }
 
  //do requires
  JsArrayString requiresArray = modObj.objGetArr("requires").cast();
  if(requiresArray!=null) {
    JsArray<TreeLeafConfig> requiresChildren = JsArray.createArray().cast();
    for (int i = 0; i < requiresArray.length(); i++) {
      TreeLeafConfig leaf2 = TreeLeafConfig.create().label(requiresArray.get(i)).cast();
      requiresChildren.push(leaf2);
    }
    requiresLeaf.children(requiresChildren);
  }
 
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yuigallery.yui_treeview.TreeLeafConfig

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.