cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r412745 - in /incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref: PreferenceDialog.java PreferenceDialogView.java
Date Thu, 08 Jun 2006 13:14:52 GMT
Author: aadamchik
Date: Thu Jun  8 06:14:51 2006
New Revision: 412745

URL: http://svn.apache.org/viewvc?rev=412745&view=rev
Log:
CAY-562 - fixing preferences dialog parent detection algorithm that results in strange behavior
when there are multiple levels of nested dialogs

Modified:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialog.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialogView.java

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialog.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialog.java?rev=412745&r1=412744&r2=412745&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialog.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialog.java
Thu Jun  8 06:14:51 2006
@@ -56,6 +56,9 @@
 package org.objectstyle.cayenne.modeler.dialog.pref;
 
 import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.HashMap;
@@ -63,6 +66,7 @@
 
 import javax.swing.JDialog;
 import javax.swing.JList;
+import javax.swing.SwingUtilities;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
@@ -91,7 +95,12 @@
 
     public PreferenceDialog(CayenneController parent) {
         super(parent);
-        this.view = new PreferenceDialogView();
+
+        Window parentView = (Window) SwingUtilities.getAncestorOfClass(
+                Window.class,
+                parent.getView());
+        this.view = (parentView instanceof Dialog) ? new PreferenceDialogView(
+                (Dialog) parentView) : new PreferenceDialogView((Frame) parentView);
         this.detailControllers = new HashMap();
 
         // editor must be configured before startup for "showDetailViewAction()" to work

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialogView.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialogView.java?rev=412745&r1=412744&r2=412745&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialogView.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/modeler/java/org/objectstyle/cayenne/modeler/dialog/pref/PreferenceDialogView.java
Thu Jun  8 06:14:51 2006
@@ -58,7 +58,9 @@
 import java.awt.BorderLayout;
 import java.awt.CardLayout;
 import java.awt.Container;
+import java.awt.Dialog;
 import java.awt.FlowLayout;
+import java.awt.Frame;
 
 import javax.swing.JButton;
 import javax.swing.JDialog;
@@ -79,7 +81,17 @@
     protected JButton cancelButton;
     protected JButton saveButton;
 
-    public PreferenceDialogView() {
+    public PreferenceDialogView(Dialog parent) {
+        super(parent);
+        init();
+    }
+
+    public PreferenceDialogView(Frame parent) {
+        super(parent);
+        init();
+    }
+
+    private void init() {
         this.split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
         this.list = new JList();
         this.detailLayout = new CardLayout();



Mime
View raw message