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 1e1ab1f722..46b11d2a89 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 4c283cd714..d306bb1793 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()); }