Package org.jamesii.gui.syntaxeditor

Examples of org.jamesii.gui.syntaxeditor.ReplaceTokenAction


  public final void testRun() {

    String original =
        Strings.generateRandomString(random.nextInt(10000) + 25, random);

    ReplaceTokenAction action =
        new ReplaceTokenAction(null, 0, 10, "helloWorld!");

    assertNotNull(action);

    Reader input = new StringReader(original);
    StringWriter output = new StringWriter();

    action.run(input, output);

    assertEquals("helloWorld!" + original.substring(10), output.toString());

    action = new ReplaceTokenAction(null, 10, 20, "helloWorld!");

    input = new StringReader(original);
    output = new StringWriter();

    action.run(input, output);

    assertEquals(
        original.substring(0, 10) + "helloWorld!" + original.substring(20),
        output.toString());
View Full Code Here


                    - Strings.getLevenshteinDistance(t.getValue(), o2);
              }

            });
            for (String state : ca.states) {
              list.add(new ReplaceTokenAction(String.format(
                  "Replace with \"%s\"", state), t.getStart(), t.getEnd(),
                  state));
            }
          }
View Full Code Here

TOP

Related Classes of org.jamesii.gui.syntaxeditor.ReplaceTokenAction

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.