public abstract class FrameAction extends AbstractAction implements ActionListener {
private static ThreadLocal<ActionEvent> ACTION_EVENT = new ThreadLocal<ActionEvent>();
protected JFrame getFrame() {
Application application = Application.getInstance();
if (application instanceof SingleFrameApplication)
return ((SingleFrameApplication) application).getFrame();
throw new UnsupportedOperationException("FrameAction only works on SingleFrameApplication");
}