You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Christian Schneider (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/23 16:55:28 UTC
[jira] [Resolved] (KARAF-1281) New table support for shell
[ https://issues.apache.org/jira/browse/KARAF-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Schneider resolved KARAF-1281.
----------------------------------------
Resolution: Fixed
> New table support for shell
> ---------------------------
>
> Key: KARAF-1281
> URL: https://issues.apache.org/jira/browse/KARAF-1281
> Project: Karaf
> Issue Type: Improvement
> Components: karaf-shell
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 3.0.0
>
>
> I have implemented a new table implementation that is very easy to use. I would like to replace the current table impl with it but would like some feedback first.
> The usage of the table can be seen from the ShellTableTest:
> 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");
> row.addContent("A very long text that should not be cut");
>
> table.print(System.out);
> ---
> The output looks like this:
> {noformat}
> | id | Name | Centered |
> --------------------------------------------------------------------------
> | 1 | Test | Description |
> | 20 | My name | Description |
> | 12345 | A very long text tha | A very long text that should not be cut |
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira