Examples of Visitor


Examples of org.olat.core.util.tree.Visitor

   */
  private Map<String, List<String>> checkReferencesFor(TreeNode tn) {
    final CourseEditorTreeModel cetm = CourseFactory.getCourseEditSession(ores.getResourceableId()).getEditorTreeModel();
     //create a list of all nodes in the selected subtree
    final Set<String> allSubTreeids = new HashSet<String>();
    TreeVisitor tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        allSubTreeids.add(node.getIdent());
      }
    }, tn, true);
    tv.visitAll();
     //find all references pointing from outside the subtree into the subtree or
     //on the subtree root node.
    final Map<String, List<String>> allRefs = new HashMap<String, List<String>>();
    tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        List referencingNodes = euce.getCourseEditorEnv().getReferencingNodeIdsFor(node.getIdent());
        // subtract the inner nodes. This allows to delete a whole subtree if
        // only references residing completly inside the subtree are active.
        referencingNodes.removeAll(allSubTreeids);
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

     */
    String currentNodeWas = currentCourseNodeId;
    // reset all
    softRefs = new HashMap();
    nodeRefs = new HashMap<String, Set<String>>();
    Visitor v = new CollectConditionExpressionsVisitor();
    (new TreeVisitor(v, cetm.getRootNode(), true)).visitAll();
    for (Iterator iter = softRefs.keySet().iterator(); iter.hasNext();) {
      String nodeId = (String) iter.next();
      List conditionExprs = (List) softRefs.get(nodeId);
      for (int i = 0; i < conditionExprs.size(); i++) {
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

    DirectedGraph dg = new DefaultDirectedGraph();
    DirectedEdgeFactory def = new EdgeFactories.DirectedEdgeFactory();
    /*
     * add the course structure as directed graph, where
     */
    Visitor v = new Convert2DGVisitor(dg);
    (new TreeVisitor(v, cetm.getRootNode(), true)).visitAll();
    /*
     * iterate over nodeRefs, add each not existing node id as vertex, for each
     * key - child relation add an edge to the directed graph.
     */
 
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

    for (Iterator iter = refs.iterator(); iter.hasNext();) {
      ReferenceImpl ref = (ReferenceImpl) iter.next();
      refM.delete(ref);
    }
    // call cleanupOnDelet for nodes
    Visitor visitor = new NodeDeletionVisitor(course);
    TreeVisitor tv = new TreeVisitor(visitor, course.getRunStructure().getRootNode(), true);
    tv.visitAll();
    // delete assessment notifications
    CourseNode cn = course.getRunStructure().getRootNode();
    CourseEnvironment ce = course.getCourseEnvironment();
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

    String result = ScoreAccountingHelper.createCourseResultsOverviewTable(users, nodes, course, locale);
    String fileName = ExportUtil.createFileNameWithTimeStamp(course.getCourseTitle(), "xls");
    ExportUtil.writeContentToFile(fileName, result, exportDirectory, charset);
   
    // archive all nodes content
    Visitor archiveV = new NodeArchiveVisitor(locale, course, exportDirectory, charset);
    TreeVisitor tv = new TreeVisitor(archiveV, course.getRunStructure().getRootNode(), true);
    tv.visitAll();
    // archive all course log files
    //OLATadmin gets all logfiles independent of the visibility configuration   
    boolean isOresOwner = (oresRights.length > 0)?oresRights[0]:false;
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

    if (isRestrictedEdit()) {
      Set keys = history.keySet();
      /*
       *
       */
      Visitor v = new Visitor() {
        /*
         * a history key is built as follows
         * sectionkey+"/"+itemkey+"/"+questionkey+"/"+responsekey
         */
        String sectionKey = null;
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

 
  private void upgradeRunStructure(ICourse course) {
    Structure cR = course.getRunStructure();
    CourseNode rsRootNode = cR.getRootNode();
    final Set<String> allSubTreeids = new HashSet<String>();
    TreeVisitor tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        allSubTreeids.add(node.getIdent());
      }
    }, rsRootNode, true);
    tv.visitAll();
View Full Code Here

Examples of org.olat.core.util.tree.Visitor

  private void upgradeEditorTreeModel(ICourse course) {
    // EDITOR: get all course nodes
    CourseEditorTreeModel cT = course.getEditorTreeModel();
    TreeNode rootNode = cT.getRootNode();
    final Set<String> allSubTreeids = new HashSet<String>();
    TreeVisitor tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        allSubTreeids.add(node.getIdent());
      }
    }, rootNode, true);
    tv.visitAll();
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.visitor.Visitor

    public void paintConflicts(final Graphics g, final NavigatableComponent nc) {
        Color preferencesColor = getColor();
        if (preferencesColor.equals(Main.pref.getColor(marktr("background"), Color.black)))
            return;
        g.setColor(preferencesColor);
        Visitor conflictPainter = new AbstractVisitor() {
            // Manage a stack of visited relations to avoid infinite recursion with cyclic relations (fix #7938)
            private final Set<Relation> visited = new HashSet<>();
            @Override
            public void visit(Node n) {
                Point p = nc.getPoint(n);
View Full Code Here

Examples of org.python.pydev.parser.jython.Visitor

            }
            SimpleNode lastNodeBeforePassedLine = visitor.getLastInContextBeforePassedLine();
            if (lastNodeBeforePassedLine != null) {
                final int[] line = new int[] { Integer.MAX_VALUE };
                try {
                    Visitor v = new Visitor() {

                        protected Object unhandled_node(SimpleNode node) throws Exception {
                            if (node.beginLine > 0) {
                                line[0] = Math.min(line[0], node.beginLine - 1);
                            } else {
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.