Package javax.swing.text

Examples of javax.swing.text.StringContent.insertString()


        sc.remove(0, 5);
        h.check(0, position.getOffset(), "Position.getOffset() should be 0 and is: " + position.getOffset());
        h.check("path\n", sc.getString(0, sc.length()), "getString(0, length()) should be 'path\\n' and is: " + sc.getString(0, sc.length()));
        h.check(0, position2.getOffset(), "Position.getOffset() should be 0 and is: " + position2.getOffset());
        h.check(5, position3.getOffset(), "Position3.getOffset() should be 5 and is: " + position3.getOffset());
        sc.insertString(0, "class");
        h.check(0, position.getOffset(), "Position.getOffset() should be 0 and is: " + position.getOffset());
        h.check("classpath\n", sc.getString(0, sc.length()), "getString(0, length()) should be 'classpath\\n' and is: " + sc.getString(0, sc.length()));
        h.check(0, position2.getOffset(), "Position.getOffset() should be 0 and is: " + position2.getOffset());
        h.check(sc.length(), position3.getOffset(), "Position3 should be 10 and is: " + position3.getOffset());
      }
View Full Code Here


    UndoableEdit ue2 = null;
    UndoableEdit ue3 = null;
    try
      {
        h.checkPoint("StringContent -- insertString()");
        sc.insertString(0, "path");
        h.check("path\n", sc.getString(0, sc.length()),
                "StringContent.insertString(): insert 'path' at 0");
        sc.insertString(0, "class");
        ue = sc.remove(1, 4);
        java.util.Locale.setDefault(java.util.Locale.US);
View Full Code Here

      {
        h.checkPoint("StringContent -- insertString()");
        sc.insertString(0, "path");
        h.check("path\n", sc.getString(0, sc.length()),
                "StringContent.insertString(): insert 'path' at 0");
        sc.insertString(0, "class");
        ue = sc.remove(1, 4);
        java.util.Locale.setDefault(java.util.Locale.US);
        String presentationName = ue.getPresentationName();
        h.check("", presentationName, "PresentationName should be '' and is: " + presentationName);
        String redoPresentationName = ue.getRedoPresentationName();
View Full Code Here

        ue.die();
        h.debug("UndoableEdit.die() no more undo/redo");
        h.check(false, ue.canUndo(), "die, no more undo");
        h.check(false, ue.canRedo(), "die, no more redo");
        sc = new StringContent();
        sc.insertString(0, "classpathX");
        h.check("classpathX\n", sc.getString(0, sc.length()), "should be 'classpathX' and is: " + sc.getString(0, sc.length()));
        ue = sc.remove(3, 2);
        h.check("clapathX\n", sc.getString(0, sc.length()),
                "double undo: should be 'clapathX\\n' and is: " + sc.getString(0, sc.length()));
        ue2 = sc.remove(4, 2);
View Full Code Here

        h.checkPoint("cannot undo");
      }
    try
      {
        sc = new StringContent();
        sc.insertString(0, "super classpath");
        h.check("super classpath\n", sc.getString(0, sc.length()), "insert 'super classpath': " + sc.getString(0, sc.length()));
        ue = sc.remove(0, 6);
        h.check("classpath\n", sc.getString(0, sc.length()), "insert 'super classpath': " + sc.getString(0, sc.length()));
        ue.undo();
        h.check("super classpath\n", sc.getString(0, sc.length()), "undo 'classpath': " + sc.getString(0, sc.length()));
View Full Code Here

    verify(observer, times(1)).valueChanged(any(String.class), eq((String) null));
    textArea.setText("TextComponent Text");
    getRobot().waitForIdle();
    verify(observer, times(1)).valueChanged(eq("TextComponent Text"), any(String.class));
    StringContent content = new StringContent();
    content.insertString(0, "TextComponent new Document");
    textArea.setDocument(new PlainDocument(content));
    getRobot().waitForIdle();
    verify(observer, times(1)).valueChanged(eq("TextComponent new Document"), any(String.class));
  }
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.