With all the Menu items, toolbar items and popup items that can total to
about 50-75 choices in a gui design, what the 'easiest' way to map the
action names with the class to call.
Like to use the Command design pattern to do this generically:
Somehow get the "action string" and map it to a "command class".
Is this possible with Command, Reflection etc?
Somehow:
Command c = new <ReflectCallCommandClass> ();
c.execute();
How do the reflection part? More important if their is a better way
than this...
public interface Command {
public void execute();
}
public class MyCommandClass1 extends Command {
public void execute() {
// code for action 1,
// could be from Menu, Toolbar, popups doesn't matter...
}
}