private static void export(
      GeoSetExporter exporter, GeoSet geoSet, String filePath, ProgressIndicator progressIndicator)
      throws IOException {

    // export the GeoSet to the file
    if (progressIndicator != null) {
      exporter.setProgressIndicator(progressIndicator);
      progressIndicator.start();
    }
    exporter.export(geoSet, filePath);

    // FIXME this is an ugly hack !!! ???
    if (exporter instanceof TableLinkExporter) {

      TableLinkExporter tableLinkExporter = (TableLinkExporter) exporter;
      TableLink tableLink = null;

      if (geoSet instanceof GeoMap && ((GeoMap) geoSet).tableLinkGetNumber() > 0) {
        tableLink = ((GeoMap) geoSet).tableLinkGet(0); // !!! ???
      } else {
        ika.table.Table table = new ika.table.Table("US-ASCII");
        table.setName("table");
        table.addColumn("ID");
        final int rowCount = tableLinkExporter.getFeatureCount();
        for (int i = 0; i < rowCount; i++) {
          table.addRow(new Object[] {new Double(i)});
        }
        tableLink = new TableLink(table, geoSet);
      }
      tableLinkExporter.exportTableForGeometry(filePath, tableLink);
    }
  }
    protected GeoSet doInBackground() throws Exception {
      try {

        progressIndicator.start();
        this.setProgress(0);
        GeoExportGUI.export(exporter, geoSet, filePath, progressIndicator);

        return null;

      } catch (Exception e) {

        e.printStackTrace();

        // this will be executed in the event dispatching thread.
        ika.utils.ErrorDialog.showErrorDialog("The file could not be exported.", e);
        throw e;
      } finally {
        progressIndicator.complete();
      }
    }