Package org.apache.karaf.shell.table

Examples of org.apache.karaf.shell.table.ShellTable.addRow()


        Component[] components = scrService.getComponents();
        Arrays.sort(components, idComparator);
        for (Component component : ScrUtils.emptyIfNull(Component.class, components)) {
            if (showHidden) {
                // we display all because we are overridden
                table.addRow().addContent(component.getId(), ScrUtils.getState(component.getState()), component.getName());
            } else {
                if (ScrActionSupport.isHiddenComponent(component)) {
                    // do nothing
                } else {
                    // we aren't hidden so print it
View Full Code Here


            } else {
                if (ScrActionSupport.isHiddenComponent(component)) {
                    // do nothing
                } else {
                    // we aren't hidden so print it
                    table.addRow().addContent(component.getId(), ScrUtils.getState(component.getState()), component.getName());
                }
            }
        }
        return null;
    }
View Full Code Here

        ShellTable table = new ShellTable();
        table.column(new Col("id").alignRight().maxSize(5));
        table.column(new Col("Name").maxSize(20));
        table.column(new Col("Centered").alignCenter());

        table.addRow().addContent(1, "Test", "Description");
        table.addRow().addContent(20, "My name", "Description");

        Row row = table.addRow();
        row.addContent(123456789);
        row.addContent("A very long text that should be cut");
View Full Code Here

        table.column(new Col("id").alignRight().maxSize(5));
        table.column(new Col("Name").maxSize(20));
        table.column(new Col("Centered").alignCenter());

        table.addRow().addContent(1, "Test", "Description");
        table.addRow().addContent(20, "My name", "Description");

        Row row = table.addRow();
        row.addContent(123456789);
        row.addContent("A very long text that should be cut");
        row.addContent("A very long text that should not be cut");
View Full Code Here

        table.column(new Col("Centered").alignCenter());

        table.addRow().addContent(1, "Test", "Description");
        table.addRow().addContent(20, "My name", "Description");

        Row row = table.addRow();
        row.addContent(123456789);
        row.addContent("A very long text that should be cut");
        row.addContent("A very long text that should not be cut");

        StringWriter writer = new StringWriter();
View Full Code Here

    public void testGrow() {
        ShellTable table = new ShellTable().size(10);
        table.column(new Col("1"));
        table.column(new Col("2"));

        table.addRow().addContent("1", "2");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
View Full Code Here

    public void testShrink() {
        ShellTable table = new ShellTable().size(10);
        table.column(new Col("1").maxSize(5));
        table.column(new Col("2").alignRight());

        table.addRow().addContent("quite long", "and here an even longer text");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
View Full Code Here

    public void testTooSmall() {
        ShellTable table = new ShellTable().size(2);
        table.column(new Col("1").maxSize(5));
        table.column(new Col("2").alignRight());

        table.addRow().addContent("quite long", "and here an even longer text");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, true);
        out.flush();
View Full Code Here

    public void testNoFormat() {
        ShellTable table = new ShellTable();
        table.column(new Col("first"));
        table.column(new Col("second"));

        table.addRow().addContent("first column", "second column");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, false);
        out.flush();
View Full Code Here

        ShellTable table = new ShellTable();
        table.separator(";");
        table.column(new Col("first"));
        table.column(new Col("second"));

        table.addRow().addContent("first column", "second column");

        StringWriter writer = new StringWriter();
        PrintStream out = new PrintStream(new WriterOutputStream(writer));
        table.print(out, false);
        out.flush();
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.