Examples of TableFormatter


Examples of nallar.tickthreading.util.TableFormatter

    }
    if (world == null) {
      sendChat(commandSender, usage());
      return;
    }
    sendChat(commandSender, dump(new TableFormatter(commandSender), world, x, y, z, commandSender instanceof Entity ? 35 : 70).toString());
  }
View Full Code Here

Examples of nallar.tickthreading.util.TableFormatter

      if (arguments.size() == 2) {
        region = TickManager.getHashCode(Integer.parseInt(arguments.remove(0)), Integer.parseInt(arguments.remove(0)));
      } else if (commandSender instanceof Entity) {
        region = TickManager.getHashCode((Entity) commandSender);
      }
      sendChat(commandSender, String.valueOf(TickThreading.instance.getManager(DimensionManager.getWorld(worldId)).writeRegionDetails(new TableFormatter(commandSender), region)));
      return;
    }
    World world;
    try {
      world = getWorld(commandSender, arguments);
    } catch (Exception e) {
      world = null;
    }
    if (world == null) {
      sendChat(commandSender, usage());
      return;
    }
    if ("e".equals(type)) {
      TableFormatter tf = new TableFormatter(commandSender);
      TickManager tickManager = TickThreading.instance.getManager(world);
      tickManager.writeEntityStats(tf);
      tf.sb.append('\n');
      tickManager.fixDiscrepancies(tf.sb);
      sendChat(commandSender, String.valueOf(tf));
    } else if ("b".equals(type)) {
      sendChat(commandSender, String.valueOf(((WorldServer) world).writePendingBlockUpdatesStats(new TableFormatter(commandSender))));
    } else if ("t".equals(type)) {
      sendChat(commandSender, String.valueOf(TickThreading.instance.getManager(world).writeDetailedStats(new TableFormatter(commandSender))));
    } else if ("l".equals(type)) {
      sendChat(commandSender, String.valueOf(TickThreading.instance.getManager(world).writeTECounts(new TableFormatter(commandSender))));
    } else {
      sendChat(commandSender, usage());
    }
  }
View Full Code Here

