Examples of TextFormatter


Examples of com.google.gwt.widgetideas.client.ProgressBar.TextFormatter

        this.add(panel);
        this.center();
    }
   
    public void setText(final String statusText) {
        progressBar.setTextFormatter(new TextFormatter(){

      @Override
      protected String getText(ProgressBar bar, double curProgress) {
        return statusText;
      }});
View Full Code Here

Examples of lombok.ast.printer.TextFormatter

    }
    return position;
  }

  @Override public String toString() {
    TextFormatter formatter = new TextFormatter();
    SourcePrinter printer = new SourcePrinter(formatter);
    accept(printer);
    return formatter.finish();
  }
View Full Code Here

Examples of lombok.ast.printer.TextFormatter

    if (!source.getProblems().isEmpty()) {
      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actual = fixLineEndings(formatter.finish());
    String original = fixLineEndings(source.getRawInput());
    try {
      assertEquals(original, actual);
    } catch (AssertionError e) {
      System.out.println("------------------RAW:");
View Full Code Here

Examples of lombok.ast.printer.TextFormatter

    if (!actual.getProblems().isEmpty()) {
      fail(actual.getProblems().get(0).toString());
    }
   
    Node node = actual.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actualString = formatter.finish();
   
    assertEquals(fixLineEndings(expected), fixLineEndings(actualString));
  }
View Full Code Here

Examples of org.damour.base.client.ui.progressbar.ProgressBar.TextFormatter

    // objectType = an instance of the content object to be published
    // on the server, this guy just needs to be someone who has getData/setData
    // and get/set mimetypes

    progressMeter.setMinProgress(0);
    progressMeter.setTextFormatter(new TextFormatter() {
      protected String getText(ProgressBar bar, double curProgress) {
        String percentText = (int) (100 * bar.getPercent()) + "%";
        if (result.getStatus() == FileUploadStatus.UPLOADING) {
          return "Uploading... " + percentText;
        } else if (result.getStatus() == FileUploadStatus.WRITING_DATABASE) {
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter

        (byte) 0x08, });

    JScanner scanner = new JScanner();
    scanner.scan(packet, Ethernet.ID);

    TextFormatter out = new TextFormatter();
    out.format(packet);
  }
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter

    final JPacket packet = new PcapPacket(Type.POINTER);
    final JScanner scanner = new JScanner();

    long start = System.currentTimeMillis();
    final TextFormatter out = new TextFormatter();

    pcap.loop(Pcap.LOOP_INFINATE, new ByteBufferHandler<String>() {
      int i = 0;

      public void nextPacket(PcapHeader header, ByteBuffer buffer, String user) {

        if (i == 200) {
          pcap.breakloop();
          return;
        }

        System.out.println("\nPacket #" + i);

        try {
          packet.peer(buffer);
        } catch (PeeringException e) {
          e.printStackTrace();
        }

        scanner.scan(packet, JProtocol.ETHERNET_ID);
        // try {
        out.setFrameIndex(i++);
        // out.format(packet);
        // System.out.println(packet.toString());
        // } catch (IOException e) {
        // // TODO Auto-generated catch block
        // e.printStackTrace();
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter

    final JPacket packet = new PcapPacket(Type.POINTER);
    final JScanner scanner = new JScanner();

    long start = System.currentTimeMillis();
    final TextFormatter out = new TextFormatter();

    pcap.loop(Pcap.LOOP_INFINATE, new JBufferHandler<String>() {
      int i = 0;

      public void nextPacket(PcapHeader header, JBuffer buffer, String user) {

        if (i == 200) {
          pcap.breakloop();
          return;
        }

        System.out.println("\nPacket #" + i);

        packet.peer(buffer);

        scanner.scan(packet, JProtocol.ETHERNET_ID);
        // try {
        out.setFrameIndex(i++);
        // out.format(packet);
        // System.out.println(packet.toString());
        // } catch (IOException e) {
        // // TODO Auto-generated catch block
        // e.printStackTrace();
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter

  public void testScanFileJPHandler() throws IOException {
    StringBuilder errbuf = new StringBuilder();
    final Pcap pcap = Pcap.openOffline("tests/test-vlan.pcap", errbuf);

    // long start = System.currentTimeMillis();
    @SuppressWarnings("unused")
    final TextFormatter out = new TextFormatter();
    @SuppressWarnings("unused")
    final JScanner scanner = new JScanner();

    pcap.loop(Pcap.LOOP_INFINATE, JProtocol.ETHERNET_ID,
        new JPacketHandler<String>() {
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter

    assertTrue(packet.hasHeader(IEEE802dot1q.ID, 0));
    assertTrue(packet.hasHeader(Ip4.ID));
    assertTrue(packet.hasHeader(icmp));
    assertTrue(icmp.hasSubHeader(echo));

    @SuppressWarnings("unused")
    TextFormatter out = new TextFormatter();
//    out.format(echo, Detail.MULTI_LINE_FULL_DETAIL);

    assertEquals(0, icmp.type());
    assertEquals(0, icmp.code());
    assertEquals(0x18FD, icmp.checksum());
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.