Class NatExporter

    • Field Detail

      • shell

        protected final org.eclipse.swt.widgets.Shell shell
        The Shell that should be used to open sub-dialogs and perform export operations in a background thread.
        Since:
        1.5
      • openResult

        protected boolean openResult
        Flag that indicates if the created export result should be opened after the export is finished.
        Since:
        1.5
      • exportSucceeded

        protected boolean exportSucceeded
        Flag that indicates that the export succeeded. Used to determine whether the export result can be opened or not.
        Since:
        1.5
      • preRender

        protected boolean preRender
        Flag to configure whether in-memory pre-rendering is enabled or not. This is necessary in case content painters are used that are configured for content based auto-resizing.
        Since:
        1.5
    • Constructor Detail

      • NatExporter

        public NatExporter​(org.eclipse.swt.widgets.Shell shell)
        Create a new NatExporter.
        Parameters:
        shell - The Shell that should be used to open sub-dialogs and perform export operations in a background thread. Can be null but could lead to NullPointerExceptions if IExporter are configured, that use a FileOutputStreamProvider.
      • NatExporter

        public NatExporter​(org.eclipse.swt.widgets.Shell shell,
                           boolean executeSynchronously)
        Create a new NatExporter.
        Parameters:
        shell - The Shell that should be used to open sub-dialogs and perform export operations in a background thread. Can be null but could lead to NullPointerExceptions if IExporter are configured, that use a FileOutputStreamProvider.
        executeSynchronously - Configure whether the export should be performed asynchronously or synchronously. By default the decision whether the execution should be performed synchronously or not is made based on whether a Shell is set or not. If a Shell is set and this flag is set to true the execution is performed synchronously.
        Since:
        1.6
    • Method Detail

      • exportMultipleNatTables

        public void exportMultipleNatTables​(ILayerExporter exporter,
                                            Map<String,​NatTable> natTablesMap)
        Export multiple NatTable instances to one file by using the given ILayerExporter.
        Parameters:
        exporter - The ILayerExporter to use for exporting.
        natTablesMap - The NatTable instances to export. They keys in the map will be used as sheet titles while the values are the instances to export.
      • exportMultipleNatTables

        public void exportMultipleNatTables​(ILayerExporter exporter,
                                            Map<String,​NatTable> natTablesMap,
                                            boolean exportOnSameSheet,
                                            String sheetName)
        Export multiple NatTable instances to one file by using the given ILayerExporter.
        Parameters:
        exporter - The ILayerExporter to use for exporting.
        natTablesMap - The NatTable instances to export. They keys in the map will be used as sheet titles while the values are the instances to export.
        exportOnSameSheet - Flag to configure whether multiple NatTable instances should be exported on the same sheet or not.
        sheetName - The sheet name that should be used in case of exporting multiple NatTables on a single sheet.
        Since:
        1.5
      • setClientAreaToMaximum

        protected void setClientAreaToMaximum​(ILayer layer)
        Increase the client area so it can include the whole ILayer.
        Parameters:
        layer - The ILayer for which the client area should be maximized.
        Since:
        1.5
      • openExport

        protected void openExport​(IExporter exporter)
        Open the export result in the matching application.
        Parameters:
        exporter - The IExporter that was used to perform the export. Needed to access the export result.
        Since:
        1.5
      • setOpenResult

        public void setOpenResult​(boolean openResult)
        Sets the behavior after finishing the export. The default is opening the created export file with the associated application. You can prevent the opening by setting openResult to false.
        Parameters:
        openResult - set to true to open the created export file, false otherwise
        Since:
        1.5
      • getOutputStream

        protected OutputStream getOutputStream​(IExporter exporter)
        Method that is used to retrieve the OutputStream to write the export to in a safe way. Any occurring exception will be handled inside.
        Parameters:
        exporter - The ILayerExporter that should be used
        Returns:
        The OutputStream that is used to write the export to or null if an error occurs.
        Since:
        1.5
      • handleExportException

        protected void handleExportException​(Exception e)
        Method that is used to handle exceptions that are raised while processing the export.
        Parameters:
        e - The exception that should be handled.
        Since:
        1.5
      • enablePreRendering

        public void enablePreRendering()
        Enable in-memory pre-rendering. This is necessary in case content painters are used that are configured for content based auto-resizing.
        Since:
        1.5
      • disablePreRendering

        public void disablePreRendering()
        Disable in-memory pre-rendering. You should consider to disable pre-rendering if no content painters are used that are configured for content based auto-resizing.
        Since:
        1.5