From 8c138328e230149c1643abb9addac9afb824cd53 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 11 Dec 2020 16:09:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-45095=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B4=A8=E9=87=8F&=E4=BC=98=E5=8C=96=E4=BC=A0?= =?UTF-8?q?=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../write/submit/DBManipulationPane.java | 45 +++++++------------ .../submit/SmartInsertDBManipulationPane.java | 2 +- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 1e1ab1f72..46b11d2a8 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -697,7 +697,7 @@ public class DBManipulationPane extends BasicBeanPane { ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); //设置Column 2的Editor - column2.setCellEditor(new ColumnValueEditor(DBManipulationPane.this)); + column2.setCellEditor(new ColumnValueEditor()); } @Override @@ -864,43 +864,19 @@ public class DBManipulationPane extends BasicBeanPane { */ private final UILabel textLabel; private final ValuePane vPane; - private final BasicDialog vPaneDLG; - private Component parent; - /** - * 列值编辑器 - * - * @param parent 父组件,通过指定父组件启动下一级子窗口 - */ - protected ColumnValueEditor(Component parent) { - this(v_Types, parent); - } - - @Deprecated protected ColumnValueEditor() { - this(v_Types, null); + this(v_Types); } /** * 列值编辑器 * - * @param types 编辑器类型 - * @param parent 父组件,通过指定父组件启动下一级子窗口 + * @param types 编辑器类型 */ - protected ColumnValueEditor(Editor[] types, Component parent) { + protected ColumnValueEditor(Editor[] types) { textLabel = new UILabel(); - textLabel.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - vPaneDLG.setVisible(true); - } - }); - - vPane = new ValuePane(types); - Window window = parent == null - ? DesignerContext.getDesignerFrame() - : SwingUtilities.getWindowAncestor(parent); - vPaneDLG = vPane.showSmallWindow(window, new DialogActionAdapter() { + DialogActionAdapter adapter = new DialogActionAdapter() { @Override public void doOk() { fireEditingStopped(); // Make the renderer @@ -912,7 +888,18 @@ public class DBManipulationPane extends BasicBeanPane { public void doCancel() { fireEditingCanceled(); } + }; + textLabel.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + Window window = e.getComponent() == null + ? DesignerContext.getDesignerFrame() + : SwingUtilities.getWindowAncestor(e.getComponent()); + vPane.showSmallWindow(window, adapter) + .setVisible(true); + } }); + vPane = new ValuePane(types); } /* diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 4c283cd71..d306bb179 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -356,7 +356,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { if (isCellGroup) { column2.setCellRenderer(new ColumnRowGroupCellRenderer2()); - column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor(), this)); + column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); } else { column2.setCellRenderer(new SelectedColumnValueTableCellRenderer()); }