I think it depends on whether you're implementing a rich text editor, or
a raw text editor.

Some kind of document model is unavoidable once you add different fonts
and styles (although Swing's editor infrastructure, in particular, is
over-engineered).

There is definitely a use-case for a non-rich text editor (Qt has
different editors for rich- and raw- for performance reasons).
And for a raw editor, you can get away with much simpler data-structures.

If anyone is looking for implementation ideas, take a look at Eclipse's
editor infrastructure - it's a semi-rich (i.e. font-styles, but only one
font size) editor with decent performance.

John Pritchard wrote:
> i'm thinking CharSequence inside text area
>  a Char Sequence with setSelection and insert and delete
>
>
> On Thu, Mar 19, 2009 at 7:07 PM, Greg Brown <[email protected]> wrote:
>
>   
>> Do you have a different approach in mind? FWIW, Swing, WPF, and various
>> other toolkits, including HTML, use some form of document model, so I'm
>> inclined to say that the approach itself is probably pretty valid.
>>     

Reply via email to