Actually, I meant extending Component itself and writing a skin that extends
ComponentSkin. You could probably use Label and LabelSkin as a model. I imagine
that the ConsoleSkin class could be a lot less complex than LabelSkin since you
wouldn't need to deal with wrapping (if you assume a fixed-width font, you
could handle wrapping at the component level).
On Friday, April 30, 2010, at 10:20AM, "Patrick Shea" <[email protected]> wrote:
>Thanks Greg, I don't want to take up too much of your time but I suppose by
>writing my on Console class you mean extending an existing component. I looked
>at the textarea code quickly but could not see where the actual screen
>rendering is taking place.
>
>If you could point me to an example that would be great.
>
>Thanks
>Patrick
>
>-----Original Message-----
>From: "Greg Brown" <[email protected]>
>Sent: Friday, April 30, 2010 7:31am
>To: [email protected]
>Subject: Re: Best way to implement a system out console?
>
>I meant adding new labels - I assumed that you were appending to the text in
>the TextArea, so a similar limitation would apply.
>
>If you need true console-like behavior, you may want to consider writing your
>own Console class. This class could be backed by an array list of strings. You
>could make the width and height configurable, like most console windows. You
>could potentially scroll the buffer by using a variable "start" index so you
>wouldn't have to perform a remove(0)/add() every time you appended a line. The
>skin would simply paint each line of text, so it wouldn't be that tough to
>write.
>
>I imagine other developers might find such a class valuable as well.
>
>Greg
>
>On Apr 29, 2010, at 8:43 PM, Patrick Shea wrote:
>
>> You mean adding new label objects or changing the text of one label? In my
>> case it could grow to many thousands of lines...
>>
>> Patrick
>>
>> -----Original Message-----
>> From: "Greg Brown" <[email protected]>
>> Sent: Thursday, April 29, 2010 8:33pm
>> To: [email protected]
>> Subject: Re: Best way to implement a system out console?
>>
>> TextArea might not be the best choice (it needs a bit of work, currently
>> scheduled for Pivot 1.5.1). How about appending Labels to a vertical
>> BoxPane? Either option won't work quite like a console, since it will grow
>> indefinitely (whereas a console generally maintains a fixed-size buffer or
>> no buffer at all), but I think the BoxPane option should be OK as long as
>> you don't plan to write too much to it.
>>
>> Greg
>>
>> On Apr 29, 2010, at 7:56 PM, Patrick Shea wrote:
>>
>>> I tried setText() of a StringBuffer into a TestArea but it flashes at every
>>> new setText()...
>>>
>>> Is there a type of component that would be able to act like tail or the
>>> eclipse console?
>>>
>>> Thanks
>>> Patrick
>>>
>>
>>
>>
>
>
>
>
>