public class ConfigurationDataSource extends AbstractDataSource implements ConfigurableUnit
Configuration
objects.
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config
The managed content.
|
protected ApplicationModel |
model
The application model.
|
static java.lang.String |
PROP_COMMENT
Represents a format specific property (String).
|
static java.lang.String |
PROP_COMPRESSION
Represents a format specific property (String).
|
static java.lang.String |
PROP_FORMAT
Represents a format specific property (String).
|
static java.lang.String |
PROP_ORDERED
Represents a format specific property (Boolean).
|
static java.lang.String |
PROP_SECURE
Represents a format specific property (Boolean).
|
static java.lang.String |
PROP_SORTING
Represents a format specific property (Boolean).
|
action, ACTION_FILE_EDIT, ACTION_FILE_HEXEDIT, ACTION_FILE_OPEN, ACTION_UNKNOWN, ACTION_URL_EDIT, ACTION_URL_HEXEDIT, ACTION_URL_OPEN, date, encoding, formatProps, name, path, size, type
Constructor and Description |
---|
ConfigurationDataSource()
Constructor method for i18n purposes only.
|
ConfigurationDataSource(java.lang.String name,
java.lang.String path,
java.util.Date date,
java.lang.String type,
Configuration config,
int action)
Init functionality.
|
Modifier and Type | Method and Description |
---|---|
void |
configureUnit(java.lang.String id,
Configuration config)
Restores values from persistent data stores.
|
void |
finish(java.io.OutputStream ostream)
After the data has been written to the output stream it is flushed, closed and updated here.
|
Configuration |
getConfiguration()
Provides a
Configuration object. |
OrderedHashtable<java.lang.String,java.lang.String> |
getFormatProperties()
Provides the format specific properties presented by the
AbstractViewer class. |
javax.swing.Icon |
getIcon()
Provides the data source specific icon (optional).
|
java.io.InputStream |
getInputStream()
This method returns an
InputStream representing the data and throws the
appropriate exception if it can not do so. |
java.io.OutputStream |
getOutputStream()
This method returns an
OutputStream where the data can be written and throws
the appropriate exception if it can not do so
Note that a new OutputStream object must be returned each time this method
is called, and the stream must be positioned at the location the data is to be written. |
void |
storeUnit(java.lang.String id,
Configuration config)
Stores the current configuration values persistently.
|
void |
unitRegistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was registered with a model.
|
void |
unitUnregistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was unregistered with a model.
|
finalize, getAction, getContentType, getDate, getDisplayAction, getEncoding, getName, getPath, getSize, loadTemporaryFile, setAction, setContentType, setDate, setEncoding, setFormatProperty, setName, setPath, setSize, storeTemporaryFile
public static final java.lang.String PROP_FORMAT
public static final java.lang.String PROP_COMMENT
public static final java.lang.String PROP_COMPRESSION
public static final java.lang.String PROP_SORTING
public static final java.lang.String PROP_ORDERED
public static final java.lang.String PROP_SECURE
protected Configuration config
protected ApplicationModel model
public ConfigurationDataSource()
public ConfigurationDataSource(java.lang.String name, java.lang.String path, java.util.Date date, java.lang.String type, Configuration config, int action)
name
- The name of the represented data portion (optional)path
- The path of this object (optional)date
- The date of this object (optional)type
- The MIME type (default is "application/octet-stream", optional)config
- The managed contentaction
- The load action AbstractDataSource.FILE_OPEN
, ...java.lang.NullPointerException
- If a parameter is null
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
representing the data and throws the
appropriate exception if it can not do so.
Note that a new InputStream
object must be returned each time this method
is called, and the stream must be positioned at the beginning of the data.
getInputStream
in interface javax.activation.DataSource
getInputStream
in class AbstractDataSource
java.io.IOException
- If an error occurredjava.lang.NullPointerException
- If the loaded content is null
public java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
where the data can be written and throws
the appropriate exception if it can not do so
Note that a new OutputStream
object must be returned each time this method
is called, and the stream must be positioned at the location the data is to be written.
getOutputStream
in interface javax.activation.DataSource
getOutputStream
in class AbstractDataSource
java.io.IOException
- If an error occurredpublic void finish(java.io.OutputStream ostream) throws java.io.IOException
finish
in class AbstractDataSource
ostream
- An output streamjava.io.IOException
- If an error occurredpublic OrderedHashtable<java.lang.String,java.lang.String> getFormatProperties()
AbstractViewer
class.
getFormatProperties
in class AbstractDataSource
null
or emptypublic Configuration getConfiguration()
Configuration
object.
null
public javax.swing.Icon getIcon()
getIcon
in class AbstractDataSource
null
public void configureUnit(java.lang.String id, Configuration config)
configureUnit
in interface ConfigurableUnit
configureUnit
in class AbstractDataSource
id
- The unique identifier for the instanceconfig
- The configurationpublic void storeUnit(java.lang.String id, Configuration config)
storeUnit
in interface ConfigurableUnit
storeUnit
in class AbstractDataSource
id
- The unique identifier for the instanceconfig
- The configurationpublic void unitRegistered(ApplicationModel model, java.lang.String id)
unitRegistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void unitUnregistered(ApplicationModel model, java.lang.String id)
unitUnregistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instanceCopyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.