From b45cfc65f0a5ee58c030452a821feba38a6d6151 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 31 May 2022 14:43:58 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-72097=20=E8=A1=A8=E6=A0=BC=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E9=80=89=E4=B8=AD=E5=90=8E=E4=BC=9A=E5=8F=98=E6=88=90?= =?UTF-8?q?=E9=BB=91=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/settingpane/CellOtherSetPane.java | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index eeaf8f920f..742629af01 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -421,25 +421,37 @@ public class CellOtherSetPane extends AbstractCellAttrPane { @Override public void itemStateChanged(ItemEvent e) { - Style elementStyle = cellElement.getStyle(); - FRFont frFont = elementStyle.getFRFont(); - if (showContent.getSelectedIndex() == 3) { - fileNamePane.setPreferredSize(new Dimension(100, 20)); - fileNameLayout.show(fileNamePane, "content"); - frFont = frFont.applyForeground(Color.blue); - frFont = frFont.applyUnderline(Constants.LINE_THIN); - } else { - fileNameLayout.show(fileNamePane, "none"); - fileNamePane.setPreferredSize(new Dimension(0, 0)); - frFont = frFont.applyForeground(Color.black); - frFont = frFont.applyUnderline(Constants.LINE_NONE); + if (e.getStateChange() == ItemEvent.SELECTED) { + if (showContent.getSelectedIndex() == 3) { + fileNamePane.setPreferredSize(new Dimension(100, 20)); + fileNameLayout.show(fileNamePane, "content"); + } else { + fileNameLayout.show(fileNamePane, "none"); + fileNamePane.setPreferredSize(new Dimension(0, 0)); + } + handleCellShowStyleChange(e); } - cellElement.setStyle(elementStyle.deriveFRFont(frFont)); } }); return fileNamePane; } + private void handleCellShowStyleChange(ItemEvent itemEvent) { + CellGUIAttr cellGUIAttr = getCellGUIAttr(); + int selectedIndex = showContent.getSelectedIndex(); + boolean showAsDownload = cellGUIAttr.isShowAsDownload(); + Style elementStyle = cellElement.getStyle(); + FRFont frFont = elementStyle.getFRFont(); + if (!showAsDownload && selectedIndex == 3) { + frFont = frFont.applyForeground(Color.blue); + frFont = frFont.applyUnderline(Constants.LINE_THIN); + } else if (showAsDownload && selectedIndex != 3) { + frFont = frFont.applyForeground(Color.black); + frFont = frFont.applyUnderline(Constants.LINE_NONE); + } + cellElement.setStyle(elementStyle.deriveFRFont(frFont)); + } + private void initAllNames() { defaultAutoRadioButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Follow_Paper_Settings")); @@ -475,15 +487,20 @@ public class CellOtherSetPane extends AbstractCellAttrPane { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"); } + private CellGUIAttr getCellGUIAttr() { + CellGUIAttr cellGUIAttr = cellElement.getCellGUIAttr(); + if (cellGUIAttr == null) { + cellGUIAttr = CellGUIAttr.DEFAULT_CELLGUIATTR; + } + return cellGUIAttr; + } + @Override protected void populateBean() { this.currentPageFixedRowDataTipLabel.setText(" (" + Toolkit.i18nText("Fine-Design_Report_CellWrite_No_Page_Fixed_Row_Cell") + ")"); this.pageFixedRowDataCell = null; checkPageFixedRow(); - CellGUIAttr cellGUIAttr = cellElement.getCellGUIAttr(); - if (cellGUIAttr == null) { - cellGUIAttr = CellGUIAttr.DEFAULT_CELLGUIATTR; - } + CellGUIAttr cellGUIAttr = getCellGUIAttr(); // 支持 跟随页面设置 选项 = 不在编辑表单中的报表块 && 不在大屏模板cpt组件中 boolean supportFollowTplDefine = !EastRegionContainerPane.getInstance().getCurrentMode().equals(EastRegionContainerPane.PropertyMode.FORM_REPORT)