private <
          A extends org.openflexo.foundation.action.FlexoAction<A, T1, T2>,
          T1 extends FlexoModelObject,
          T2 extends FlexoModelObject>
      A executeAction(final A action, final EventObject event) {
    final boolean progressIsShowing = ProgressWindow.hasInstance();
    boolean confirmDoAction = runInitializer(action, event);
    if (confirmDoAction) {
      actionWillBePerformed(action);
      if (action.isLongRunningAction() && SwingUtilities.isEventDispatchThread()) {
        ProgressWindow.showProgressWindow(action.getLocalizedName(), 100);
        SwingWorker<Void, Void> worker =
            new SwingWorker<Void, Void>() {
              @Override
              protected Void doInBackground() throws Exception {
                runAction(action);
                return null;
              }

              @Override
              protected void done() {
                super.done();
                try {
                  get();
                } catch (InterruptedException e) {
                  e.printStackTrace();
                } catch (ExecutionException e) {
                  e.printStackTrace();
                  if (e.getCause() instanceof FlexoException) {
                    if (!runExceptionHandler((FlexoException) e.getCause(), action)) {
                      if (!progressIsShowing) {
                        ProgressWindow.hideProgressWindow();
                      }
                      return;
                    }
                  } else {
                    throw new RuntimeException(
                        FlexoLocalization.localizedForKey("action_failed")
                            + " "
                            + action.getLocalizedName(),
                        e.getCause());
                  }
                }
                runFinalizer(action, event);
                if (!progressIsShowing) {
                  ProgressWindow.hideProgressWindow();
                }
              }
            };
        worker.execute();
        return action;
      } else {
        try {
          runAction(action);
        } catch (FlexoException exception) {
          if (!runExceptionHandler(exception, action)) {
            return null;
          }
        }
        runFinalizer(action, event);
        if (!progressIsShowing) {
          ProgressWindow.hideProgressWindow();
        }
      }
    }

    return action;
  }