예제 #1
0
 @Override
 public boolean hasChildren(Object data) {
   if (data instanceof RunnerEnvironmentTree) {
     RunnerEnvironmentTree environmentTree = (RunnerEnvironmentTree) data;
     return !(environmentTree.getNodes().isEmpty() && environmentTree.getLeaves().isEmpty());
   }
   return false;
 }
예제 #2
0
  @Override
  public Array<Object> getChildren(Object data) {
    Array<Object> res = Collections.createArray();
    if (data instanceof RunnerEnvironmentTree) {
      RunnerEnvironmentTree environmentTree = (RunnerEnvironmentTree) data;
      for (RunnerEnvironmentTree runnerEnvironmentTree : environmentTree.getNodes()) {
        res.add(runnerEnvironmentTree);
      }

      for (RunnerEnvironmentLeaf leaf : environmentTree.getLeaves()) {
        RunnerEnvironment environment = leaf.getEnvironment();
        if (environment != null) {
          res.add(leaf);
        }
      }
    }
    res.sort(COMPARATOR);
    return res;
  }