cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torehal...@apache.org
Subject svn commit: r783250 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/
Date Wed, 10 Jun 2009 08:22:27 GMT
Author: torehalset
Date: Wed Jun 10 08:22:27 2009
New Revision: 783250

URL: http://svn.apache.org/viewvc?rev=783250&view=rev
Log:
CAY-1169 Weird behavior when adding entity via merging
 * added button to reverse all merge tokens
 * included in RELEASE-NOTES

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorView.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=783250&r1=783249&r2=783250&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Wed Jun 10 08:22:27 2009
@@ -17,8 +17,9 @@
 CAY-1225 Controlling JDBC Driver setting "fetchSize" in a SelectQuery
 CAY-1236 Allow providing custom INSERT, UPDATE, DELETE query builders
 
-Bug Fixes Since M5:
+Bug Fixes Since M6:
 
+CAY-1169 Weird behavior when adding entity via merging
 CAY-1224 reverse engineering partially changed schema shows empty error messge window
 
 ----------------------------------

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java?rev=783250&r1=783249&r2=783250&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
Wed Jun 10 08:22:27 2009
@@ -152,6 +152,7 @@
                 this);
 
         builder.bindToAction(view.getCheckAll(), "checkAllAction()");
+        builder.bindToAction(view.getReverseAll(), "reverseAllAction()");
 
         TableModel model = new MergerTokenTableModel(this);
 
@@ -221,4 +222,18 @@
         model.fireTableDataChanged();
     }
 
+    public void reverseAllAction() {
+        
+        for (int i = 0; i < selectableTokensList.size(); i++) {
+            MergerToken token = selectableTokensList.get(i);
+            MergerToken reverse = token.createReverse(mergerFactory);
+            selectableTokensList.set(i, reverse);
+            if (excludedTokens.remove(token)) {
+                excludedTokens.add(reverse);
+            }
+        }
+
+        AbstractTableModel model = (AbstractTableModel) view.getTokens().getModel();
+        model.fireTableDataChanged();
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorView.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorView.java?rev=783250&r1=783249&r2=783250&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorView.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorView.java
Wed Jun 10 08:22:27 2009
@@ -24,6 +24,7 @@
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 
+import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
@@ -31,6 +32,7 @@
 import javax.swing.JTable;
 
 import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.factories.ButtonBarFactory;
 import com.jgoodies.forms.layout.CellConstraints;
 import com.jgoodies.forms.layout.FormLayout;
 
@@ -41,11 +43,13 @@
     protected JTable tokens;
     protected JCheckBox checkAll;
     protected JLabel checkAllLabel;
+    protected JButton reverseAll;
 
     public MergerTokenSelectorView() {
 
         this.checkAll = new JCheckBox();
         this.checkAllLabel = new JLabel("Check All Operations");
+        this.reverseAll = new JButton("Reverse All Operations");
 
         checkAll.addItemListener(new ItemListener() {
 
@@ -60,9 +64,13 @@
         });
 
         // assemble
-        JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
-        topPanel.add(checkAll);
-        topPanel.add(checkAllLabel);
+        JPanel checkAllPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
+        checkAllPanel.add(checkAll);
+        checkAllPanel.add(checkAllLabel);
+        JPanel topPanel = new JPanel();
+        topPanel.setLayout(new BorderLayout());
+        topPanel.add(checkAllPanel, BorderLayout.WEST);
+        topPanel.add(ButtonBarFactory.buildRightAlignedBar(reverseAll), BorderLayout.EAST);
 
         tokens = new JTable();
         tokens.setRowHeight(25);
@@ -91,4 +99,8 @@
     public JCheckBox getCheckAll() {
         return checkAll;
     }
+    
+    public JButton getReverseAll() {
+        return reverseAll;
+    }
 }



Mime
View raw message