Class DataSourceFileLayerLoader

java.lang.Object
org.openjump.core.ui.io.file.AbstractFileLayerLoader
org.openjump.core.ui.io.file.DataSourceFileLayerLoader
All Implemented Interfaces:
Recordable, FileLayerLoader

public class DataSourceFileLayerLoader extends AbstractFileLayerLoader implements Recordable
The DataSourceFileLayerLoader is an implementation of FileLayerLoader that wraps an existing file based DataSource class.
Author:
Paul Austin
  • Constructor Details

    • DataSourceFileLayerLoader

      public DataSourceFileLayerLoader()
      No parameter constuctor for xml persitence.
    • DataSourceFileLayerLoader

      public DataSourceFileLayerLoader(WorkbenchContext workbenchContext, Class dataSourceClass, String description, List<String> extensions)
      Construct a new DataSourceFileLayerLoader.
      Parameters:
      workbenchContext - The workbench context.
      dataSourceClass - The DataSource class.
      description - The file format name.
      extensions - The list of supported extensions.
  • Method Details

    • addParameter

      public void addParameter(String name, Object value)
    • getParameter

      public Object getParameter(String name)
    • getBooleanParam

      public Boolean getBooleanParam(String name)
    • getIntegerParam

      public Integer getIntegerParam(String name)
    • getDoubleParam

      public Double getDoubleParam(String name)
    • getStringParam

      public String getStringParam(String name)
    • setParameters

      public void setParameters(Map<String,Object> map)
      Description copied from interface: Recordable
      Set parameters with which to execute a plugin.
      Specified by:
      setParameters in interface Recordable
      Parameters:
      map - a map of parameters
    • getParameters

      public Map<String,Object> getParameters()
    • resetParameters

      public void resetParameters()
    • setContext

      public void setContext(WorkbenchContext context)
    • process

    • open

      public boolean open(TaskMonitor monitor, URI uri, Map<String,Object> options)
      Open the file specified by the URI with the map of option values.
      Specified by:
      open in interface FileLayerLoader
      Parameters:
      monitor - The TaskMonitor.
      uri - The URI to the file to load.
      options - The map of options.
      Returns:
      True if the file could be loaded false otherwise.
    • toProperties

      protected Map<String,Object> toProperties(URI uri, Map<String,Object> options)
      Convert the URI and map of options for the data source. If the URI is a ZIP uri the File option will be set to the ZIP file name and the CompressedFile set to the entry in the ZIP file.
      Parameters:
      uri - The URI to the file.
      options - The selected options.
      Returns:
      The options.