1
/* Copyright 2011 Yorba Foundation
3
* This software is licensed under the GNU Lesser General Public License
4
* (version 2.1 or later). See the COPYING file in this distribution.
10
* A light-weight wrapper that contains enough information to display the
11
* database entry in the library window but can delay instantiating the
12
* actual database instance until it is actually needed.
14
public class DiscoveredAlienDatabase : Object {
15
private AlienDatabaseID id;
16
private AlienDatabaseDriver driver;
17
private AlienDatabase database;
19
public DiscoveredAlienDatabase(AlienDatabaseID id) {
21
driver = AlienDatabaseHandler.get_instance().get_driver(id.driver_id);
24
public AlienDatabaseID get_id() {
28
public string get_uri() {
33
* This method creates an actual instance of the database interface.
34
* It is called when the application is ready to present the database
35
* to the user as a page in the main library window.
37
public AlienDatabase get_database() throws DatabaseError, AlienDatabaseError {
38
if (database == null) {
39
database = driver.open_database(id);
45
* Release the underlying database object.
47
public void release_database() {