You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2026/05/23 13:54:15 UTC

(cayenne) branch master updated (9cc39ca35 -> 48ac87a08)

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


    from 9cc39ca35  CAY-2943 CayenneModeler MCP: open_project tool
     new acbcff737  CAY-2943 CayenneModeler MCP: open_project tool
     new 48ac87a08 CayenneModeler .. Messy combo box sizing for editable popups

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../toolkit/table/CMComboBoxCellEditor.java        | 33 +++++++++++++---------
 pom.xml                                            |  2 +-
 2 files changed, 21 insertions(+), 14 deletions(-)


(cayenne) 01/02: CAY-2943 CayenneModeler MCP: open_project tool

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit acbcff737da86301717c89838d5cd7375cdd986d
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Sat May 23 09:46:04 2026 -0400

     CAY-2943 CayenneModeler MCP: open_project tool
    
    updating japp plugin to support jar arguments on Windows
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index fbcc6f397..87913e297 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,7 @@
         <apache-rat-plugin.version>0.18</apache-rat-plugin.version>
         <dependency-maven-plugin.version>1.0</dependency-maven-plugin.version>
         <exec-maven-plugin.version>3.6.3</exec-maven-plugin.version>
-        <japp-maven-plugin.version>3.7</japp-maven-plugin.version>
+        <japp-maven-plugin.version>3.8</japp-maven-plugin.version>
         <javacc-maven-plugin.version>2.6</javacc-maven-plugin.version>
         <maven-antrun-plugin.version>3.2.0</maven-antrun-plugin.version>
         <maven-assembly-plugin.version>3.8.0</maven-assembly-plugin.version>


(cayenne) 02/02: CayenneModeler .. Messy combo box sizing for editable popups

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 48ac87a08f09af4a36951ef58bde6ac235b2a243
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Sat May 23 08:39:51 2026 -0400

    CayenneModeler .. Messy combo box sizing for editable popups
    
    vibecoding vs Swing :-/
---
 .../toolkit/table/CMComboBoxCellEditor.java        | 33 +++++++++++++---------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/toolkit/table/CMComboBoxCellEditor.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/toolkit/table/CMComboBoxCellEditor.java
index c6e7d6e97..e7961afd4 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/toolkit/table/CMComboBoxCellEditor.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/toolkit/table/CMComboBoxCellEditor.java
@@ -93,10 +93,15 @@ public class CMComboBoxCellEditor extends AbstractCellEditor
         if (scrollPane == null) {
             return;
         }
-        Window window = SwingUtilities.getWindowAncestor(popup);
-        if (window == null) {
-            return;
-        }
+
+        // Heavyweight popup → its own top-level Window (distinct from the combo's window).
+        // Lightweight popup → no dedicated Window; getWindowAncestor returns the *main app frame*,
+        // which we must NOT resize. Whether a popup is heavy or light is decided per-show by Swing
+        // based on whether it fits inside the parent window (Windows tends to use lightweight when
+        // it fits; macOS uses heavyweight more often).
+        Window comboWindow = SwingUtilities.getWindowAncestor(comboBox);
+        Window popupWindow = SwingUtilities.getWindowAncestor(popup);
+        boolean heavyweight = popupWindow != null && popupWindow != comboWindow;
 
         // Clear sizes set by BasicComboPopup.getPopupLocation() so the scroll pane
         // reports its natural content-based width.
@@ -107,18 +112,20 @@ public class CMComboBoxCellEditor extends AbstractCellEditor
         int naturalWidth = scrollPane.getPreferredSize().width;
         int targetWidth = Math.min(Math.max(naturalWidth, comboBox.getWidth()), ComboBoxPopup.MAX_WIDTH);
 
-        // Use the window's actual height — correctly determined by BasicComboPopup based on row count.
-        // Setting scroller maxSize to windowHeight lets BoxLayout fill all available vertical space.
-        int windowHeight = window.getHeight();
-        Dimension scrollSize = new Dimension(targetWidth, windowHeight);
+        // For the height, BasicComboPopup has already sized the popup's container correctly based
+        // on row count. Reuse that height when available; otherwise fall back to popup pref height.
+        int targetHeight = heavyweight ? popupWindow.getHeight() : popup.getPreferredSize().height;
+        Dimension scrollSize = new Dimension(targetWidth, targetHeight);
         scrollPane.setPreferredSize(scrollSize);
         scrollPane.setMaximumSize(scrollSize);
-        popup.setPreferredSize(new Dimension(targetWidth, windowHeight));
+        popup.setPreferredSize(new Dimension(targetWidth, targetHeight));
 
-        // Widen the popup window; the height was already set correctly by BasicComboPopup.
-        Point loc = window.getLocation();
-        window.setSize(targetWidth, windowHeight);
-        window.setLocation(loc);
+        if (heavyweight) {
+            // Widen the dedicated popup window; preserve its location.
+            Point loc = popupWindow.getLocation();
+            popupWindow.setSize(targetWidth, targetHeight);
+            popupWindow.setLocation(loc);
+        }
 
         popup.revalidate();
         popup.repaint();