Class DataSourceFileLayerLoader
java.lang.Object
org.openjump.core.ui.io.file.AbstractFileLayerLoader
org.openjump.core.ui.io.file.DataSourceFileLayerLoader
- All Implemented Interfaces:
Recordable, FileLayerLoader
The DataSourceFileLayerLoader is an implementation of
FileLayerLoader
that wraps an existing file based DataSource class.- Author:
- Paul Austin
-
Field Summary
Fields inherited from class AbstractFileLayerLoader
PRIO_COMPARATORFields inherited from interface FileLayerLoader
KEY -
Constructor Summary
ConstructorsConstructorDescriptionNo parameter constuctor for xml persitence.DataSourceFileLayerLoader(WorkbenchContext workbenchContext, Class dataSourceClass, String description, List<String> extensions) Construct a new DataSourceFileLayerLoader. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, Object value) getBooleanParam(String name) getDoubleParam(String name) getIntegerParam(String name) getParameter(String name) getStringParam(String name) booleanOpen the file specified by the URI with the map of option values.process(TaskMonitor monitor) voidvoidsetContext(WorkbenchContext context) voidsetParameters(Map<String, Object> map) Set parameters with which to execute a plugin.toProperties(URI uri, Map<String, Object> options) Convert the URI and map of options for the data source.Methods inherited from class AbstractFileLayerLoader
addFileExtensions, addOption, addOption, getDescription, getFileExtensions, getOptionMetadata, removeOption, removeOption, toString
-
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- TheDataSourceclass.description- The file format name.extensions- The list of supported extensions.
-
-
Method Details
-
addParameter
-
getParameter
-
getBooleanParam
-
getIntegerParam
-
getDoubleParam
-
getStringParam
-
setParameters
Description copied from interface:RecordableSet parameters with which to execute a plugin.- Specified by:
setParametersin interfaceRecordable- Parameters:
map- a map of parameters
-
getParameters
-
resetParameters
public void resetParameters() -
setContext
-
process
-
open
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
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.
-