Code Search for Developers
 
 
  

JdbcPlugin.java from BIRT at Krugle


Show JdbcPlugin.java syntax highlighted


package org.eclipse.birt.report.data.oda.jdbc.ui;

import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.eclipse.birt.report.data.oda.jdbc.ui.util.ConnectionMetaDataManager;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
 * The main plugin class to be used in the desktop.
 * It contains logic for actions to be performed during the loading
 * and unloading of the plugin.
 * 
 * It also provides mechanism of internationalization, by helping
 * to load strings from the properties file 
 */
public class JdbcPlugin extends AbstractUIPlugin
{

	//The shared instance.
	private static JdbcPlugin plugin;
	//Resource bundle.
	private ResourceBundle resourceBundle;
	/**
	 * The key for drivers map property in preference store.
	 */
	public static final String DRIVER_MAP_PREFERENCE_KEY = "JDBC Driver Map"; //$NON-NLS-1$
	/**
	 * The key for JAR files map property in preference store.
	 */
	public static final String JAR_MAP_PREFERENCE_KEY = "JDBC Jar List"; //$NON-NLS-1$

	/**
	 * The key for deleted Jar files map property in preference store.
	 */
	public static final String DELETED_JAR_MAP_PREFERENCE_KEY = "Deleted Jar List"; //$NON-NLS-1$

	/**
	 * The constructor.
	 */
	public JdbcPlugin( )
	{
		super( );
		plugin = this;
		try
		{
			resourceBundle = ResourceBundle.getBundle( "org.eclipse.birt.report.data.oda.jdbc.ui.nls.JdbcPluginResources" );
		}
		catch ( MissingResourceException x )
		{
			resourceBundle = null;
		}
	}

	/**
	 * This method is called when the plug-in is stopped
	 */
	public void stop( BundleContext context ) throws Exception
	{
		ConnectionMetaDataManager.getInstance( ).clearCache( );
		super.stop( context );
	}

	/**
	 * Returns the shared instance.
	 */
	public static JdbcPlugin getDefault( )
	{
		return plugin;
	}

	/**
	 * Returns the string from the plugin's resource bundle, or 'key' if not
	 * found.
	 */
	public static String getResourceString( String key )
	{
		ResourceBundle bundle = JdbcPlugin.getDefault( ).getResourceBundle( );
		try
		{
			return ( bundle != null ) ? bundle.getString( key ) : key;
		}
		catch ( MissingResourceException e )
		{
			return key;
		}
	}
	
	/**
	 * Returns the string from the Resource bundle, formatted according 
	 * to the arguments specified
	 */
	public static String getFormattedString(String key, Object[] arguments) {
		return MessageFormat.format(getResourceString(key), arguments);
	}

	/**
	 * Returns the plugin's resource bundle,
	 */
	public ResourceBundle getResourceBundle( )
	{
		return resourceBundle;
	}
}



See more files for this project here

BIRT

BIRT is an open source, Eclipse-based reporting system that integrates with your application to produce compelling reports for both web and PDF.

Project homepage: http://www.eclipse.org/birt/phoenix/
Programming language(s): Java,XML
License: gpl2

  dialogs/
    JdbcDriverManagerDialog.java
    package.html
  editors/
    assis/
    ISQLSyntax.java
    JdbcSQLContentAssistProcessor.java
    JdbcSQLSourceViewerConfiguration.java
    SQLCommentScanner.java
    SQLDataSetEditorPage.java
    SQLKeywordRule.java
    SQLKeywordScanner.java
    SQLPartitionScanner.java
    SQLSourceViewerConfiguration.java
    SQLUtility.java
    TextMenuManager.java
    package.html
  icons/
    column.gif
    create_datasource_wizard.gif
    create_join_wizard.gif
    data_set.gif
    data_source.gif
    schema.gif
    select_columns_wizard.gif
    table.gif
    view.gif
  joins/
    command/
    dnd/
    editparts/
    figures/
      images/
    util/
  model/
    activity/
  nls/
    JdbcPluginResources.properties
  preference/
    externaleditor/
    DateSetPreferencePage.java
    package.html
  profile/
    JDBCPropertyPage.java
    JDBCSelectionPageHelper.java
    JDBCSelectionWizardPage.java
    package.html
  provider/
    IMetaDataProvider.java
    JdbcMetaDataProvider.java
    package.html
  util/
    ColorManager.java
    Column.java
    ConnectionMetaData.java
    ConnectionMetaDataManager.java
    Constants.java
    DEUtil.java
    DbObject.java
    DriverExt.java
    DriverInfo.java
    DriverLoader.java
    ExceptionDialog.java
    ExceptionHandler.java
    IHelpConstants.java
    JDBCDriverInfoManager.java
    JDBCDriverInformation.java
    JarFile.java
    JdbcDriverConfigUtil.java
    JdbcToolKit.java
    Procedure.java
    ProcedureParameter.java
    Schema.java
    Table.java
    Utility.java
    package.html
  wizards/
  JdbcPlugin.java