cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [1/2] cayenne git commit: CAY-2474 Modeler: swap buttons in dialog toolbar
Date Wed, 19 Sep 2018 06:49:49 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 6221d5ec6 -> ad4d2006a


CAY-2474 Modeler: swap buttons in dialog toolbar


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/d9f208fe
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/d9f208fe
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/d9f208fe

Branch: refs/heads/master
Commit: d9f208fe8d533443413fea5708807553900c98f2
Parents: 6221d5e
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Thu Sep 13 16:10:18 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Thu Sep 13 16:24:20 2018 +0300

----------------------------------------------------------------------
 RELEASE-NOTES.txt                               |  1 +
 .../modeler/dialog/ErrorDebugDialog.java        | 39 ++++++++++----------
 .../cayenne/modeler/dialog/FindDialogView.java  |  1 +
 .../dialog/ResolveDbRelationshipDialog.java     |  2 +
 .../dialog/ValidationResultBrowserView.java     |  2 +
 .../InferRelationshipsDialog.java               | 15 ++++----
 .../dialog/datamap/DefaultsPreferencesView.java | 14 +++----
 .../dialog/datamap/LockingUpdateView.java       | 17 +++++----
 .../modeler/dialog/db/DataSourceWizardView.java |  2 +
 .../dialog/db/DbActionOptionsDialog.java        | 21 ++++++-----
 .../dialog/db/load/DbLoadResultDialog.java      |  2 +
 .../dialog/db/merge/MergerOptionsView.java      | 25 ++++++-------
 .../dialog/objentity/ClassNameUpdaterView.java  | 12 +++---
 .../objentity/DbRelationshipTargetView.java     | 22 +++++------
 .../dialog/objentity/EntitySyncDialog.java      | 15 ++++----
 .../objentity/ObjAttributeInfoDialog.java       |  6 +--
 .../objentity/ObjAttributeInfoDialogView.java   |  3 +-
 .../objentity/ObjRelationshipInfoView.java      | 27 +++++++-------
 .../dialog/pref/DataSourceCreatorView.java      | 11 +++---
 .../dialog/pref/DataSourceDuplicatorView.java   | 11 +++---
 .../dialog/pref/PreferenceDialogView.java       | 20 +++++-----
 .../dialog/pref/TemplateCreatorView.java        | 16 ++++----
 .../modeler/dialog/query/QueryTypeView.java     | 18 ++++-----
 .../validator/DuplicatedAttributesDialog.java   | 38 +++++++++----------
 .../dialog/validator/ValidatorDialog.java       |  4 +-
 .../modeler/util/MultiColumnBrowser.java        | 19 +++++-----
 .../cayenne/modeler/util/ProgressDialog.java    | 14 +++----
 27 files changed, 198 insertions(+), 179 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index ab0495d..e3b3898 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -17,6 +17,7 @@ CAY-2446 Run Disjoint By Id queries outside of synchronized block
 CAY-2447 Crypto support for LocalDateTime
 CAY-2471 Support multiple XML project versions
 CAY-2473 Modeler: cleanup attributes and relationship editors
+CAY-2474 Modeler: swap buttons in dialog toolbar
 
 Bug Fixes:
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ErrorDebugDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ErrorDebugDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ErrorDebugDialog.java
index ef57323..1565e4b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ErrorDebugDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ErrorDebugDialog.java
@@ -20,6 +20,23 @@
 
 package org.apache.cayenne.modeler.dialog;
 
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.CayenneModelerFrame;
+import org.apache.cayenne.modeler.util.CayenneDialog;
+import org.apache.cayenne.modeler.util.ModelerUtil;
+import org.apache.cayenne.modeler.util.PanelFactory;
+import org.apache.cayenne.util.LocalizedStringsHandler;
+import org.apache.cayenne.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
 import java.awt.BorderLayout;
 import java.awt.Container;
 import java.awt.HeadlessException;
@@ -31,24 +48,6 @@ import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JEditorPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.ScrollPaneConstants;
-
-import org.apache.cayenne.modeler.Application;
-import org.apache.cayenne.modeler.CayenneModelerFrame;
-import org.apache.cayenne.modeler.util.CayenneDialog;
-import org.apache.cayenne.modeler.util.ModelerUtil;
-import org.apache.cayenne.modeler.util.PanelFactory;
-import org.apache.cayenne.util.LocalizedStringsHandler;
-import org.apache.cayenne.util.Util;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * Displays CayenneModeler exceptions and warning messages.
  * 
