Package org.rssowl.ui.internal.util

Examples of org.rssowl.ui.internal.util.TreeTraversal


  }

  private boolean navigate(ITreeNode startingNode, boolean next, final boolean unread) {

    /* Create Traverse-Helper */
    TreeTraversal traverse = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return isValidNavigation(node, unread);
      }
    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());
    if (targetNode != null) {
      ISelection selection = new StructuredSelection(targetNode.getData());
      fNewsTableControl.getViewer().setSelection(selection);
      return true;
    }
View Full Code Here


    IFolder subRootFolder3 = rootFolder.getFolders().get(2);
    IFolder subRoot3Folder1 = subRootFolder3.getFolders().get(0);
    IBookMark subRoot31Mark1 = (IBookMark) subRoot3Folder1.getMarks().get(0);

    TreeTraversal t = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return true;
      }
    };

    assertEquals(subRootFolder1, t.nextNode().getData());
    assertEquals(subRoot1Folder1, t.nextNode().getData());
    assertEquals(subRoot11Folder1, t.nextNode().getData());
    assertEquals(subRoot11Mark1, t.nextNode().getData());
    assertEquals(subRoot1Mark1, t.nextNode().getData());
    assertEquals(subRoot1Mark2, t.nextNode().getData());
    assertEquals(subRootFolder2, t.nextNode().getData());
    assertEquals(subRoot2Folder1, t.nextNode().getData());
    assertEquals(subRoot21Folder1, t.nextNode().getData());
    assertEquals(subRoot211Mark1, t.nextNode().getData());
    assertEquals(subRoot2Mark1, t.nextNode().getData());
    assertEquals(subRootFolder3, t.nextNode().getData());
    assertEquals(subRoot3Folder1, t.nextNode().getData());
    assertEquals(subRoot31Mark1, t.nextNode().getData());
    assertEquals(null, t.nextNode());
  }
View Full Code Here

  }

  private ITreeNode navigate(ITreeNode startingNode, boolean next, final boolean unread) {

    /* Create Traverse-Helper */
    TreeTraversal traverse = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return isValidNavigation(node, unread);
      }
    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());

    return targetNode;
  }
View Full Code Here

  }

  private ITreeNode navigate(ITreeNode startingNode, boolean next, final boolean unread) {

    /* Create Traverse-Helper */
    TreeTraversal traverse = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return isValidNavigation(node, unread);
      }
    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());

    return targetNode;
  }
View Full Code Here

  }

  private boolean navigate(ITreeNode startingNode, boolean next, final boolean unread) {

    /* Create Traverse-Helper */
    TreeTraversal traverse = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return isValidNavigation(node, unread);
      }
    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());
    if (targetNode != null) {
      ISelection selection = new StructuredSelection(targetNode.getData());
      fNewsTableControl.getViewer().setSelection(selection);
      return true;
    }
View Full Code Here

    IFolder subRootFolder3 = rootFolder.getFolders().get(2);
    IFolder subRoot3Folder1 = subRootFolder3.getFolders().get(0);
    IBookMark subRoot31Mark1 = (IBookMark) subRoot3Folder1.getMarks().get(0);

    TreeTraversal t = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return node.getData() instanceof IBookMark;
      }
    };

    assertEquals(subRoot11Mark1, t.nextNode().getData());
    assertEquals(subRoot1Mark1, t.nextNode().getData());
    assertEquals(subRoot1Mark2, t.nextNode().getData());
    assertEquals(subRoot211Mark1, t.nextNode().getData());
    assertEquals(subRoot2Mark1, t.nextNode().getData());
    assertEquals(subRoot31Mark1, t.nextNode().getData());
    assertEquals(null, t.nextNode());
  }
View Full Code Here

    IFolder subRootFolder3 = rootFolder.getFolders().get(2);
    IFolder subRoot3Folder1 = subRootFolder3.getFolders().get(0);
    IBookMark subRoot31Mark1 = (IBookMark) subRoot3Folder1.getMarks().get(0);

    TreeTraversal t = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return true;
      }
    };

    assertEquals(subRoot2Mark1, t.nextNode().getData());
    assertEquals(subRootFolder3, t.nextNode().getData());
    assertEquals(subRoot3Folder1, t.nextNode().getData());
    assertEquals(subRoot31Mark1, t.nextNode().getData());
    assertEquals(null, t.nextNode());
  }
View Full Code Here

    IFolder subRootFolder3 = rootFolder.getFolders().get(2);
    IFolder subRoot3Folder1 = subRootFolder3.getFolders().get(0);
    IBookMark subRoot31Mark1 = (IBookMark) subRoot3Folder1.getMarks().get(0);

    TreeTraversal t = new TreeTraversal(startingNode) {
      @Override
      public boolean select(ITreeNode node) {
        return node.getData() instanceof IBookMark;
      }
    };

    assertEquals(subRoot2Mark1, t.nextNode().getData());
    assertEquals(subRoot31Mark1, t.nextNode().getData());
    assertEquals(null, t.nextNode());
  }
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.util.TreeTraversal

Copyright © 2018 www.massapicom. 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.