Empyreus / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

TextArea getText()/setText(String text)/append(String text) methods? #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I dont know if it's because I've not downloaded the last branch(i still having 
the 2.0.0) but in the TextArea class there aren't the:

getText(),setText(String text) and the append(String text) methods. 

Is this because of the version i have?
I started fixing this adding the methods(just the getText() so far) 
myself(kinda a fast,ugly and wrong work):

    public String getText() { //TODO FIX THE STRING RETURN TO AN ARRAY/ARRAYLIST
        String tmp="";
        if(this.lines != null) {
            for(int i=0;i<this.lines.size();i++) {
                tmp +=" "+this.lines.get(i);
            }
        }
        return tmp;
    }

this fails obviously if the string is too long,so i suggest to DO NOT use this 
solution :)

Hope i helped,somehow or gave u something to work on(I'm sorry I'm posting like 
in a forum hehe) :)

Original issue reported on code.google.com by zer0.c...@gmail.com on 15 Jul 2012 at 1:15

GoogleCodeExporter commented 9 years ago
Well, the TextArea is static by design, initially I called it StaticTextArea 
even. Certainly a fully editable text area component would be desirable, but 
would take a significant amount of work.

I suppose for a start, being able to change the text programmatically is 
something we could do.

Original comment by mab...@gmail.com on 16 Jul 2012 at 1:17

GoogleCodeExporter commented 9 years ago
I added this a while back but I forgot to close this issue. It's in both 2.0.x 
and 2.1.x

Original comment by mab...@gmail.com on 19 Aug 2012 at 7:00