cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r404799 - in /incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen: CustomModeController.java CustomModePanel.java
Date Sun, 07 May 2006 17:05:13 GMT
Author: aadamchik
Date: Sun May  7 10:05:12 2006
New Revision: 404799

URL: http://svn.apache.org/viewcvs?rev=404799&view=rev
Log:
advanced class gen options

Modified:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModeController.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModePanel.java

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModeController.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModeController.java?rev=404799&r1=404798&r2=404799&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModeController.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModeController.java
Sun May  7 10:05:12 2006
@@ -143,6 +143,10 @@
             preferences.setBooleanProperty("usePackagePath", true);
         }
 
+        if (Util.isEmptyString(preferences.getProperty("outputPattern"))) {
+            preferences.setProperty("outputPattern", "*.java");
+        }
+
         BindingBuilder builder = new BindingBuilder(
                 getApplication().getBindingFactory(),
                 this);
@@ -182,6 +186,10 @@
                 view.getSuperclassTemplate(),
                 "preferences.superclassTemplate");
 
+        builder.bindToTextField(
+                view.getOutputPattern(),
+                "preferences.property['outputPattern']").updateView();
+
         updateTemplates();
     }
 
@@ -261,6 +269,10 @@
         generator.setOverwrite(view.getOverwrite().isSelected());
         generator.setUsePkgPath(view.getUsePackagePath().isSelected());
         generator.setMakePairs(view.getPairs().isSelected());
+
+        if (!Util.isEmptyString(view.getOutputPattern().getText())) {
+            generator.setOutputPattern(view.getOutputPattern().getText());
+        }
 
         return generator;
     }

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModePanel.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModePanel.java?rev=404799&r1=404798&r2=404799&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModePanel.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/codegen/CustomModePanel.java
Sun May  7 10:05:12 2006
@@ -61,6 +61,7 @@
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JPanel;
+import javax.swing.JTextField;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -79,6 +80,7 @@
     protected JComboBox generatorVersion;
     protected JCheckBox overwrite;
     protected JCheckBox usePackagePath;
+    protected JTextField outputPattern;
 
     protected ActionLink manageTemplatesLink;
 
@@ -91,6 +93,7 @@
         this.generatorVersion = new JComboBox();
         this.overwrite = new JCheckBox();
         this.usePackagePath = new JCheckBox();
+        this.outputPattern = new JTextField();
         this.manageTemplatesLink = new ActionLink("Customize Templates...");
         manageTemplatesLink.setFont(manageTemplatesLink.getFont().deriveFont(10f));
 
@@ -106,7 +109,7 @@
         PanelBuilder builder = new PanelBuilder(
                 new FormLayout(
                         "right:70dlu, 3dlu, 150dlu, 3dlu, pref",
-                        "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p,
3dlu, p"));
+                        "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p,
3dlu, p, 3dlu, p"));
         builder.setDefaultDialogBorder();
 
         CellConstraints cc = new CellConstraints();
@@ -130,14 +133,17 @@
         builder.addLabel("Superclass Template:", cc.xy(1, 11));
         builder.add(superclassTemplate, cc.xy(3, 11));
 
-        builder.addLabel("Make Pairs:", cc.xy(1, 13));
-        builder.add(pairs, cc.xy(3, 13));
+        builder.addLabel("Output Pattern:", cc.xy(1, 13));
+        builder.add(outputPattern, cc.xy(3, 13));
 
-        builder.addLabel("Overwrite Subclasses:", cc.xy(1, 15));
-        builder.add(overwrite, cc.xy(3, 15));
+        builder.addLabel("Make Pairs:", cc.xy(1, 15));
+        builder.add(pairs, cc.xy(3, 15));
 
-        builder.addLabel("Use Package Path:", cc.xy(1, 17));
-        builder.add(usePackagePath, cc.xy(3, 17));
+        builder.addLabel("Overwrite Subclasses:", cc.xy(1, 17));
+        builder.add(overwrite, cc.xy(3, 17));
+
+        builder.addLabel("Use Package Path:", cc.xy(1, 19));
+        builder.add(usePackagePath, cc.xy(3, 19));
 
         JPanel links = new JPanel(new FlowLayout(FlowLayout.TRAILING));
         links.add(manageTemplatesLink);
@@ -177,5 +183,10 @@
 
     public JCheckBox getUsePackagePath() {
         return usePackagePath;
+    }
+
+    
+    public JTextField getOutputPattern() {
+        return outputPattern;
     }
 }



Mime
View raw message