user macros with java
i've been assigned the task of rewriting an old application using Java.the application was developed using C and Pascal.
Features of the old application included the ability for the user to define and store macros:the user saves what he types and the reruns it again and again.
i'm not a C expert but i don't suppose this was a C and/or Pascal feature.
Does Java have a way of saving user keystrokes in order to invoke them again,
or should i accommodate for this in my application ?
thanks
[530 byte] By [
_stevea] at [2007-11-27 10:13:03]

> i'm not a C expert but i don't suppose this was a C
> and/or Pascal feature.
AFAIK it's a "feature" of no programming language. There are probably libraries for many languages that provide the functionality for different operating systems and user interface systems though.
> Does Java have a way of saving user keystrokes in
> order to invoke them again,
Not out of the box, but I'm pretty confident that someone will have created something to do such keystroke recording.
> or should i accommodate for this in my application ?
>
If your specs say you should, you should.
You'll have to capture the events and record them yourself. If I was doing this, I'd be using the Command pattern to define all the actions that can be recorded, and serializing them to disk. I saw an app. recently that defined all it's core tasks as Ant tasks and recorded macros as Ant scripts, thus saving the bother of writing an engine to replay them. Might be a bit heavyweight for your needs, though