Package org.openjump.core.ui.io.file
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 ofFileLayerLoaderthat wraps an existing file basedDataSourceclass.- Author:
- Paul Austin
-
-
Field Summary
-
Fields inherited from class org.openjump.core.ui.io.file.AbstractFileLayerLoader
PRIO_COMPARATOR
-
Fields inherited from interface org.openjump.core.ui.io.file.FileLayerLoader
KEY
-
-
Constructor Summary
Constructors Constructor Description DataSourceFileLayerLoader()No parameter constuctor for xml persitence.DataSourceFileLayerLoader(WorkbenchContext workbenchContext, Class dataSourceClass, String description, List<String> extensions)Construct a new DataSourceFileLayerLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(String name, Object value)BooleangetBooleanParam(String name)DoublegetDoubleParam(String name)IntegergetIntegerParam(String name)ObjectgetParameter(String name)Map<String,Object>getParameters()StringgetStringParam(String name)booleanopen(TaskMonitor monitor, URI uri, Map<String,Object> options)Open the file specified by the URI with the map of option values.Objectprocess(TaskMonitor monitor)voidresetParameters()voidsetContext(WorkbenchContext context)voidsetParameters(Map<String,Object> map)Set parameters with which to execute a plugin.protected Map<String,Object>toProperties(URI uri, Map<String,Object> options)Convert the URI and map of options for the data source.-
Methods inherited from class org.openjump.core.ui.io.file.AbstractFileLayerLoader
addFileExtensions, addOption, addOption, getDescription, getFileExtensions, getOptionMetadata, removeOption, removeOption, toString
-
-
-
-
Constructor Detail
-
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- TheDataSourceclass.description- The file format name.extensions- The list of supported extensions.
-
-
Method Detail
-
setParameters
public void setParameters(Map<String,Object> map)
Description copied from interface:RecordableSet parameters with which to execute a plugin.- Specified by:
setParametersin interfaceRecordable- Parameters:
map- a map of parameters
-
resetParameters
public void resetParameters()
-
setContext
public void setContext(WorkbenchContext context)
-
process
public Object process(TaskMonitor monitor) throws ClassNotFoundException, URISyntaxException
-
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:
openin interfaceFileLayerLoader- 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.
-
-