@@ -184,7 +183,9 @@ public class ErrorDebugDialog extends CayenneDialog implements ActionListener {
         close = new JButton("Close");
         close.addActionListener(this);
 
-        JButton[] buttons = (showHide != null) ? new JButton[] { showHide, close }
+        getRootPane().setDefaultButton(showHide);
+
+        JButton[] buttons = (showHide != null) ? new JButton[] { close, showHide }
         : new JButton[] { close };
         pane.add(PanelFactory.createButtonPanel(buttons), BorderLayout.SOUTH);
         

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/FindDialogView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/FindDialogView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/FindDialogView.java
index 45b1b93..0758abc 100755
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/FindDialogView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/FindDialogView.java
@@ -74,6 +74,7 @@ public class FindDialogView extends JDialog {
 
         JPanel okPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         okButton = new JButton("OK");
+        getRootPane().setDefaultButton(okButton);
         okPanel.setBorder(TopBorder.create());
         okPanel.add(okButton);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ResolveDbRelationshipDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ResolveDbRelationshipDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ResolveDbRelationshipDialog.java
index c3a8dac..04753f8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ResolveDbRelationshipDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ResolveDbRelationshipDialog.java
@@ -139,6 +139,8 @@ public class ResolveDbRelationshipDialog extends CayenneDialog {
         table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         tablePreferences = new TableColumnPreferences(getClass(), "dbentity/dbjoinTable");
 
+        getRootPane().setDefaultButton(saveButton);
+
         // assemble
         getContentPane().setLayout(new BorderLayout());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ValidationResultBrowserView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ValidationResultBrowserView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ValidationResultBrowserView.java
index 6c143d6..3bd28c0 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ValidationResultBrowserView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/ValidationResultBrowserView.java
@@ -69,6 +69,8 @@ public class ValidationResultBrowserView extends JDialog {
                 ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                 ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), cc.xy(1, 5));
 
+        getRootPane().setDefaultButton(closeButton);
+
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         buttons.add(closeButton);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsDialog.java
index d468bd9..6cde28c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsDialog.java
@@ -18,10 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.autorelationship;
 
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FlowLayout;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.util.NameGeneratorPreferences;
 
 import javax.swing.Box;
 import javax.swing.DefaultComboBoxModel;
@@ -30,9 +28,10 @@ import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-
-import org.apache.cayenne.modeler.Application;
-import org.apache.cayenne.modeler.util.NameGeneratorPreferences;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FlowLayout;
 
 public class InferRelationshipsDialog extends JDialog {
     public static final int SELECT = 1;
@@ -53,6 +52,8 @@ public class InferRelationshipsDialog extends JDialog {
         this.entityCount = new JLabel("No DbRelationships selected");
         entityCount.setFont(entityCount.getFont().deriveFont(10f));
 
+        getRootPane().setDefaultButton(generateButton);
+
         this.strategyCombo = new JComboBox();
         strategyCombo.setEditable(true);
         this.strategyLabel = new JLabel("Naming Strategy:  ");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/DefaultsPreferencesView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/DefaultsPreferencesView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/DefaultsPreferencesView.java
index 5f1d954..6118d6d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/DefaultsPreferencesView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/DefaultsPreferencesView.java
@@ -19,18 +19,17 @@
 
 package org.apache.cayenne.modeler.dialog.datamap;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
 
 /**
  */
@@ -59,10 +58,11 @@ public class DefaultsPreferencesView extends JDialog {
         updateButton = new JButton("Update");
         cancelButton = new JButton("Cancel");
 
+        getRootPane().setDefaultButton(updateButton);
         // assemble
         JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-        buttonPanel.add(updateButton);
         buttonPanel.add(cancelButton);
+        buttonPanel.add(updateButton);
 
         CellConstraints cc = new CellConstraints();
         FormLayout layout = new FormLayout("left:max(180dlu;pref)", "p, 3dlu, p, 3dlu");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/LockingUpdateView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/LockingUpdateView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/LockingUpdateView.java
index aa08716..960f116 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/LockingUpdateView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/LockingUpdateView.java
@@ -19,18 +19,17 @@
 
 package org.apache.cayenne.modeler.dialog.datamap;
 
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.FlowLayout;
 
 public class LockingUpdateView extends JDialog {
 
@@ -68,9 +67,11 @@ public class LockingUpdateView extends JDialog {
         builder.add(attributes, cc.xy(1, 3));
         builder.add(relationships, cc.xy(1, 5));
 
+        getRootPane().setDefaultButton(updateButton);
+
         JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-        buttonPanel.add(updateButton);
         buttonPanel.add(cancelButton);
+        buttonPanel.add(updateButton);
 
         Container contentPane = getContentPane();
         contentPane.setLayout(new BorderLayout());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizardView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizardView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizardView.java
index 553b2ab..129ffa4 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizardView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizardView.java
@@ -53,6 +53,8 @@ public class DataSourceWizardView extends JDialog {
         this.cancelButton = new JButton(labels[CANCEL_BUTTON_INDEX]);
         this.connectionInfo = new DBConnectionInfoEditor(controller);
 
+        getRootPane().setDefaultButton(okButton);
+
         CellConstraints cc = new CellConstraints();
         PanelBuilder builder = new PanelBuilder(new FormLayout(
                 "20dlu:grow, pref, 3dlu, fill:max(150dlu;pref), 3dlu, fill:20dlu",

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
index a43c679..04e29f2 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
@@ -19,11 +19,9 @@
 
 package org.apache.cayenne.modeler.dialog.db;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
-import java.awt.Frame;
-import java.awt.HeadlessException;
-import java.util.Collection;
+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.modeler.util.CayenneDialog;
 
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JButton;
@@ -31,10 +29,11 @@ import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
-import org.apache.cayenne.modeler.util.CayenneDialog;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.HeadlessException;
+import java.util.Collection;
 
 /**
  * @since 4.0
@@ -73,6 +72,8 @@ public class DbActionOptionsDialog extends CayenneDialog {
         catalogSelector = new JComboBox<>();
         schemaSelector = new JComboBox<>();
 
+        getRootPane().setDefaultButton(selectButton);
+
         FormLayout layout = new FormLayout(
                 "right:pref, 3dlu, fill:max(170dlu;pref):grow",
                 "");
@@ -81,8 +82,8 @@ public class DbActionOptionsDialog extends CayenneDialog {
 
         buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         initForm(builder);
-        buttons.add(selectButton);
         buttons.add(cancelButton);
+        buttons.add(selectButton);
 
         getContentPane().setLayout(new BorderLayout());
         getContentPane().add(builder.getPanel(), BorderLayout.CENTER);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
index 9982634..9d44bf5 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
@@ -78,6 +78,8 @@ public class DbLoadResultDialog extends JDialog {
     }
 
     private void buildElements() {
+        getRootPane().setDefaultButton(okButton);
+
         FormLayout layout = new FormLayout("fill:200dlu");
         DefaultFormBuilder builder = new DefaultFormBuilder(layout);
         builder.append(new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerOptionsView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerOptionsView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerOptionsView.java
index 39e50b3..6eb767f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerOptionsView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerOptionsView.java
@@ -19,11 +19,12 @@
 
 package org.apache.cayenne.modeler.dialog.db.merge;
 
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.factories.Borders;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.swing.components.TopBorder;
 
 import javax.swing.BorderFactory;
 import javax.swing.Box;
@@ -36,14 +37,11 @@ import javax.swing.JTextArea;
 import javax.swing.ScrollPaneConstants;
 import javax.swing.SwingConstants;
 import javax.swing.UIManager;
-
-import com.jgoodies.forms.factories.Borders;
-import org.apache.cayenne.modeler.Application;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
-import org.apache.cayenne.swing.components.TopBorder;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
 
 /**
  * Wizard for altering the database to match the data map.
@@ -75,6 +73,7 @@ public class MergerOptionsView extends JDialog {
         sql.setLineWrap(true);
         sql.setWrapStyleWord(true);
 
+        getRootPane().setDefaultButton(generateButton);
         JPanel sqlTextPanel = new JPanel(new BorderLayout());
         sqlTextPanel.add(new JScrollPane(
                 sql,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdaterView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdaterView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdaterView.java
index b282899..72ee7a6 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdaterView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdaterView.java
@@ -20,17 +20,16 @@
 
 package org.apache.cayenne.modeler.dialog.objentity;
 
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.FlowLayout;
 
 public class ClassNameUpdaterView extends JDialog {
 
@@ -52,6 +51,7 @@ public class ClassNameUpdaterView extends JDialog {
         updateButton = new JButton("Update");
         cancelButton = new JButton("Cancel");
 
+        getRootPane().setDefaultButton(updateButton);
         // assemble
 
         FormLayout layout = new FormLayout("left:200dlu", "");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/DbRelationshipTargetView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/DbRelationshipTargetView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/DbRelationshipTargetView.java
index 7f9c302..68c8c23 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/DbRelationshipTargetView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/DbRelationshipTargetView.java
@@ -18,7 +18,13 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.objentity;
 
-import java.awt.BorderLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.modeler.util.DefaultWidgetFactory;
+import org.apache.cayenne.modeler.util.PanelFactory;
+import org.apache.cayenne.modeler.util.WidgetFactory;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JButton;
@@ -26,15 +32,7 @@ import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JRadioButton;
-
-import org.apache.cayenne.map.DbEntity;
-import org.apache.cayenne.modeler.util.DefaultWidgetFactory;
-import org.apache.cayenne.modeler.util.PanelFactory;
-import org.apache.cayenne.modeler.util.WidgetFactory;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
 
 public class DbRelationshipTargetView extends JDialog {
     
@@ -63,7 +61,9 @@ public class DbRelationshipTargetView extends JDialog {
         source1Button = new JRadioButton();
         source2Button = new JRadioButton();
         source2Button.setEnabled(source2 != null);
-        
+
+        getRootPane().setDefaultButton(saveButton);
+
         ButtonGroup bg = new ButtonGroup();
         bg.add(source1Button);
         bg.add(source2Button);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncDialog.java
index 6799235..bd06cde 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncDialog.java
@@ -19,19 +19,18 @@
 
 package org.apache.cayenne.modeler.dialog.objentity;
 
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.FlowLayout;
 
 public class EntitySyncDialog extends JDialog {
 
@@ -47,6 +46,8 @@ public class EntitySyncDialog extends JDialog {
         updateButton = new JButton("Continue");
         cancelButton = new JButton("Cancel");
 
+        getRootPane().setDefaultButton(updateButton);
+
         // assemble
 
         FormLayout layout = new FormLayout("pref, 3dlu, pref", "p, 3dlu");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java
index 44ae3ca..c63fafc 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java
@@ -351,8 +351,8 @@ public class ObjAttributeInfoDialog extends CayenneController implements TreeSel
 
 			StringBuilder attributePath = new StringBuilder();
 			StringBuilder pathStr = new StringBuilder();
-			if (attribute.getEntity().getDbEntity() != null) {
-				TreePath path = view.getPathBrowser().getSelectionPath();
+			TreePath path = view.getPathBrowser().getSelectionPath();
+			if (attribute.getEntity().getDbEntity() != null && path != null) {
 
 				if (path.getLastPathComponent() instanceof DbAttribute) {
 					Object[] pathComponents = path.getPath();
@@ -418,7 +418,7 @@ public class ObjAttributeInfoDialog extends CayenneController implements TreeSel
 
 	public void saveMapping() {
 
-		if (setPath(false)) {
+ 		if (setPath(false)) {
 
 			if (JOptionPane.showConfirmDialog(getView(),
 					"You have changed Db Attribute path. Do you want it to be saved?", "Save ObjAttribute",

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialogView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialogView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialogView.java
index 8a11d70..d98ad0f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialogView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialogView.java
@@ -92,7 +92,8 @@ public class ObjAttributeInfoDialogView extends JDialog {
 
         overrideAttributeTable = new CayenneTable();
         tablePreferences = new TableColumnPreferences(getClass(), "overrideAttributeTable");
-        
+
+        getRootPane().setDefaultButton(saveButton);
         saveButton.setEnabled(false);
         cancelButton.setEnabled(true);
         selectPathButton.setEnabled(false);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoView.java
index 54fefce..b960f7d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoView.java
@@ -18,10 +18,15 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.objentity;
 
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.util.DefaultWidgetFactory;
+import org.apache.cayenne.modeler.util.MultiColumnBrowser;
+import org.apache.cayenne.modeler.util.PanelFactory;
+import org.apache.cayenne.modeler.util.WidgetFactory;
+
 import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
@@ -29,15 +34,10 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTextField;
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.util.DefaultWidgetFactory;
-import org.apache.cayenne.modeler.util.MultiColumnBrowser;
-import org.apache.cayenne.modeler.util.PanelFactory;
-import org.apache.cayenne.modeler.util.WidgetFactory;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
 
 public class ObjRelationshipInfoView extends JDialog{
     
@@ -79,6 +79,7 @@ public class ObjRelationshipInfoView extends JDialog{
         this.sourceEntityLabel=new JLabel();
         
         cancelButton.setEnabled(true);
+        getRootPane().setDefaultButton(saveButton);
         saveButton.setEnabled(true);
         newRelButton.setEnabled(true);
         collectionTypeCombo = widgetFactory.createComboBox();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceCreatorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceCreatorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceCreatorView.java
index 014cb33..6a35afd 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceCreatorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceCreatorView.java
@@ -19,17 +19,16 @@
 
 package org.apache.cayenne.modeler.dialog.pref;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
 
 /**
  */
@@ -48,6 +47,8 @@ public class DataSourceCreatorView extends JDialog {
         this.okButton = new JButton("Create");
         this.cancelButton = new JButton("Cancel");
 
+        getRootPane().setDefaultButton(okButton);
+
         // assemble
         FormLayout layout = new FormLayout(
                 "right:pref, 3dlu, fill:max(50dlu;pref):grow",

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceDuplicatorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceDuplicatorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceDuplicatorView.java
index 09e6197..98432a1 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceDuplicatorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourceDuplicatorView.java
@@ -19,16 +19,15 @@
 
 package org.apache.cayenne.modeler.dialog.pref;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
 
 /**
  */
@@ -45,6 +44,8 @@ public class DataSourceDuplicatorView extends JDialog {
         this.okButton = new JButton("Create");
         this.cancelButton = new JButton("Cancel");
 
+        getRootPane().setDefaultButton(okButton);
+
         // assemble
         FormLayout layout = new FormLayout("right:pref, 3dlu, fill:250", "");
         DefaultFormBuilder builder = new DefaultFormBuilder(layout);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/PreferenceDialogView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/PreferenceDialogView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/PreferenceDialogView.java
index f753ebd..f9ee66a 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/PreferenceDialogView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/PreferenceDialogView.java
@@ -21,15 +21,6 @@ package org.apache.cayenne.modeler.dialog.pref;
 
 import org.apache.cayenne.swing.components.TopBorder;
 
-import java.awt.BorderLayout;
-import java.awt.CardLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dialog;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.Frame;
 import javax.swing.BorderFactory;
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.JButton;
@@ -39,6 +30,15 @@ import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Frame;
 
 /**
  */
@@ -91,6 +91,8 @@ public class PreferenceDialogView extends JDialog {
         split.setRightComponent(detailPanel);
         split.setDividerSize(3);
 
+        getRootPane().setDefaultButton(saveButton);
+
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         buttons.add(cancelButton);
         buttons.add(saveButton);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreatorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreatorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreatorView.java
index cc37a73..6337a56 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreatorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/TemplateCreatorView.java
@@ -19,19 +19,17 @@
 
 package org.apache.cayenne.modeler.dialog.pref;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.swing.control.FileChooser;
 
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
-
-import org.apache.cayenne.swing.control.FileChooser;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
 
 public class TemplateCreatorView extends JDialog {
 
@@ -63,6 +61,8 @@ public class TemplateCreatorView extends JDialog {
         builder.addLabel("Template File:", cc.xy(1, 3));
         builder.add(templateChooser, cc.xywh(3, 3, 3, 1));
 
+        getRootPane().setDefaultButton(okButton);
+
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         buttons.add(cancelButton);
         buttons.add(okButton);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryTypeView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryTypeView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryTypeView.java
index 0da2a56..72a83f9 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryTypeView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryTypeView.java
@@ -18,18 +18,16 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.query;
 
-import java.awt.BorderLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import org.apache.cayenne.modeler.util.PanelFactory;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JRadioButton;
-
-import org.apache.cayenne.modeler.util.PanelFactory;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
 
 public class QueryTypeView extends JDialog {
     
@@ -64,7 +62,9 @@ public class QueryTypeView extends JDialog {
 
         cancelButton = new JButton("Cancel");
         cancelButton.setEnabled(true);
- 
+
+        getRootPane().setDefaultButton(createButton);
+
         // assemble
         CellConstraints cc = new CellConstraints();
         FormLayout layout = new FormLayout(
@@ -82,7 +82,7 @@ public class QueryTypeView extends JDialog {
         add(builder.getPanel(), BorderLayout.CENTER);
 
         add(PanelFactory.createButtonPanel(new JButton[] {
-                createButton, cancelButton
+                cancelButton, createButton
         }), BorderLayout.SOUTH);
 
         setTitle("Select New Query Type");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
index 6e5afca..bf8ce97 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
@@ -18,21 +18,9 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.validator;
 
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.TableColumn;
-
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.modeler.Application;
@@ -42,9 +30,17 @@ import org.apache.cayenne.modeler.util.CayenneDialog;
 import org.apache.cayenne.modeler.util.CayenneTableModel;
 import org.apache.cayenne.modeler.util.ProjectUtil;
 
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.TableColumn;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.util.LinkedList;
+import java.util.List;
 
 /**
  * Dialog for resolving name collision.
@@ -54,8 +50,8 @@ public class DuplicatedAttributesDialog extends CayenneDialog {
 
     protected static DuplicatedAttributesDialog instance;
 
-    static final String DELETE_ACTION = "delete";
-    static final String RENAME_ACTION = "rename";
+    private static final String DELETE_ACTION = "delete";
+    private static final String RENAME_ACTION = "rename";
 
     public static final String CANCEL_RESULT = "cancel";
     public static final String PROCEEDED_RESULT = "proceeded";
@@ -99,6 +95,8 @@ public class DuplicatedAttributesDialog extends CayenneDialog {
         cancelButton = new JButton("Cancel");
         proceedButton = new JButton("Continue");
 
+        getRootPane().setDefaultButton(proceedButton);
+
         attributesTable = new JTable();
 
         // assemble

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
index 9db842f..c924495 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
@@ -111,9 +111,11 @@ public class ValidatorDialog extends CayenneDialog {
         builder.addLabel("Click on any row below to go to the object that has a validation problem:", cc.xy(1, 1));
         builder.add(new JScrollPane(problemsTable), cc.xy(1, 3));
 
+        getRootPane().setDefaultButton(refreshButton);
+
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-        buttons.add(refreshButton);
         buttons.add(closeButton);
+        buttons.add(refreshButton);
 
         getContentPane().setLayout(new BorderLayout());
         getContentPane().add(builder.getPanel(), BorderLayout.CENTER);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
index 4718f55..cc08354 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/MultiColumnBrowser.java
@@ -19,15 +19,6 @@
 
 package org.apache.cayenne.modeler.util;
 
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.Rectangle;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.swing.AbstractListModel;
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.ImageIcon;
@@ -45,6 +36,14 @@ import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
 import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreePath;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Rectangle;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A simple non-editable tree browser with multiple columns for display and
@@ -129,7 +128,7 @@ public class MultiColumnBrowser extends JPanel {
      * Returns current selection path or null if no selection is made.
      */
     public TreePath getSelectionPath() {
-        return new TreePath(selectionPath);
+        return selectionPath != null ? new TreePath(selectionPath) : null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d9f208fe/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ProgressDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ProgressDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ProgressDialog.java
index 8133254..a4a5382 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ProgressDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ProgressDialog.java
@@ -19,9 +19,9 @@
 
 package org.apache.cayenne.modeler.util;
 
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.FlowLayout;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
 
 import javax.swing.JButton;
 import javax.swing.JDialog;
@@ -30,10 +30,9 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
 import javax.swing.SwingConstants;
-
-import com.jgoodies.forms.builder.PanelBuilder;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.FlowLayout;
 
 /**
  * A dialog rendering a progress bar. It is normally controlled by a subclass of
@@ -67,6 +66,7 @@ public class ProgressDialog extends JDialog {
         builder.add(progressBar, cc.xy(1, 3));
         builder.add(statusLabel, cc.xy(1, 5));
 
+        getRootPane().setDefaultButton(cancelButton);
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
         buttons.add(cancelButton);
 


Mime
View raw message