Пример #1
0
 @SuppressWarnings("null")
 public Folder getTreeModel() {
   Folder[] deviceTypes = null;
   Music[] types = {new Music("IODF"), new Music("IFDT"), new Music("IFAT"), new Music("OBD")};
   deviceTypes = new Folder[] {new Folder("告警信息管理", types)};
   for (int i = 0; i < deviceTypes.length; i++) {
     root.add((Folder) deviceTypes[i]);
   }
   return root;
 }
Пример #2
0
  public TreePanel<ModelData> getTreePanel2(Folder model) {
    final TreeStore<ModelData> store = new TreeStore<ModelData>();
    store.add(model.getChildren(), true);

    final TreePanel<ModelData> tree = new TreePanel<ModelData>(store);

    tree.setDisplayProperty("name");
    tree.getStyle().setLeafIcon(Resources.ICONS.accordion());
    tree.setAutoWidth(true);
    tree.setHeight(600);

    tree.addListener(Events.OnClick, onClicklistener);

    return tree;
  }