public class XMLMaterialsDatabase extends java.lang.Object implements IMaterialsDatabase
Constructor and Description |
---|
XMLMaterialsDatabase()
The constructor
|
XMLMaterialsDatabase(java.io.File testUserXMLDatabase,
java.io.File testDefaultXMLDatabase)
The test constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMaterial(Material material)
This operation creates a new material in the database.
|
void |
deleteMaterial(Material material)
This operation deletes a material from the database.
|
void |
deleteMaterial(java.lang.String name)
This operation deletes a material from the database.
|
ca.odell.glazedlists.EventList<Material> |
getElements()
This operation returns the list of candidates that should be used to select
new elements to add to the ListComponent.
|
java.util.List<Material> |
getMaterials()
This operation returns all of the materials in the database.
|
ca.odell.glazedlists.gui.TableFormat<Material> |
getTableFormat()
This operation returns the TableFormat that makes it possible to put the
list of elements from getElements() in a searchable table or to otherwise
query them as if they were a table.
|
void |
restoreDefaults()
This operation restores the database to its initial configuration,
destroying all new and updated material information in the process.
|
void |
start()
This operation starts the service.
|
void |
start(org.osgi.service.component.ComponentContext context)
The OSGi-based start operation that performs framework-specific start
tasks to determine the location of the database files.
|
void |
stop()
This operation stops the service.
|
void |
updateMaterial(Material material)
This operation overwrites the information for a material in the database
with information from another.
|
public XMLMaterialsDatabase()
public XMLMaterialsDatabase(java.io.File testUserXMLDatabase, java.io.File testDefaultXMLDatabase)
testUserXMLDatabase
- The XML file that contains the materials.testDefaultXMLDatabase
- The XML file that contains the materials that should be
considered the default list.public java.util.List<Material> getMaterials()
IMaterialsDatabase
getMaterials
in interface IMaterialsDatabase
public void addMaterial(Material material)
IMaterialsDatabase
addMaterial
in interface IMaterialsDatabase
material
- the new Materialpublic void deleteMaterial(java.lang.String name)
IMaterialsDatabase
deleteMaterial
in interface IMaterialsDatabase
name
- the name of the materialpublic void deleteMaterial(Material material)
IMaterialsDatabase
deleteMaterial
in interface IMaterialsDatabase
material
- the Material to removepublic void updateMaterial(Material material)
IMaterialsDatabase
updateMaterial
in interface IMaterialsDatabase
material
- The new Material information.public void restoreDefaults()
IMaterialsDatabase
restoreDefaults
in interface IMaterialsDatabase
public void start()
public void start(org.osgi.service.component.ComponentContext context)
context
- The component contextpublic void stop()
public ca.odell.glazedlists.EventList<Material> getElements()
IElementSource
getElements
in interface IElementSource<Material>
public ca.odell.glazedlists.gui.TableFormat<Material> getTableFormat()
IElementSource
getTableFormat
in interface IElementSource<Material>