public abstract static class TLcyDataFormatManager.ALcyHandlerChooser extends Object
Class that represents the logic to choose a ILcdModelDecoder
or
ALcyDataSourceHandler
out of a list of candidates. The instance set on the TLcyDataFormatManager
is triggered for every data source that needs to be handled.
Implementations could for example present the user with a dialog to choose the appropriate handler.
Constructor and Description |
---|
ALcyHandlerChooser() |
Modifier and Type | Method and Description |
---|---|
abstract ILcdModelDecoder |
chooseDataSourceDecoder(ILcdDataSource aSource,
ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer> aMapComponent,
ILcdModelDecoder[] aModelDecoders,
Component aParentComponent)
Chooses the
ILcdModelDecoder to use for the given aDataSource
out of the list of given decoders. |
abstract Object |
chooseHandler(String aSourceName,
ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer> aMapComponent,
ILcdModelDecoder[] aModelDecoders,
ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors,
ALcyDataSourceHandler[] aDataSourceHandlers,
ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors,
ALcyFileTypeDescriptor aSelectedFileTypeDescriptor,
Component aParentComponent)
Chooses the
ILcdModelDecoder or ALcyDataSourceHandler to use for
the given aSourceName out of the list of given handlers. |
public abstract Object chooseHandler(String aSourceName, ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors, ALcyDataSourceHandler[] aDataSourceHandlers, ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors, ALcyFileTypeDescriptor aSelectedFileTypeDescriptor, Component aParentComponent) throws TLcyUserCancelledException
ILcdModelDecoder
or ALcyDataSourceHandler
to use for
the given aSourceName out of the list of given handlers.aSourceName
- The data source to choose a handler for.aMapComponent
- The map on which the data will be opened, provided as
contextual information.aModelDecoders
- An array of ILcdModelDecoder
s from which to
choose.aModelDecoderFileTypeDescriptors
- The file type descriptors corresponding to aModelDecoders.
Is null
iff aModelDecoders is
null
. Array must have equal length as
aModelDecoders. It can contain null values for those
ILcdModelDecoder
s that don't work with
files.aDataSourceHandlers
- An array of ALcyDataSourceHandler
s from which
to choose.aDataSourceHandlerFileTypeDescriptors
- The file type descriptors corresponding to
aDataSourceHandlers. Is null
iff
aDataSourceHandlers is null
. Array must have
equal length as aDataSourceHandlers. It can contain null
values for those ALcyDataSourceHandler
s that
don't work with files.aSelectedFileTypeDescriptor
- The selected file type descriptor, can be used if there is
ambiguity (multiple decoders can read a file). Can be
null
for default behavior.aParentComponent
- A parent component, used to display message dialogs.aModelDecoders
or aDataSourceHandlers
, or null
in case none of the model decoders / data source handlers is capable of handling the
source.TLcyUserCancelledException
- This method can throw a TLcyUserCancelledException
to
indicate that the user has decided to cancel the data loading instead of choosing a handler.
In such case, the TLcyDataFormatManager
will not indicate to the
TLcyDataFormatManager.getLogListener()
that the source failed,
but rather swallow the exception.public abstract ILcdModelDecoder chooseDataSourceDecoder(ILcdDataSource aSource, ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, Component aParentComponent) throws TLcyUserCancelledException
ILcdModelDecoder
to use for the given aDataSource
out of the list of given decoders.aSource
- The data source to choose a handler for.aMapComponent
- The map on which the data will be opened, provided as contextual
information.aModelDecoders
- An array of ILcdModelDecoder
s from which to
choose.aParentComponent
- A parent component, used to display message dialogs.null
in case
none of the model decoders / data source handlers is capable of handling the source.TLcyUserCancelledException
- This method can throw a TLcyUserCancelledException
to
indicate that the user has decided to cancel the data loading instead of choosing a handler.
In such case, the TLcyDataFormatManager
will not indicate to the
TLcyDataFormatManager.getLogListener()
that the source failed,
but rather swallow the exception.