Examples of TextFlow


Examples of com.puppetlabs.xtext.textflow.TextFlow

    "/*   0123456789 0123456789\n *   0123456789 0123456789\n"//
        + " * abc\n" //
        + " * 0123456789 0123456789\n * 0123456789 0123456789\n"//
        + " */";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    assertEquals("Should produce expected result", expected, s.getText().toString());
  }
View Full Code Here

Examples of com.puppetlabs.xtext.textflow.TextFlow

    CommentProcessor cp = new CommentProcessor();
    CommentFormattingOptions options = new CommentFormattingOptions(
      new ICommentFormatterAdvice.DefaultCommentAdvice(), 80);
    String source = "/* the\n  quick\n       *brown\n   * fox\n     \n  \n  */ ";
    IFormattingContext fmtCtx = get(IFormattingContext.class);
    TextFlow s = cp.formatComment(source, in, in, options, fmtCtx);
    // pad expected and result with 2 spaces to emulate the inserting of the result
    // (makes comparison look nicer if test fails)
    String expected = "  /* the\n   * quick\n   * brown\n   * fox\n   */ ";
    assertEquals("Should produce expected result", expected, "  " + CharSequences.trimLeft(s.getText()).toString());
  }
View Full Code Here

Examples of com.puppetlabs.xtext.textflow.TextFlow

  }

  @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());

  }
View Full Code Here

Examples of javafx.scene.text.TextFlow

            if( listView.getSelectionModel().getSelectedItem() != c.domainElement ) {
              listView.getSelectionModel().select(lineObject);
            }
           
            RegionImpl container = (RegionImpl)c.getGraphic();
            TextFlow flow = (TextFlow)container.getChildren().get(0);
           
            flow.requestLayout();
           
            break;
          }
        }
      }
View Full Code Here

Examples of org.eclipse.draw2d.text.TextFlow

        }
        super.setBounds(rect);
    }
   
    protected void addSwimlaneLabel() {
        swimlaneLabel = new TextFlow();
        FlowPage fp = new FlowPage();
        fp.setHorizontalAligment(PositionConstants.CENTER);
        fp.add(swimlaneLabel);
        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        add(fp, data);
View Full Code Here

Examples of org.eclipse.draw2d.text.TextFlow

        CenteredFlowLayout layout = new CenteredFlowLayout();
        layout.setMajorAlignment(FlowLayout.ALIGN_CENTER);
        figure.setLayoutManager(layout);
        figure.setOpaque(false);

        label = new TextFlow();

        FlowPage fp = new FlowPage();
        fp.setLayoutManager(new PageFlowLayout(fp));
        fp.setHorizontalAligment(PositionConstants.CENTER);
        fp.add(label);
View Full Code Here

Examples of org.eclipse.draw2d.text.TextFlow

    setForegroundColor(ColorConstants.tooltipBackground);
    setBackgroundColor(ColorConstants.tooltipBackground);
    setOpaque(true);
    setBorder(TOOLTIP_BORDER);

    header = new TextFlow();
    header.setForegroundColor(ColorConstants.darkGray);
    header.setFont(getBoldFont());
    add(header);

    description = new TextFlow();
    description.setForegroundColor(ColorConstants.darkGray);
    add(description);
  }
View Full Code Here

Examples of org.eclipse.draw2d.text.TextFlow

*/
public StickyNoteFigure(int borderSize) {
  setBorder(new MarginBorder(borderSize));
  FlowPage flowPage = new FlowPage();

  textFlow = new TextFlow();

  textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
          ParagraphTextLayout.WORD_WRAP_SOFT));

  flowPage.add(textFlow);
View Full Code Here

Examples of org.zanata.apicompat.rest.dto.resource.TextFlow

                // Make sure all Text Flows are present
                assertThat(resource.getTextFlows().size(),
                        greaterThanOrEqualTo(3));

                // Evaluate individual text flows
                TextFlow txtFlow = resource.getTextFlows().get(0);
                assertThat(txtFlow.getId(), is("tf2"));
                assertThat(txtFlow.getRevision(), is(1));
                assertThat(txtFlow.getContent(), is("mssgId1"));

                txtFlow = resource.getTextFlows().get(1);
                assertThat(txtFlow.getId(), is("tf3"));
                assertThat(txtFlow.getRevision(), is(1));
                assertThat(txtFlow.getContent(), is("mssgId2"));

                txtFlow = resource.getTextFlows().get(2);
                assertThat(txtFlow.getId(), is("tf4"));
                assertThat(txtFlow.getRevision(), is(1));
                assertThat(txtFlow.getContent(), is("mssgId3"));
            }
        }.run();
    }
View Full Code Here

Examples of org.zanata.apicompat.rest.dto.resource.TextFlow

        res.setContentType(ContentType.TextPlain);
        res.setLang(LocaleId.EN_US);
        res.setRevision(1);
        res.getExtensions(true).add(new PoHeader("This is a PO Header"));

        TextFlow tf1 = new TextFlow("tf1", LocaleId.EN_US, "First Text Flow");
        tf1.getExtensions(true).add(new SimpleComment("This is one comment"));
        res.getTextFlows().add(tf1);

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/1.0/r"),
                "POST", getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.queryParameter("ext", PoHeader.ID).queryParameter(
                        "ext", SimpleComment.ID);
                request.body(MediaType.APPLICATION_JSON, jsonMarshal(res));
            }

            @Override
            protected void onResponse(ClientResponse response) {
                assertThat(response.getStatus(),
                        is(Status.CREATED.getStatusCode())); // 201
            }
        }.run();

        // Verify that it was created successfully
        ISourceDocResource sourceDocClient =
                super.createProxy(
                        createClientProxyFactory(TRANSLATOR, TRANSLATOR_KEY),
                        ISourceDocResource.class,
                        "/projects/p/sample-project/iterations/i/1.0/r");
        ClientResponse<Resource> resourceResponse =
                sourceDocClient.getResource(res.getName(), new StringSet(
                        PoHeader.ID + ";" + SimpleComment.ID));

        assertThat(resourceResponse.getStatus(), is(Status.OK.getStatusCode())); // 200

        Resource createdResource = resourceResponse.getEntity();

        assertThat(createdResource.getName(), is(res.getName()));
        assertThat(createdResource.getType(), is(res.getType()));
        assertThat(createdResource.getContentType(), is(res.getContentType()));
        assertThat(createdResource.getLang(), is(res.getLang()));
        assertThat(createdResource.getRevision(), is(1)); // Created, so
                                                          // revision 1

        // Extensions
        assertThat(createdResource.getExtensions(true).size(),
                greaterThanOrEqualTo(1));
        assertThat(
                createdResource.getExtensions(true).findByType(PoHeader.class)
                        .getComment(), is("This is a PO Header"));

        // Text Flow
        assertThat(createdResource.getTextFlows().size(), is(1));

        TextFlow createdTf = createdResource.getTextFlows().get(0);
        assertThat(createdTf.getContents(), is(tf1.getContents()));
        assertThat(createdTf.getId(), is(tf1.getId()));
        assertThat(createdTf.getLang(), is(tf1.getLang()));
        assertThat(createdTf.getRevision(), is(1)); // Create, so revision 1

        // Text Flow extensions
        assertThat(createdTf.getExtensions(true).size(), is(1));
        assertThat(
                createdTf.getExtensions(true)
                        .findOrAddByType(SimpleComment.class).getValue(),
                is("This is one comment"));
    }
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.