Examples of GapContent


Examples of javax.swing.text.GapContent

   * @param harness
   */
  public void testRemoveLast(TestHarness harness)
  {
    harness.checkPoint("testRemoveLast");
    GapContent gc = new GapContent();
    harness.check(gc.length(), 1);
   
    boolean pass = false;
    try
    {
      gc.remove(0, 1);
    }
    catch (BadLocationException e)
    {
      pass = true;
    }
View Full Code Here

Examples of javax.swing.text.GapContent

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    GapContent gc = new GapContent();
    harness.check(gc.length(), 1);
    try
    {
      gc.insertString(0, "ABC");
    }
    catch (BadLocationException e)
    {
      // ignore
    }
   
    // negative index
    boolean pass = false;
    try
    {
      gc.createPosition(-1);
    }
    catch (BadLocationException e)
    {
      pass = true;
    }
    harness.check(pass);
   
    // index of last char
    Position p = null;
    try
    {
      p = gc.createPosition(3);
    }
    catch (BadLocationException e)
    {
      pass = true;
    }
    harness.check(p.getOffset(), 3);
   
    // index of last char + 1
    try
    {
      p = gc.createPosition(4);
    }
    catch (BadLocationException e)
    {
    }
    harness.check(p.getOffset(), 4);
   
    // index of last char + 2
    pass = false;
    try
    {
      p = gc.createPosition(5);
    }
    catch (BadLocationException e)
    {
      pass = true;
    }
View Full Code Here

Examples of javax.swing.text.GapContent

        super.tearDown();
    }

    public void testHTMLDocumentContentStyleSheet() throws MalformedURLException {
        StyleSheet styles = new StyleSheet();
        final GapContent gapContent = new GapContent(10);
        htmlDoc = new PublicHTMLDocument(gapContent, styles);
        assertSame(styles, htmlDoc.getAttributeContextPublicly());
        assertSame(gapContent, htmlDoc.getContentPublicly());

        URL u1 = new URL("http://www.apache.org");
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.