|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsimtools.data.FileDataSourceProvider
public abstract class FileDataSourceProvider
| Field Summary | |
|---|---|
protected static int |
CANCEL_OPTION
|
protected boolean |
chooseAgain
|
protected javax.swing.filechooser.FileFilter |
filter
|
protected java.lang.String |
marker
|
protected static int |
NO_OPTION
|
protected static int |
YES_OPTION
|
| Constructor Summary | |
|---|---|
FileDataSourceProvider(javax.swing.filechooser.FileFilter filter,
java.lang.String marker)
|
|
| Method Summary | |
|---|---|
java.io.File |
chooseFile(java.lang.String fileName,
java.lang.String reason)
Provides a file, using the given fileName or not. |
int |
chooseUseCollection(DataSourceCollection existingDsc,
java.lang.String dscId,
java.lang.String Id)
Chooses whether to use an already existing collection if it contains the datasource to provide, instead of the collection with the given id. |
protected int |
chooseUseCollectionIfMissingDs(java.lang.String dscId,
java.lang.String dsMissingId)
Chooses whether to use created collection even if required data source is missing Default implementation says YES_OPTION. |
protected DataSourceCollection |
createCollection(java.io.File f,
java.lang.Object optionalInformation)
|
protected abstract DataSource |
createEmptyDatasource(java.lang.String dsId,
java.lang.String dscId,
java.lang.Object optionalInformation)
|
protected boolean |
getChooseFileAgain()
|
java.lang.Object |
getOptionalInformation(DataSource ds,
DataSourceCollection dsc)
Asks this provider some optional information about a datasource and possibly its collection. |
DataSource |
provide(java.lang.String id,
java.lang.String dscId,
java.lang.Object optionalInformation,
DataSourcePool pool)
Asks this provider to resolve a symbolic datasource reference. |
protected void |
setChooseFileAgain(boolean chooseAgain)
Subclasses can set this flag to call chooseFile again if the file isn't valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean chooseAgain
protected java.lang.String marker
protected javax.swing.filechooser.FileFilter filter
protected static final int YES_OPTION
protected static final int NO_OPTION
protected static final int CANCEL_OPTION
| Constructor Detail |
|---|
public FileDataSourceProvider(javax.swing.filechooser.FileFilter filter,
java.lang.String marker)
| Method Detail |
|---|
protected void setChooseFileAgain(boolean chooseAgain)
protected boolean getChooseFileAgain()
public java.io.File chooseFile(java.lang.String fileName,
java.lang.String reason)
fileName - The default fileName.reason - What to look for.
public int chooseUseCollection(DataSourceCollection existingDsc,
java.lang.String dscId,
java.lang.String Id)
existingDsc - The existing collectiondscId - The collection id to replaceid - The source id present in both collections
protected int chooseUseCollectionIfMissingDs(java.lang.String dscId,
java.lang.String dsMissingId)
dscId - The created collection iddsMissingId - The required data source id
protected abstract DataSource createEmptyDatasource(java.lang.String dsId,
java.lang.String dscId,
java.lang.Object optionalInformation)
protected DataSourceCollection createCollection(java.io.File f,
java.lang.Object optionalInformation)
throws java.io.IOException,
TimeStampedDataSourceCollection.InvalidFormatException
java.io.IOException
TimeStampedDataSourceCollection.InvalidFormatException
public java.lang.Object getOptionalInformation(DataSource ds,
DataSourceCollection dsc)
DataSourceProvider
getOptionalInformation in interface DataSourceProviderds - The datasourcedsc - The datasource collection, or null.
public DataSource provide(java.lang.String id,
java.lang.String dscId,
java.lang.Object optionalInformation,
DataSourcePool pool)
DataSourceProvider
provide in interface DataSourceProviderid - The symbolic id of a datasourcedscId - The symbolic id of a datasourceCollection. May be nulloptionalInformation - Can be set to help this provider. May be nullpool - DataSourcePool in which to add the source and collection if
they can be provided. May be null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||