Package org.crsh.text.ui

Examples of org.crsh.text.ui.LabelElement


      long min = seconds / 60;
      String time = min + ":" + (seconds % 60);
      long cpu = cpus.get(thread);
      ThreadGroup group = thread.getThreadGroup();
      table.row(
          new LabelElement(thread.getId()),
          new LabelElement(thread.getName()),
          new LabelElement(group == null ? "" : group.getName()),
          new LabelElement(thread.getPriority()),
          new LabelElement(thread.getState()).style(c.fg()),
          new LabelElement(cpu),
          new LabelElement(time),
          new LabelElement(thread.isInterrupted()),
          new LabelElement(thread.isDaemon())
      );
    }

    //
    return table.renderer();
View Full Code Here


      RowElement row = new RowElement();

       row.add(binding.name);

      if (binding.verbose) {
        row.add(new LabelElement(binding.type));
        if (header.getSize() == 1) {
          header.add("CLASS");
        }
      }
     
View Full Code Here

            } else if (record.getLevel() == Level.INFO) {
              color = Color.green;
            } else {
              color = Color.blue;
            }
            return new LabelElement(line).style(color.fg()).renderer();
          }
        };
      }
    });
  }
View Full Code Here

        operation.addChild(new TableElement().
            add(
                new RowElement().add("Type: ", operationInfo.getReturnType()),
                new RowElement().add("Description: ", operationInfo.getDescription()),
                new RowElement().add("Impact: ", impact),
                new RowElement().add(new LabelElement("Signature: "), signature)
            )
        );

        operations.addChild(operation);
      }
View Full Code Here

  @Override
  public LineRenderer renderer(Iterator<Value> stream) {
    ArrayList<LineRenderer> renderers = new ArrayList<LineRenderer>();
    while (stream.hasNext()) {
      Value value = stream.next();
      renderers.add(new LabelElement("<value>" + value.getValue() + "</value>").renderer());
    }
    return LineRenderer.vertical(renderers);
  }
View Full Code Here

      }

      //
      TableElement table = new TableElement().rightCellPadding(1);
      table.row(
        new LabelElement("NAME").style(Style.style(Decoration.bold)),
        new LabelElement("DISPLAY NAME"),
        new LabelElement("DESCRIPTION"),
        new LabelElement("ACTIVE")
      );
      for (Map.Entry<Repl, Boolean> entry : repls.entrySet()) {
        Boolean active = entry.getValue();
        String langDescription = entry.getKey().getDescription();
        String langDisplayName = entry.getKey().getLanguage().getDisplayName();
        String langName = entry.getKey().getLanguage().getName();
        table.row(
          new LabelElement(langName).style(Style.style(Color.red)),
          new LabelElement(langDisplayName != null ? langDisplayName : ""),
          new LabelElement(langDescription != null ? langDescription : ""),
          new LabelElement(active)
        );
      }

      //
      context.provide(new LabelElement("Current repl is " + current.getLanguage().getName() + "available repl are:\n"));
      context.provide(table);
    }
  }
View Full Code Here

  public void main(InvocationContext<Object> context) throws Exception {

    //
    TableElement table = new TableElement().rightCellPadding(1);
    table.row(
      new LabelElement("NAME").style(Style.style(Decoration.bold)),
      new LabelElement("DESCRIPTION")
    );

    //
    CRaSH crash = (CRaSH)context.getSession().get("crash");
    for (Map.Entry<String, String> command : crash.getCommands()) {
      try {
        String desc = command.getValue();
        if (desc == null) {
          desc = "";
        }
        table.row(
          new LabelElement(command.getKey()).style(Style.style(Color.red)),
          new LabelElement(desc));
      } catch (Exception ignore) {
        //
      }
    }

    //
    context.provide(new LabelElement("Try one of these commands with the -h or --help switch:\n"));
    context.provide(table);
  }
View Full Code Here

TOP

Related Classes of org.crsh.text.ui.LabelElement

Copyright © 2018 www.massapicom. 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.