Package com.puppetlabs.xtext.textflow

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


  }

  @Test
  public void test_MeasuringTextStreamOneLineNoBreak() {
    MeasuredTextFlow flow = this.getInjector().getInstance(MeasuredTextFlow.class);
    flow.appendText("123");
    assertFlowOneLineNoBreak(flow);
  }

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


  }

  @Test
  public void test_RecordingOneLineNoBreak() {
    MeasuredTextFlow flow = this.getInjector().getInstance(TextFlowRecording.class);
    flow.appendText("123");
    assertFlowOneLineNoBreak(flow);
  }

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

  }

  @Test
  public void test_TextFlowOneLineNoBreak() {
    MeasuredTextFlow flow = this.getInjector().getInstance(TextFlow.class);
    flow.appendText("123");
    assertFlowOneLineNoBreak(flow);
  }

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

  public void test_TextLinewrap() {
    // default is 132 characters before a wrap and 0 wrap indent
    MeasuredTextFlow flow = this.getInjector().getInstance(TextFlow.class);
    Fixed stars = new CharSequences.Fixed('*', 22);
    for(int i = 0; i < 24; i++) {
      flow.appendText(stars);
      flow.appendSpaces(0);
    }
    assertEquals(4, flow.getHeight());
    assertEquals(132, flow.getWidth());

View Full Code Here

    assertEquals(4, flow.getHeight());
    assertEquals(132, flow.getWidth());

    flow = this.getInjector().getInstance(TextFlow.class);
    for(int i = 0; i < 24; i++) {
      flow.appendText(stars);
      flow.appendSpaces(1);
    }
    assertEquals(5, flow.getHeight());
    assertEquals(115, flow.getWidth());
  }
View Full Code Here

      MeasuredTextFlow inner = new MeasuredTextFlow(formattingContext);
      Iterator<Expression> itor = c.getValues().iterator();
      while(itor.hasNext()) {
        doFormat(itor.next(), inner);
        if(itor.hasNext()) {
          inner.appendText(",");
          inner.appendSpace();
        }
      }
      width = inner.getWidth();
    }
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.