Package org.jamesii.gui.base

Examples of org.jamesii.gui.base.URLTreeNodePlacement


  public final void testGetPlacement() {
    URLTreeNode<Object> o = new URLTreeNode<>("nodeID", null, null);
    assertNotNull(o);

    for (URLTreeNode<Object> c : children) {
      URLTreeNodePlacement p = new URLTreeNodePlacement("after", "nodeID");
      o.addNode(c, p);
      assertEquals(p, o.getPlacement(c));
    }
  }
View Full Code Here


    placements.put(s, null);

    s = "main.menu/edit?after=main.menu/file";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "edit" });
    placements.put(s, new URLTreeNodePlacement(AFTER, "main.menu/file"));

    s = "main.menu/window?end";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "window" });
    placements.put(s, new URLTreeNodePlacement(END, null));

    s = "main.menu/help?last";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(LAST, null));

    s = "main.menu/help?first";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(FIRST, null));

    s = "main.menu/help?start";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(START, null));

    s = "main.menu/window?before=main.menu/help";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "window" });
    placements.put(s, new URLTreeNodePlacement(BEFORE, "main.menu/help"));
  }
View Full Code Here

   * Test get placement.
   */
  public final void testGetPlacement() {
    for (String s : urls) {
      try {
        URLTreeNodePlacement p = new URLTreeNodeURL(s).getPlacement();
        assertTrue(p == placements.get(s)
            || p.getWhere().equalsIgnoreCase(placements.get(s).getWhere())
            || (p.getNodeId() == null && placements.get(s).getNodeId() == null)
            || p.getNodeId().equals(placements.get(s).getNodeId()));
      } catch (MalformedURLException | UnsupportedEncodingException e) {
        fail(e.getMessage());
      }
    }
  }
View Full Code Here

    placements.put(s, null);

    s = "main.menu/edit?after=main.menu/file";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "edit" });
    placements.put(s, new URLTreeNodePlacement(AFTER, "main.menu/file"));

    s = "main.menu/window?end";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "window" });
    placements.put(s, new URLTreeNodePlacement(END, null));

    s = "main.menu/help?last";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(LAST, null));

    s = "main.menu/help?first";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(FIRST, null));

    s = "main.menu/help?start";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "help" });
    placements.put(s, new URLTreeNodePlacement(START, null));

    s = "main.menu/window?before=main.menu/help";
    urls.add(s);
    paths.put(s, new String[] { "main.menu", "window" });
    placements.put(s, new URLTreeNodePlacement(BEFORE, "main.menu/help"));
  }
View Full Code Here

   * Test get placement.
   */
  public final void testGetPlacement() {
    for (String s : urls) {
      try {
        URLTreeNodePlacement p = new URLTreeNodeURL(s).getPlacement();
        assertTrue(p == placements.get(s)
            || p.getWhere().equalsIgnoreCase(placements.get(s).getWhere())
            || (p.getNodeId() == null && placements.get(s).getNodeId() == null)
            || p.getNodeId().equals(placements.get(s).getNodeId()));
      } catch (MalformedURLException | UnsupportedEncodingException e) {
        fail(e.getMessage());
      }
    }
  }
View Full Code Here

  /**
   * Test action placement.
   */
  public final void testActionPlacement() {
    for (String s : allowed) {
      assertNotNull(new URLTreeNodePlacement(s, null));
    }
    for (String s : notAllowed) {
      try {
        new URLTreeNodePlacement(s, null);
        fail("Created placement with wrong modifier! (modifier: " + s + ")");
      } catch (Exception e) {
      }
    }
  }
View Full Code Here

  /**
   * Test get where. Tests {@link URLTreeNodePlacement#getWhere()}
   */
  public final void testGetWhere() {
    for (String s : allowed) {
      assertEquals(s.toLowerCase(), new URLTreeNodePlacement(s, null)
          .getWhere().toLowerCase());
    }
  }
View Full Code Here

  /**
   * Test get action id. Tests {@link URLTreeNodePlacement#getNodeId()}
   */
  public final void testGetActionId() {
    for (String s : allowed) {
      assertEquals(null, new URLTreeNodePlacement(s, null).getNodeId());
      assertEquals("123", new URLTreeNodePlacement(s, "123").getNodeId());
      String a = new String("Hello World");
      assertEquals(a, new URLTreeNodePlacement(s, a).getNodeId());
    }
  }
View Full Code Here

  /**
   * Test is end. Tests {@link URLTreeNodePlacement#isEnd()}
   */
  public final void testIsEnd() {
    for (String s : allowed) {
      assertTrue((new URLTreeNodePlacement(s, null).isEnd() && s.equals(END))
          || (!s.equals(END) && !new URLTreeNodePlacement(s, null).isEnd()));
    }
  }
View Full Code Here

  /**
   * Test is last. Tests {@link URLTreeNodePlacement#isLast()}
   */
  public final void testIsLast() {
    for (String s : allowed) {
      assertTrue((new URLTreeNodePlacement(s, null).isLast() && s.equals(LAST))
          || (!s.equals(LAST) && !new URLTreeNodePlacement(s, null).isLast()));
    }
  }
View Full Code Here

TOP

Related Classes of org.jamesii.gui.base.URLTreeNodePlacement

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.