Examples of nallar.tickthreading.util.TableFormatter

      final EntityTickProfiler entityTickProfiler = EntityTickProfiler.ENTITY_TICK_PROFILER;
      entityTickProfiler.startProfiling(new Runnable() {
        @Override
        public void run() {
          try {
            TableFormatter tf = new TableFormatter(MinecraftServer.getServer());
            tf.tableSeparator = "\n";
            if (json) {
              entityTickProfiler.writeJSONData(profilingFile);
            } else {
              Files.write(entityTickProfiler.writeStringData(tf, 6).toString(), profilingFile, Charsets.UTF_8);
View Full Code Here

Examples of org.apache.hadoop.hbase.hql.TableFormatter

      _jspx_out = out;


  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  HBaseConfiguration conf = master.getConfiguration();
  TableFormatter formatter = new HtmlTableFormatter(out);
  ShowCommand show = new ShowCommand(out, formatter, "tables");
  HServerAddress rootLocation = master.getRootRegionLocation();
  Map<Text, MetaRegion> onlineRegions = master.getOnlineMetaRegions();
  Map<String, HServerInfo> serverToServerInfos =
    master.getServersToServerInfo();
View Full Code Here

Examples of org.apache.hadoop.hbase.hql.TableFormatter

    ConsoleReader reader = new ConsoleReader();
    System.setSecurityManager(new HQLSecurityManager());
    reader.setBellEnabled(conf.getBoolean("hbaseshell.jline.bell.enabled",
        DEFAULT_BELL_ENABLED));
    Writer out = new OutputStreamWriter(System.out, "UTF-8");
    TableFormatter tableFormater = new TableFormatterFactory(out, conf).get();
    if (MASTER_ADDRESS != null) {
      conf.set("hbase.master", MASTER_ADDRESS.substring(9, MASTER_ADDRESS.length()));
    }
    if (HTML_OPTION != null) {
      tableFormater = new HtmlTableFormatter(out);
View Full Code Here

Examples of org.apache.hadoop.hbase.shell.TableFormatter

      _jspx_out = out;


  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  HBaseConfiguration conf = new HBaseConfiguration();
  TableFormatter formatter = new HtmlTableFormatter(out);
  ShowCommand show = new ShowCommand(out, formatter, "tables");
  HServerAddress rootLocation = master.getRootRegionLocation();
  Map<Text, MetaRegion> onlineRegions = master.getOnlineMetaRegions();
  Map<String, HServerInfo> serverToServerInfos =
    master.getServersToServerInfo();
View Full Code Here

Examples of org.jasig.portal.utils.TableFormatter

        addDataTypes(portalDataTypes, exportPortalDataTypes, Operations.EXPORT);
       
        final Iterable<IPortalDataType> deletePortalDataTypes = dataHandlerService.getDeletePortalDataTypes();
        addDataTypes(portalDataTypes, deletePortalDataTypes, Operations.DELETE);
       
        final TableFormatter tableFormatter = new TableFormatter(
                new TableEntry<String>("Data Type", "-", "s"),
                new TableEntry<String>("Export", "-", "s"),
                new TableEntry<String>("Delete", "-", "s"));
               
        for (final Map.Entry<String, Set<Operations>> portalDataTypeEntry : portalDataTypes.entrySet()) {
            final String typeId = portalDataTypeEntry.getKey();
            final Set<Operations> ops = portalDataTypeEntry.getValue();
            tableFormatter.addRow(
                new TableEntry<String>(typeId, "-", "s"),
                new TableEntry<Boolean>(ops.contains(Operations.EXPORT), "-", "b"),
                new TableEntry<Boolean>(ops.contains(Operations.DELETE), "-", "b"));
        }
       
        tableFormatter.format(f);
    }
View Full Code Here

Examples of org.jasig.portal.utils.TableFormatter

    }
   
    public static void format(Iterable<? extends IPortalData> data, Logger l) {
        final Formatter f = new Formatter(new AppendableLogger(l, LogLevel.INFO));
       
        final TableFormatter tableFormatter = new TableFormatter(
                new TableEntry<String>("sysid", "-", "s"),
                new TableEntry<String>("Description", "-", "s"));
       
        for (final IPortalData it : data) {
            final String dataId = it.getDataId();
           
            String dataTitle = it.getDataTitle();
            if (dataTitle == null || dataTitle.equals(dataId)) {
                dataTitle = "";
            }

            tableFormatter.addRow(
                    new TableEntry<String>(dataId, "-", "s"),
                    new TableEntry<String>(dataTitle, "-", "s"));
        }
       
        tableFormatter.format(f);
       
    }
View Full Code Here

Examples of writer2latex.latex.style.TableFormatter

        Context ic = (Context) oc.clone();
        ic.setInTable(true);
   
        // Apply table style
        boolean bApplyCellFormat = config.formatting()>=Config.CONVERT_MOST;
        TableFormatter formatter = palette.getTableSc().getTableFormatter(table,
            !ic.isInMulticols(), bApplyCellFormat);

        // We may need a hyperlink target
        if (!formatter.isSubtable()) {
            palette.getFieldCv().addTarget(node,"|table",ldp);
        }
   
        // Export table declaration
        BeforeAfter baTable = new BeforeAfter();
        formatter.applyTableStyle(baTable);
        ldp.append(baTable.getBefore()).nl();
   
        // Export rows
        if (bApplyCellFormat || !formatter.isLongtable()) { ic.setNoFootnotes(true); }
        int nRowCount = table.getRowCount();
        int nColCount = table.getColCount();
        boolean bInHeader = false;
        // Add interrow material before first row:
        ldp.append(formatter.getInterrowMaterial(0)).nl();
        for (int nRow=0; nRow<nRowCount; nRow++){
            // Longtables may have headers:
            if (formatter.isLongtable()) {
                if (nRow==0 && table.getRow(nRow).isHeader()) {
                    bInHeader = true;
                    if (!bApplyCellFormat) { ic.setNoFootnotes(true); }
                }
                else if (bInHeader && !table.getRow(nRow).isHeader()) {
                    bInHeader = false;
                    if (!bApplyCellFormat) { ic.setNoFootnotes(false); }
                    palette.getNoteCv().flushFootnotes(ldp,oc)
                    ldp.append("\\endhead").nl();
                }
            }
           
            // Export columns in this row
            int nCol = 0;
            while (nCol<nColCount) {
                Element cell = (Element) table.getCell(nRow,nCol);
                if (XMLString.TABLE_TABLE_CELL.equals(cell.getNodeName())) {
                    BeforeAfter baCell = new BeforeAfter();
                    formatter.applyCellStyle(nRow,nCol,baCell);
                    ldp.append(baCell.getBefore());
                    traverseBlockText(cell,ldp,ic);
                    ldp.append(baCell.getAfter());
                }
                // Otherwise ignore; the cell is covered by a \multicolumn entry.
                // (table:covered-table-cell)
                int nColSpan = Misc.getPosInteger(cell.getAttribute(
                                   XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
                if (nCol+nColSpan<nColCount) { ldp.append("&").nl(); }
                nCol+=nColSpan;
            }
            ldp.append("\\\\").append(formatter.getInterrowMaterial(nRow+1)).nl();
        }

        // End table
        ldp.append(baTable.getAfter()).nl();
   
        // Footnotes are now allowed
        if (bApplyCellFormat || !formatter.isLongtable()) {
            palette.getNoteCv().flushFootnotes(ldp,oc);
        }
    }
View Full Code Here

Examples of writer2latex.latex.style.TableFormatter

        Context ic = (Context) oc.clone();
        ic.setInTable(true);
   
        // Apply table style
        boolean bApplyCellFormat = config.formatting()>=Config.CONVERT_MOST;
        TableFormatter formatter = palette.getTableSc().getTableFormatter(table,
            !ic.isInMulticols(), bApplyCellFormat);

        // We may need a hyperlink target
        if (!formatter.isSubtable()) {
            palette.getFieldCv().addTarget(node,"|table",ldp);
        }
   
        // Export table declaration
        BeforeAfter baTable = new BeforeAfter();
        formatter.applyTableStyle(baTable);
        ldp.append(baTable.getBefore()).nl();
   
        // Export rows
        if (bApplyCellFormat || !formatter.isLongtable()) { ic.setNoFootnotes(true); }
        int nRowCount = table.getRowCount();
        int nColCount = table.getColCount();
        boolean bInHeader = false;
        // Add interrow material before first row:
        ldp.append(formatter.getInterrowMaterial(0)).nl();
        for (int nRow=0; nRow<nRowCount; nRow++){
            // Longtables may have headers:
            if (formatter.isLongtable()) {
                if (nRow==0 && table.getRow(nRow).isHeader()) {
                    bInHeader = true;
                    if (!bApplyCellFormat) { ic.setNoFootnotes(true); }
                }
                else if (bInHeader && !table.getRow(nRow).isHeader()) {
                    bInHeader = false;
                    if (!bApplyCellFormat) { ic.setNoFootnotes(false); }
                    palette.getNoteCv().flushFootnotes(ldp,oc)
                    ldp.append("\\endhead").nl();
                }
            }
           
            // Export columns in this row
            int nCol = 0;
            while (nCol<nColCount) {
                Element cell = (Element) table.getCell(nRow,nCol);
                if (XMLString.TABLE_TABLE_CELL.equals(cell.getNodeName())) {
                    BeforeAfter baCell = new BeforeAfter();
                    formatter.applyCellStyle(nRow,nCol,baCell);
                    ldp.append(baCell.getBefore());
                    traverseBlockText(cell,ldp,ic);
                    ldp.append(baCell.getAfter());
                }
                // Otherwise ignore; the cell is covered by a \multicolumn entry.
                // (table:covered-table-cell)
                int nColSpan = Misc.getPosInteger(cell.getAttribute(
                                   XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
                if (nCol+nColSpan<nColCount) { ldp.append("&").nl(); }
                nCol+=nColSpan;
            }
            ldp.append("\\\\").append(formatter.getInterrowMaterial(nRow+1)).nl();
        }

        // End table
        ldp.append(baTable.getAfter()).nl();
   
        // Footnotes are now allowed
        if (bApplyCellFormat || !formatter.isLongtable()) {
            palette.getNoteCv().flushFootnotes(ldp,oc);
        }
    }
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.