From: <wes...@us...> - 2013-03-10 12:33:47
|
Revision: 1175 http://jmoney.svn.sourceforge.net/jmoney/?rev=1175&view=rev Author: westbury Date: 2013-03-10 12:33:38 +0000 (Sun, 10 Mar 2013) Log Message: ----------- rename StockPlugin, which is completely wrong, to the more conventional name of Activator Modified Paths: -------------- trunk/net.sf.jmoney.property/META-INF/MANIFEST.MF trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/IStockHelpContextIds.java trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyAccountInfo.java trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyInfo.java Added Paths: ----------- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/Activator.java Removed Paths: ------------- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/StocksPlugin.java Modified: trunk/net.sf.jmoney.property/META-INF/MANIFEST.MF =================================================================== --- trunk/net.sf.jmoney.property/META-INF/MANIFEST.MF 2013-02-21 08:51:07 UTC (rev 1174) +++ trunk/net.sf.jmoney.property/META-INF/MANIFEST.MF 2013-03-10 12:33:38 UTC (rev 1175) @@ -3,7 +3,7 @@ Bundle-Name: JMoney Real Property Plug-in Bundle-SymbolicName: net.sf.jmoney.property;singleton:=true Bundle-Version: 1.0.0 -Bundle-Activator: net.sf.jmoney.property.StocksPlugin +Bundle-Activator: net.sf.jmoney.property.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, Copied: trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/Activator.java (from rev 1174, trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/StocksPlugin.java) =================================================================== --- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/Activator.java (rev 0) +++ trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/Activator.java 2013-03-10 12:33:38 UTC (rev 1175) @@ -0,0 +1,75 @@ +package net.sf.jmoney.property; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The main plugin class to be used in the desktop. + */ +public class Activator extends AbstractUIPlugin { + public static final String PLUGIN_ID = "net.sf.jmoney.property"; + + //The shared instance. + private static Activator plugin; + //Resource bundle. + private ResourceBundle resourceBundle; + + /** + * The constructor. + */ + public Activator() { + super(); + plugin = this; + try { + resourceBundle = ResourceBundle.getBundle("net.sf.jmoney.property.Language"); + } catch (MissingResourceException x) { + resourceBundle = null; + } + } + + /** + * This method is called upon plug-in activation + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + } + + /** + * This method is called when the plug-in is stopped + */ + @Override + public void stop(BundleContext context) throws Exception { + super.stop(context); + } + + /** + * Returns the shared instance. + */ + public static Activator 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 = Activator.getDefault().getResourceBundle(); + try { + return (bundle != null) ? bundle.getString(key) : key; + } catch (MissingResourceException e) { + return key; + } + } + + /** + * Returns the plugin's resource bundle, + */ + public ResourceBundle getResourceBundle() { + return resourceBundle; + } +} Modified: trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/IStockHelpContextIds.java =================================================================== --- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/IStockHelpContextIds.java 2013-02-21 08:51:07 UTC (rev 1174) +++ trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/IStockHelpContextIds.java 2013-03-10 12:33:38 UTC (rev 1175) @@ -27,7 +27,7 @@ * Help context ids for the stocks plug-in. */ public interface IStockHelpContextIds { - public static final String PREFIX = StocksPlugin.PLUGIN_ID + "."; //$NON-NLS-1$ + public static final String PREFIX = Activator.PLUGIN_ID + "."; //$NON-NLS-1$ // Actions Deleted: trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/StocksPlugin.java =================================================================== --- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/StocksPlugin.java 2013-02-21 08:51:07 UTC (rev 1174) +++ trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/StocksPlugin.java 2013-03-10 12:33:38 UTC (rev 1175) @@ -1,75 +0,0 @@ -package net.sf.jmoney.property; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class StocksPlugin extends AbstractUIPlugin { - public static final String PLUGIN_ID = "net.sf.jmoney.property"; - - //The shared instance. - private static StocksPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - /** - * The constructor. - */ - public StocksPlugin() { - super(); - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle("net.sf.jmoney.property.Language"); - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * This method is called upon plug-in activation - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - } - - /** - * Returns the shared instance. - */ - public static StocksPlugin 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 = StocksPlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } -} Modified: trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyAccountInfo.java =================================================================== --- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyAccountInfo.java 2013-02-21 08:51:07 UTC (rev 1174) +++ trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyAccountInfo.java 2013-03-10 12:33:38 UTC (rev 1175) @@ -35,7 +35,7 @@ import net.sf.jmoney.model2.IReferenceControlFactory; import net.sf.jmoney.model2.PropertySet; import net.sf.jmoney.model2.ReferencePropertyAccessor; -import net.sf.jmoney.property.StocksPlugin; +import net.sf.jmoney.property.Activator; /** * This class implements an extension to the net.sf.jmoney.fields @@ -79,7 +79,7 @@ } }; - currencyAccessor = propertySet.addProperty("currency", StocksPlugin.getResourceString("PropertyDesc.currency"), Currency.class, 2, 20, currencyControlFactory, null); + currencyAccessor = propertySet.addProperty("currency", Activator.getResourceString("PropertyDesc.currency"), Currency.class, 2, 20, currencyControlFactory, null); return propertySet; } Modified: trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyInfo.java =================================================================== --- trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyInfo.java 2013-02-21 08:51:07 UTC (rev 1174) +++ trunk/net.sf.jmoney.property/src/net/sf/jmoney/property/model/RealPropertyInfo.java 2013-03-10 12:33:38 UTC (rev 1175) @@ -35,7 +35,7 @@ import net.sf.jmoney.model2.IncomeExpenseAccount; import net.sf.jmoney.model2.PropertySet; import net.sf.jmoney.model2.ReferencePropertyAccessor; -import net.sf.jmoney.property.StocksPlugin; +import net.sf.jmoney.property.Activator; /** * The class descriptor for the RealProperty class. @@ -72,7 +72,7 @@ } }; - rentalIncomeAccountAccessor = propertySet.addProperty("rentalIncomeAccount", StocksPlugin.getResourceString("PropertyDesc.dividendAccount"), IncomeExpenseAccount.class, 2, 80, rentalIncomeAccountControlFactory, null); + rentalIncomeAccountAccessor = propertySet.addProperty("rentalIncomeAccount", Activator.getResourceString("PropertyDesc.dividendAccount"), IncomeExpenseAccount.class, 2, 80, rentalIncomeAccountControlFactory, null); return propertySet; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |