|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.db.DatabaseConnectionStores
public final class DatabaseConnectionStores
Central API to access the available database connection stores in JDeveloper (or equivalent FCP product).
Within the product there are potentially multiple places where database connections can be defined - i.e. multiple database connection stores. There is always a central store (e.g. Resource Palette) and then potentially many others. This class gives access to the full list of available stores, and the ability to retrieve a store (a DatabaseConnections
object) given its unique name.
A store name is not a displayable String, there are displayable methods for getting the short label, tooltip and icon for a given store.
DatabaseConnections
Field Summary | |
---|---|
static java.lang.String |
CENTRAL_STORE The store name for the central store of connections in the IDE. |
Method Summary | |
---|---|
void |
addStoreListener(StoreListener l) |
java.lang.String |
getCurrentConnection(Context ideContext) Will return the current connection that is selected in the IDE. |
ConnectionInfo |
getCurrentConnectionInfo(Context ideContext) Returns the connection information for the connection that is currently selected in the IDE. |
Database |
getCurrentDatabase(Context ideContext) Will return the current Database that is selected in the IDE. |
DatabaseConnections |
getCurrentStore() Gets the current store. |
DatabaseConnections |
getCurrentStore(Context ideContext) Gets the current store. |
javax.swing.Icon |
getIcon(java.lang.String storeName) Gets an icon for the given store. |
static DatabaseConnectionStores |
getInstance() |
static DatabaseProvider |
getReferenceable(java.lang.String storeName, java.lang.String connName) Utility method to get a connection's details given its store and connection name. |
java.lang.String |
getShortLabel(java.lang.String storeName) Gets a displayable (translated) label for the given store name. |
DatabaseConnections |
getStore(java.lang.String storeName) Retrieves a store with the given unique name. |
java.lang.String |
getToolTipText(java.lang.String storeName) Gets a translated tooltip text to use for the given store if it is displayed in UI. |
java.util.Collection<java.lang.String> |
listStores() Lists all the available stores in the product. |
java.util.Collection<java.lang.String> |
listStores(Context ideContext) Lists all the stores the user should be allowed to use in the given IDE Context. |
void |
registerStoreProvider(StoreProvider provider) Registers a provider of stores which will be queried whenever listStores or getStore are called on the central instance. |
void |
removeStoreListener(StoreListener l) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CENTRAL_STORE
Method Detail |
---|
public static final DatabaseConnectionStores getInstance()
public void addStoreListener(StoreListener l)
public void removeStoreListener(StoreListener l)
public java.util.Collection<java.lang.String> listStores()
listStores(Context)
.public java.util.Collection<java.lang.String> listStores(Context ideContext)
public DatabaseConnections getCurrentStore()
public DatabaseConnections getCurrentStore(Context ideContext)
public java.lang.String getCurrentConnection(Context ideContext)
getCurrentStore()
. The database connection does not need to be valid/connected for this to return.public ConnectionInfo getCurrentConnectionInfo(Context ideContext)
public Database getCurrentDatabase(Context ideContext)
getCurrentStore()
.
This is arguably more powerful than DBObjectProviderFactory.findOrCreateProvider(java.lang.Object)
because you can pass the context in directly. When fired from a context menu listener, findOrCreateProvider
may fail because the ide context returned by Context.newIdeContext() can differ from the context passed into a context menu listener. This method relies on the nodes in the context implementing the oracle.ide.db.model interfaces.
If the connection is not already made, calling this method will connect to the database. Furthermore, if a connection to the db cannot be made the exception is logged and null is returned.
Context menu listeners should use this for any database specific work in the product.
getCurrentConnection(oracle.ide.Context)
public DatabaseConnections getStore(java.lang.String storeName)
CENTRAL_STORE
.public java.lang.String getShortLabel(java.lang.String storeName)
public javax.swing.Icon getIcon(java.lang.String storeName)
public java.lang.String getToolTipText(java.lang.String storeName)
public void registerStoreProvider(StoreProvider provider)
public static DatabaseProvider getReferenceable(java.lang.String storeName, java.lang.String connName)
storeName
- the store to look inconnName
- the connection name to look for
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |