On lun, 2011-08-15 at 10:43 -0400, Greg Brown wrote:
> >> I think is better to create a common base class TextComponent where
> >> TextInput, TextArea and TextPane are children.
>
> I think this makes sense for TextInput and TextArea. TextPane would be more
> challenging since it extends Container.
>
Ok, just quick thinking.
A TextComponent interface and a SimpleTextComponent like this :
interface TextComponent extends ...
{
// Common to all TextComponent (and maybe in interfaces)
// Selection (add/remove/listen)
// Simple text manipulation (get/set/replace/listen)
// Clipboard (cut/copy/paste)
// anchor points (like javax.swing.text.position)
// coordinate conversions (from index to point and viceversa)
// highlight of lines (like javax.swing.text.Highlighter)
// etc...
} ;
class SimpleTextComponent extends Component implements TextComponent
{
// Simple partial implementation, for simple controls
} ;
class TextInput extends SimpleTextComponent
{
} ;
class TextArea extends SimpleTextComponent
{
} ;
class TextPane extends Container implements TextComponent
{
} ;