Package com.puppetlabs.xtext.textflow

Examples of com.puppetlabs.xtext.textflow.TextFlow.appendText()


  @Test
  public void test_TextFlow_pendingIndent() {
    TextFlow flow = this.getInjector().getInstance(TextFlow.class);
    flow.changeIndentation(1);
    flow.appendBreaks(1);
    flow.appendText("123");
    assertEquals("\n  123", new StringBuilder(flow.getText()).toString());

  }

  @Test
View Full Code Here


  }

  @Test
  public void test_TextFlow_PendingMeasures() {
    TextFlow flow = this.getInjector().getInstance(TextFlow.class);
    flow.appendText("1234");
    assertEquals(4, flow.getWidthOfLastLine());
    assertEquals(1, flow.getHeight());
    flow.appendBreak();
    assertEquals(4, flow.getWidthOfLastLine());
    assertEquals(1, flow.getHeight());
View Full Code Here

    flow.appendBreak();
    assertEquals(4, flow.getWidthOfLastLine());
    assertEquals(1, flow.getHeight());
    flow.changeIndentation(1);
    flow.appendBreak();
    flow.appendText("3");
    flow.appendText("45");
    assertEquals(5, flow.getWidthOfLastLine());
  }

  @Test
View Full Code Here

    assertEquals(4, flow.getWidthOfLastLine());
    assertEquals(1, flow.getHeight());
    flow.changeIndentation(1);
    flow.appendBreak();
    flow.appendText("3");
    flow.appendText("45");
    assertEquals(5, flow.getWidthOfLastLine());
  }

  @Test
  public void test_TextFlowEmpty() {
View Full Code Here

  @Test
  public void test_TextIndentFirst() {
    TextFlow flow = this.getInjector().getInstance(TextFlow.class);
    flow.setIndentation(1);
    flow.setIndentFirstLine(true);
    flow.appendText("1234");
    assertEquals("  1234", new StringBuilder(flow.getText()).toString());

  }

  @Test
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.