@Override
  public void action() {
    final WebSiteExporter wsExporter = new WebSiteExporter();
    settings.load(wsExporter);

    WebSiteSettingsPanel wsPanelSettings = new WebSiteSettingsPanel();
    wsPanelSettings.setup(wsExporter);

    ValidationPanel validationPanel = WebSiteSettingsPanel.createValidationPanel(wsPanelSettings);

    final DialogDescriptor dialogDescriptor =
        new DialogDescriptor(
            validationPanel, getMessage("WebSiteExporterUI.dialogdescriptor.description"));

    validationPanel.addChangeListener(
        new ChangeListener() {

          @Override
          public void stateChanged(ChangeEvent e) {
            dialogDescriptor.setValid(!((ValidationPanel) e.getSource()).isProblem());
          }
        });
    Object result = DialogDisplayer.getDefault().notify(dialogDescriptor);
    if (result == NotifyDescriptor.OK_OPTION) {
      wsPanelSettings.unsetup(true);
      settings.save(wsExporter);
      filePath = wsExporter.getPath().getAbsolutePath();
      if (wsPanelSettings.getSelectedWorkspaces().length > 0) {
        wsExporter.setSelectedWorkspaces(wsPanelSettings.getSelectedWorkspaces());

        LongTaskExecutor executor = new LongTaskExecutor(true, "WebSiteExporter");
        executor.setLongTaskListener(longTaskListener);
        executor.setDefaultErrorHandler(errorHandler);
        executor.execute(
            wsExporter,
            new Runnable() {

              @Override
              public void run() {

                cancelled = !wsExporter.execute();
              }
            });
      } else {
        JOptionPane.showMessageDialog(
            validationPanel,
            getMessage("WebSiteExporterUI.Errormsg.WSSelected.Description"),
            getMessage("WebSiteExporterUI.Errormsg.WSSelected.Title"),
            JOptionPane.ERROR_MESSAGE);
      }
    } else {
      wsPanelSettings.unsetup(false);
    }
  }
  @Override
  public void execute(final Statistics statistics, LongTaskListener listener) {
    StatisticsBuilder builder = getBuilder(statistics.getClass());
    LongTaskExecutor executor = new LongTaskExecutor(true, "Statistics " + builder.getName(), 10);
    if (listener != null) {
      executor.setLongTaskListener(listener);
    }

    if (statistics instanceof DynamicStatistics) {
      final DynamicLongTask dynamicLongTask = new DynamicLongTask((DynamicStatistics) statistics);
      executor.execute(
          dynamicLongTask,
          new Runnable() {

            @Override
            public void run() {
              executeDynamic((DynamicStatistics) statistics, dynamicLongTask);
            }
          },
          builder.getName(),
          null);
    } else {
      LongTask task = statistics instanceof LongTask ? (LongTask) statistics : null;
      executor.execute(
          task,
          new Runnable() {

            @Override
            public void run() {
              execute(statistics);
            }
          },
          builder.getName(),
          null);
    }
  }