Examples of ElementTree


Examples of ch.tatool.element.ElementTree

 
  /** Updates the stack
   * @return true if another element is ready for execution
   */
  public boolean updateElementStack(ExecutionContext executionContext) {
    ElementTree tree = executionContext.getExecutor().getExecutionTree();
   
    // push the root element onto the stack if the stack is empty
    if (tree.getElementStack().isEmpty()) {
      tree.pushElement(tree.getRootElement());
      ElementUtils.initialize(tree.getRootElement());
    }
   
    // make sure we don't loop forever
    int x=0;
    while (x < 100) {
      if (isTopExecutable(tree)) {
        return true;
      }
      else if (runTopSelectors(executionContext, tree)) {
        continue;
      }
      else if (hasTemporaryElement(tree)) {
        continue;
      }
      /*else if (isTopMarkedForReexecution(tree)) {
        return true;
      }*/
      // top element is used, pop it from the stack
      else {
        tree.popElement();
        // check whether the whole tree has been executed
        if (tree.getElementStack().isEmpty()) {
          return false;
        }
      }
    }
   
    // remove the Execution outcome property if set
    Misc.getOutcomeProperty().clearValue(executionContext);
   
    // ensure that the top element contains an executable element
    Element top = tree.getTop();
    return top != null && top.getExecutable() != null;
  }
View Full Code Here

Examples of ch.tatool.element.ElementTree

      compoundElement.getPrimary().setProperty(Element.EXECUTED, null);
            setExecutePrimary(true);
    }
   
    // handle primary case
    ElementTree tree = context.getExecutor().getExecutionTree();
    if (isExecutePrimary() || compoundElement.getSecondary() == null) {
      tree.pushElement(compoundElement.getPrimary());
      ElementUtils.initialize(compoundElement.getPrimary());
      return true;
    } else {
            // we also initialize the secondary element on each run
      ElementUtils.initialize(compoundElement.getSecondary());
          tree.pushElement(compoundElement.getSecondary());
          setExecuteSecondary(true);
            return true;
        }
  }
View Full Code Here

Examples of ch.tatool.element.ElementTree

    this.strategy = strategy;
  }
 
  public void initialize(Executor executor, Module module) {
    executor.setExecutionStrategy(strategy);
    ElementTree tree = executor.getExecutionTree();
    tree.setRootElement(rootElement);
  }
View Full Code Here

Examples of ch.tatool.element.ElementTree

 
  /** Updates the stack
   * @return true if another element is ready for execution
   */
  public boolean updateElementStack(ExecutionContext executionContext) {
    ElementTree tree = executionContext.getExecutor().getExecutionTree();
   
    // push the root element onto the stack if the stack is empty
    if (tree.getElementStack().isEmpty()) {
      tree.pushElement(tree.getRootElement());
      ElementUtils.initialize(tree.getRootElement());
    }
   
    // make sure we don't loop forever
    int x=0;
    while (x < 100) {
      if (isTopExecutable(tree)) {
        return true;
      }
      else if (runTopSelectors(executionContext, tree)) {
        continue;
      }
      else if (hasTemporaryElement(tree)) {
        continue;
      }
      /*else if (isTopMarkedForReexecution(tree)) {
        return true;
      }*/
      // top element is used, pop it from the stack
      else {
        tree.popElement();
        // check whether the whole tree has been executed
        if (tree.getElementStack().isEmpty()) {
          return false;
        }
      }
    }
   
    // remove the Execution outcome property if set
    Misc.getOutcomeProperty().clearValue(executionContext);
   
    // ensure that the top element contains an executable element
    Element top = tree.getTop();
    return top != null && top.getExecutable() != null;
  }
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

        // Be sure to clean up after ourselves.
        if (clean || currentBuilder.wasForgetStateRequested()) {
          currentBuilder.setLastBuiltTree(null);
        } else {
          // remember the current state as the last built state.
          ElementTree lastTree = workspace.getElementTree();
          lastTree.immutable();
          currentBuilder.setLastBuiltTree(lastTree);
        }
        hookEndBuild(builder);
      }
    } finally {
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

      if (builder == null) {
        // if the builder was not instantiated, use the old info if any.
        if (oldInfos != null)
          info = getBuilderInfo(oldInfos, builderName, i);
      } else if (!(builder instanceof MissingBuilder)) {
        ElementTree oldTree = ((InternalBuilder) builder).getLastBuiltTree();
        //don't persist build state for builders that have no last built state
        if (oldTree != null) {
          // if the builder was instantiated, construct a memento with the important info
          info = new BuilderPersistentInfo(project.getName(), builderName, i);
          info.setLastBuildTree(oldTree);
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

    ArrayList infos = getBuildersPersistentInfo(project);
    if (infos != null) {
      BuilderPersistentInfo info = getBuilderInfo(infos, builderName, buildSpecIndex);
      if (info != null) {
        infos.remove(info);
        ElementTree tree = info.getLastBuiltTree();
        if (tree != null)
          ((InternalBuilder) builder).setLastBuiltTree(tree);
        ((InternalBuilder) builder).setInterestingProjects(info.getInterestingProjects());
      }
      // delete the build map if it's now empty
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

          return true;
        //fall through and check if there is a delta
    }

    //compute the delta since the last built state
    ElementTree oldTree = builder.getLastBuiltTree();
    ElementTree newTree = workspace.getElementTree();
    long start = System.currentTimeMillis();
    currentDelta = (DeltaDataTree) deltaTreeCache.getDelta(null, oldTree, newTree);
    if (currentDelta == null) {
      if (Policy.DEBUG_BUILD_NEEDED) {
        String message = "Checking if need to build. Starting delta computation between: " + oldTree.toString() + " and " + newTree.toString(); //$NON-NLS-1$ //$NON-NLS-2$
        Policy.debug(message);
      }
      currentDelta = newTree.getDataTree().forwardDeltaWith(oldTree.getDataTree(), ResourceComparator.getBuildComparator());
      if (Policy.DEBUG_BUILD_NEEDED)
        Policy.debug("End delta computation. (" + (System.currentTimeMillis() - start) + "ms)."); //$NON-NLS-1$ //$NON-NLS-2$
      deltaTreeCache.cache(null, oldTree, newTree, currentDelta);
    }
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

        Map markerDeltas = workspace.getMarkerManager().getMarkerDeltas(lastPostBuildId);
        lastDelta.updateMarkers(markerDeltas);
      }
    } else {
      // We don't have a delta or something changed so recompute the whole deal.
      ElementTree oldTree = postChange ? lastPostChangeTree : lastPostBuildTree;
      long markerId = postChange ? lastPostChangeId : lastPostBuildId;
      lastDelta = ResourceDeltaFactory.computeDelta(workspace, oldTree, tree, Path.ROOT, markerId + 1);
    }
    // remember the state of the world when this delta was consistent
    lastDeltaState = tree;
View Full Code Here

Examples of org.eclipse.core.internal.watson.ElementTree

      ElementTree[] trees = treeReader.readDeltaChain(input);
      monitor.worked(3);
      if (root.isRoot()) {
        //Don't need to link because we're reading the whole workspace.
        //The last tree in the chain is the complete tree.
        ElementTree newTree = trees[trees.length - 1];
        newTree.setTreeData(workspace.tree.getTreeData());
        workspace.tree = newTree;
      } else {
        //splice the restored tree into the current set of trees
        workspace.linkTrees(root, trees);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.