From 9b64cf37b2a43060023b49ef43963d2a1083d9cd Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Mon, 2 Jul 2018 16:55:11 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-9297=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E6=8C=89=E9=92=AE=E8=AE=BE=E7=BD=AE=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E4=BA=8B=E4=BB=B6=EF=BC=8C=E9=80=89=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E5=8F=AA=E8=A6=81=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E7=BB=84=E8=AF=A5=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=B0=B1=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../submit/SmartInsertDBManipulationPane.java | 61 ++++++++----------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index bde8cdfcb..2db00aeff 100644 --- a/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -183,30 +183,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * @param evt 事件s */ public void actionPerformed(ActionEvent evt) { - - // Grid.GridSelectionListener - if (ePane == null) { - return; - } - - /* - * 布局 - */ - BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane); - - // ReportWriteAttrDialog.this.setVisible(false); - hideDialog4AddCellAction(); - /* - * 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener - */ - ePane.setEditable(false); - ePane.setSelection(NO_SELECTION); - ePane.getGrid().setNotShowingTableSelectPane(false); - - BasicDialog dlg = bPane.showWindow(DesignerContext.getDesignerFrame()); - - dlg.setModal(false); - dlg.setVisible(true); + showCellWindow(false); } } @@ -220,26 +197,36 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * @param e 事件s */ public void actionPerformed(ActionEvent e) { - if (ePane == null) { - return; - } + showCellWindow(true); + } + } + + /** + * 切换到单元格窗口,设置属性面板不可编辑 + * @param isCellGroup 判断是否单元格组 + */ - BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane, true); + private void showCellWindow(boolean isCellGroup){ + if (ePane == null) { + return; + } - // ReportWriteAttrDialog.this.setVisible(false); - hideDialog4AddCellAction(); + BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane, isCellGroup); + + // ReportWriteAttrDialog.this.setVisible(false); + hideDialog4AddCellAction(); /* * 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener */ - ePane.setSelection(NO_SELECTION); - ePane.setEditable(false); - ePane.getGrid().setNotShowingTableSelectPane(false); + //必须先设置面板不可编辑才能释放单元格选中 + ePane.setEditable(false); + ePane.setSelection(NO_SELECTION); + ePane.getGrid().setNotShowingTableSelectPane(false); - BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this)); + BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this)); - dlg.setModal(false); - dlg.setVisible(true); - } + dlg.setModal(false); + dlg.setVisible(true); } private void showDialogAfterAddCellAction() {