Revision: 6105
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6105&view=rev
Author: manningr
Date: 2011-01-02 22:21:17 +0000 (Sun, 02 Jan 2011)
Log Message:
-----------
Factory interface and implementation for creating IResources (PluginResources) implementations that can be mocked for testing.
Added Paths:
-----------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/IPluginResourcesFactory.java
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/PluginResourcesFactory.java
Added: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/IPluginResourcesFactory.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/IPluginResourcesFactory.java (rev 0)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/IPluginResourcesFactory.java 2011-01-02 22:21:17 UTC (rev 6105)
@@ -0,0 +1,27 @@
+package net.sourceforge.squirrel_sql.client.plugin;
+
+import net.sourceforge.squirrel_sql.fw.util.IResources;
+
+/*
+ * Copyright (C) 2011 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+public interface IPluginResourcesFactory
+{
+ IResources createResource(String rsrcBundleBaseName, IPlugin plugin);
+}
Added: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/PluginResourcesFactory.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/PluginResourcesFactory.java (rev 0)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/plugin/PluginResourcesFactory.java 2011-01-02 22:21:17 UTC (rev 6105)
@@ -0,0 +1,33 @@
+package net.sourceforge.squirrel_sql.client.plugin;
+
+import net.sourceforge.squirrel_sql.fw.util.IResources;
+
+/*
+ * Copyright (C) 2011 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+public class PluginResourcesFactory implements IPluginResourcesFactory
+{
+
+ @Override
+ public IResources createResource(String rsrcBundleBaseName, IPlugin plugin)
+ {
+ return new PluginResources(rsrcBundleBaseName, plugin);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|