cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r921836 - in /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler: CodeTemplateManager.java dialog/pref/TemplateCreator.java dialog/pref/TemplatePreferences.java
Date Thu, 11 Mar 2010 13:21:09 GMT
Author: oltka
Date: Thu Mar 11 13:21:09 2010
New Revision: 921836

URL: http://svn.apache.org/viewvc?rev=921836&view=rev
Log:
CAY-1327 Migrate HSQLDB modeler preferences to Java preferences API

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CodeTemplateManager.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreator.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplatePreferences.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CodeTemplateManager.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CodeTemplateManager.java?rev=921836&r1=921835&r2=921836&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CodeTemplateManager.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CodeTemplateManager.java
Thu Mar 11 13:21:09 2010
@@ -44,6 +44,8 @@ public class CodeTemplateManager {
 
     static final String LIGHT_SERVER_SUPERCLASS = "Light Server Superclass";
 
+    public static final String NODE_NAME = "codeTemplateManager";
+    
     protected List<String> standardSubclassTemplates;
     protected List<String> standardSuperclassTemplates;
     protected Map<String, String> customTemplates;
@@ -51,8 +53,8 @@ public class CodeTemplateManager {
 
     private static Log logger = LogFactory.getLog(CodeTemplateManager.class);
 
-    public static Preferences getTemplatePreferences(Application application) {
-        return application.getMainPreferenceForProject().node("CodeTemplateManager");
+    public Preferences getTemplatePreferences(Application application) {
+        return application.getPreferencesNode(this.getClass(), NODE_NAME);
     }
 
     public CodeTemplateManager(Application application) {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreator.java?rev=921836&r1=921835&r2=921836&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreator.java
Thu Mar 11 13:21:09 2010
@@ -31,6 +31,7 @@ import javax.swing.JDialog;
 import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 
+import org.apache.cayenne.modeler.CodeTemplateManager;
 import org.apache.cayenne.modeler.pref.FSPath;
 import org.apache.cayenne.modeler.util.CayenneController;
 import org.apache.cayenne.pref.CayennePreferenceEditor;
@@ -74,11 +75,8 @@ public class TemplateCreator extends Cay
     FSPath getLastTemplateDirectory() {
         // find start directory in preferences
 
-        FSPath path = (FSPath) application
-                .getCayenneProjectPreferences()
-                .getProjectDetailObject(
-                        FSPath.class,
-                        getViewPreferences().node("lastTemplate"));
+        FSPath path = new FSPath(application.getPreferencesNode(
+                CodeTemplateManager.class, "lastTemplate"));
 
         if (path.getPath() == null) {
             path.setPath(getLastDirectory().getPath());

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplatePreferences.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplatePreferences.java?rev=921836&r1=921835&r2=921836&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplatePreferences.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplatePreferences.java
Thu Mar 11 13:21:09 2010
@@ -79,9 +79,7 @@ public class TemplatePreferences extends
     }
 
     protected Preferences getTemplatePreferences() {
-        Preferences preferences = CodeTemplateManager
-                .getTemplatePreferences(getApplication());
-        return preferences;
+        return application.getPreferencesNode(CodeTemplateManager.class, CodeTemplateManager.NODE_NAME);
     }
 
     protected void initBindings() {



Mime
View raw message