You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by lbu <lb...@gmail.com> on 2014/01/03 10:35:11 UTC
karaf 3.0 : ShellTable question
Hi,
I've started playing with Karaf 3.0 (thanks for the Christmas gift) and I
have some questions related to ShellTable:
For most of the methods, the action is not in the name so you have
column(...), separator(...), etc but this is not true for addRow:
public Row addRow() {
Row row = new Row();
rows.add(row);
return row;
}
Is there any reason?
For my own needs, I've also created an EnhancedShellTable which let you to:
- set-up columns in the constructor
public EnhancedShellTable(String... columns) {
super();
for(String column : columns) {
super.column(column);
}
}
- add and fill a row with a single method
public void row(Object... content) {
addRow().addContent(content);
}
Would it be possible to add them to ShellTable?
Regards,
Luca
--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-3-0-ShellTable-question-tp4030886.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: karaf 3.0 : ShellTable question
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Luca,
Thanks for the proposal and it makes sense.
I gonna create a Jira to do it.
Regards
JB
On 01/03/2014 10:35 AM, lbu wrote:
> Hi,
> I've started playing with Karaf 3.0 (thanks for the Christmas gift) and I
> have some questions related to ShellTable:
>
> For most of the methods, the action is not in the name so you have
> column(...), separator(...), etc but this is not true for addRow:
>
> public Row addRow() {
> Row row = new Row();
> rows.add(row);
> return row;
> }
>
> Is there any reason?
>
> For my own needs, I've also created an EnhancedShellTable which let you to:
> - set-up columns in the constructor
>
> public EnhancedShellTable(String... columns) {
> super();
> for(String column : columns) {
> super.column(column);
> }
> }
>
> - add and fill a row with a single method
>
> public void row(Object... content) {
> addRow().addContent(content);
> }
>
> Would it be possible to add them to ShellTable?
>
> Regards,
> Luca
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-3-0-ShellTable-question-tp4030886.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: karaf 3.0 : ShellTable question
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,
+1 to deprecate the "old" addRow method and update to the new one.
Regards
JB
On 01/03/2014 01:07 PM, Christian Schneider wrote:
> Hi Luca,
>
> I think my original idea was that all methods with just a subject as
> name were thought to return Shelltable so they could be chained.
> As this is already not the case for column it is not consistent though.
>
> So I think it makes sense to add a new method Row row() and also Row
> row(Object... content).
>
> Should we deprecated the old addRow method to avoid duplication and show
> people how to use the interface?
> Btw. I would also like to adapt the tests to reflect the main way to use
> Shelltable.
>
> Christian
>
>
>
> Am 03.01.2014 10:35, schrieb lbu:
>> Hi,
>> I've started playing with Karaf 3.0 (thanks for the Christmas gift) and I
>> have some questions related to ShellTable:
>>
>> For most of the methods, the action is not in the name so you have
>> column(...), separator(...), etc but this is not true for addRow:
>> public Row addRow() {
>> Row row = new Row();
>> rows.add(row);
>> return row;
>> }
>>
>> Is there any reason?
>>
>> For my own needs, I've also created an EnhancedShellTable which let
>> you to:
>> - set-up columns in the constructor
>> public EnhancedShellTable(String... columns) {
>> super();
>> for(String column : columns) {
>> super.column(column);
>> }
>> }
>>
>> - add and fill a row with a single method
>>
>> public void row(Object... content) {
>> addRow().addContent(content);
>> }
>>
>> Would it be possible to add them to ShellTable?
>>
>> Regards,
>> Luca
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/karaf-3-0-ShellTable-question-tp4030886.html
>>
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: karaf 3.0 : ShellTable question
Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Luca,
I think my original idea was that all methods with just a subject as
name were thought to return Shelltable so they could be chained.
As this is already not the case for column it is not consistent though.
So I think it makes sense to add a new method Row row() and also Row
row(Object... content).
Should we deprecated the old addRow method to avoid duplication and show
people how to use the interface?
Btw. I would also like to adapt the tests to reflect the main way to use
Shelltable.
Christian
Am 03.01.2014 10:35, schrieb lbu:
> Hi,
> I've started playing with Karaf 3.0 (thanks for the Christmas gift) and I
> have some questions related to ShellTable:
>
> For most of the methods, the action is not in the name so you have
> column(...), separator(...), etc but this is not true for addRow:
>
> public Row addRow() {
> Row row = new Row();
> rows.add(row);
> return row;
> }
>
> Is there any reason?
>
> For my own needs, I've also created an EnhancedShellTable which let you to:
> - set-up columns in the constructor
>
> public EnhancedShellTable(String... columns) {
> super();
> for(String column : columns) {
> super.column(column);
> }
> }
>
> - add and fill a row with a single method
>
> public void row(Object... content) {
> addRow().addContent(content);
> }
>
> Would it be possible to add them to ShellTable?
>
> Regards,
> Luca
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-3-0-ShellTable-question-tp4030886.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com