Exemplo n.º 1
0
  private void addTreeItems(
      List<ModFunc> modFuncs, ObservableList<TreeItem<ModFunc>> modFuncTreeItems) {
    for (ModFunc modFunc : modFuncs) {
      if (!modFunc.isSynthetic()) {
        TreeItem<ModFunc> item = newFuncTreeItem(modFunc);

        modFuncTreeItems.add(item);
      }
    }
  }
Exemplo n.º 2
0
 private ArrayList<ModFunc> toModFuncs(
     OtpErlangAtom moduleNameAtom, OtpErlangList exportedFuncs, boolean isExported) {
   ArrayList<ModFunc> mfs = new ArrayList<>();
   for (OtpErlangObject exported : exportedFuncs) {
     ModFunc modFunc = ModFunc.toFunc(moduleNameAtom, exported, isExported);
     mfs.add(modFunc);
   }
   return mfs;
 }
Exemplo n.º 3
0
  private void buildObjectTreeRoot(OtpErlangList requestFunctions) {
    boolean isExported;

    for (OtpErlangObject e : requestFunctions) {
      OtpErlangTuple tuple = (OtpErlangTuple) e;

      OtpErlangAtom moduleNameAtom = (OtpErlangAtom) tuple.elementAt(0);
      OtpErlangList exportedFuncs = (OtpErlangList) tuple.elementAt(1);
      OtpErlangList localFuncs = (OtpErlangList) tuple.elementAt(2);

      TreeItem<ModFunc> moduleItem;

      moduleItem = new TreeItem<ModFunc>(ModFunc.toModule(moduleNameAtom));
      moduleItem.setGraphic(treeIcon(AwesomeIcon.CUBE));

      ObservableList<TreeItem<ModFunc>> modFuncs = FXCollections.observableArrayList();

      SortedList<TreeItem<ModFunc>> sortedFuncs = new SortedList<TreeItem<ModFunc>>(modFuncs);

      FilteredList<TreeItem<ModFunc>> filteredFuncs =
          new FilteredList<TreeItem<ModFunc>>(sortedFuncs);

      sortedFuncs.setComparator(treeItemModFuncComparator());

      isExported = true;
      addTreeItems(toModFuncs(moduleNameAtom, exportedFuncs, isExported), modFuncs);

      isExported = false;
      addTreeItems(toModFuncs(moduleNameAtom, localFuncs, isExported), modFuncs);
      functionLists.add(filteredFuncs);

      Bindings.bindContentBidirectional(moduleItem.getChildren(), filteredFuncs);

      treeModules.add(moduleItem);
    }

    TreeItem<ModFunc> root;

    root = new TreeItem<ModFunc>();
    root.setExpanded(true);

    Bindings.bindContentBidirectional(root.getChildren(), filteredTreeModules);

    modulesTree.setRoot(root);
  }