cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r688330 - in /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode: AdapterEditor.java MainDataNodeEditor.java PasswordEncoderEditor.java
Date Sat, 23 Aug 2008 14:14:48 GMT
Author: aadamchik
Date: Sat Aug 23 07:14:47 2008
New Revision: 688330

URL: http://svn.apache.org/viewvc?rev=688330&view=rev
Log:
CAY-1094 CM DataNode panel reorg - pull the password encoding options into a tab
(second patch by Dima Loiko)

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java?rev=688330&r1=688329&r2=688330&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java
Sat Aug 23 07:14:47 2008
@@ -61,7 +61,7 @@
                 view.getCustomAdapter(),
                 "adapterName");
 
-        // init listeners
+        // init listenersК
         ((ProjectController) getParent())
                 .addDataNodeDisplayListener(new DataNodeDisplayListener() {
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java?rev=688330&r1=688329&r2=688330&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java
Sat Aug 23 07:14:47 2008
@@ -299,6 +299,7 @@
             else {
                 // special case - no detail view, just show it and bail..
                 defaultSubeditor.setNode(node);
+                disabledTab("default");
                 view.getDataSourceDetailLayout().show(
                         view.getDataSourceDetail(),
                         "default");
@@ -325,10 +326,7 @@
         if(name.equals(standardDataSourceFactories[0])){
             tabbedPaneController.getTabComponent().setEnabledAt(2, true);
         }
-        else if(name.equals(standardDataSourceFactories[1])){
-            tabbedPaneController.getTabComponent().setEnabledAt(2, false);
-        }
-        if(name.equals(standardDataSourceFactories[2])){
+        else{
             tabbedPaneController.getTabComponent().setEnabledAt(2, false);
         }
         

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java?rev=688330&r1=688329&r2=688330&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java
Sat Aug 23 07:14:47 2008
@@ -26,12 +26,14 @@
 
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.conn.DataSourceInfo;
+import org.apache.cayenne.map.event.DataNodeEvent;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.event.DataNodeDisplayEvent;
 import org.apache.cayenne.modeler.event.DataNodeDisplayListener;
 import org.apache.cayenne.modeler.util.CayenneController;
 import org.apache.cayenne.project.ProjectDataSource;
 import org.apache.cayenne.swing.BindingBuilder;
+import org.apache.cayenne.swing.BindingDelegate;
 import org.apache.cayenne.swing.ObjectBinding;
 
 
@@ -40,12 +42,26 @@
     protected DataNode node;
     protected ObjectBinding[] bindings;
     protected PasswordEncoderView view;
+    protected BindingDelegate nodeChangeProcessor;
     
     public PasswordEncoderEditor(CayenneController parent){
 
         super(parent);
         
         this.view = new PasswordEncoderView();
+        
+        this.nodeChangeProcessor = new BindingDelegate() {
+
+            public void modelUpdated(
+                    ObjectBinding binding,
+                    Object oldValue,
+                    Object newValue) {
+
+                DataNodeEvent e = new DataNodeEvent(PasswordEncoderEditor.this, node);
+                ((ProjectController) getParent()).fireDataNodeEvent(e);
+            }
+        };
+                
         initController();
     }
     
@@ -53,7 +69,9 @@
         BindingBuilder builder = new BindingBuilder(
                 getApplication().getBindingFactory(),
                 this);
-
+        
+        builder.setDelegate(nodeChangeProcessor);
+        
         bindings = new ObjectBinding[4];
         
         bindings[0] =
@@ -80,6 +98,8 @@
                           .getCurrentDataNode());
               }
           });
+          
+          
       
         builder.bindToAction(view.getPasswordEncoder(),  "validatePasswordEncoderAction()");
         builder.bindToAction(view.getPasswordLocation(), "passwordLocationChangedAction()");
@@ -97,6 +117,8 @@
         for (int i = 0; i < bindings.length; i++) {
             bindings[i].updateView();
         }
+
+        
         
     }
     
@@ -128,6 +150,8 @@
         view.getPasswordSource().setEnabled(isPasswordLocationEnabled);
         view.getPasswordSourceLabel().setText(passwordLocationLabel);
         view.getPasswordSource().setText(passwordLocationText);
+        
+
     }
     
     public void passwordLocationChangedAction()



Mime
View raw message