Greetings,
one of my customers wants a text editor implemented in one of my
applications. I couldn't convince him that many many text editors exist
already and that he doesn't need a new one. To no avail (sigh). He doesn't
want a separate process to handle the job so now I'm implementing a
brand new text editor (sigh again). I've decided to give him more than
he wanted for (I'm being payed by the hour for this ;-)
There's loading/saving, there's regular expression search and a whole
lot of other hulla baloo already. I stumbled upon a little inconvenience
though: through its key bindings a JTextArea implements the cut/copy/paste
features.
I want to activate those features/Actions through toolbar buttons too.
Here's my question: I got lost in the documentation. What I've found now
is this:
JTextArea ta= new JTextArea();
Action[] actions= ta.getUI().getEditorKit(ta).getActions();
This can't be true: I don't believe that I have to carouse this array and
look for a nested DefaultEditorToolkit.CopyAction object ... I must be
missing something here. Any ideas anyone?
Thanks in advance for putting me on track w.r.t. that documention again.
kind regards,
Jos