public class PropertiesDataSource extends AbstractDataSource implements ConfigurableUnit
Properties
.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
comments
The header comments (optional).
|
protected ApplicationModel |
model
The application model.
|
static java.lang.String |
PROP_COMMENTS
Represents a format specific property (String).
|
static java.lang.String |
PROP_FORMAT
Represents a format specific property (String).
|
protected java.util.Properties |
props
The managed content.
|
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 |
---|
PropertiesDataSource()
Constructor method for i18n purposes only.
|
PropertiesDataSource(java.lang.String name,
java.lang.String path,
java.util.Date date,
java.lang.String type,
java.util.Properties props,
java.lang.String comments,
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.
|
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. |
java.util.Properties |
getProperties()
Provides a
Properties object. |
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_COMMENTS
protected java.util.Properties props
protected java.lang.String comments
protected ApplicationModel model
public PropertiesDataSource()
public PropertiesDataSource(java.lang.String name, java.lang.String path, java.util.Date date, java.lang.String type, java.util.Properties props, java.lang.String comments, 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)props
- The managed contentcomments
- The header comments (optional)action
- 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 java.util.Properties getProperties()
Properties
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.