From dd77af15e0b8ef8786b1661218c74faea77cd93d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 16:55:11 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7-?= =?UTF-8?q?=E5=85=B6=E4=BB=96-=E5=86=85=E5=AE=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/formula/FormulaTag.java | 13 +++++++++ .../formula/cell/SearchCellFormulaAction.java | 27 +++++++++++++++++++ .../actions/replace/info/base/SearchTag.java | 4 +++ 3 files changed, 44 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index fd2367f3be..ff8755974b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.plugin.chart.map.data.VanMapReportDefinition; +import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.stable.collections.combination.Pair; import org.jetbrains.annotations.Nullable; @@ -120,6 +121,18 @@ public enum FormulaTag implements DealWithInfoValue { workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr)); } } + }, + /** + * 单元格属性-其他-内容提示 + */ + CELL_TOOL_TIP(SearchTag.CELL_TOOL_TIP) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof CellGUIAttr) { + CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject(); + attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java index b58008e7bc..67593b12a7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java @@ -20,12 +20,14 @@ import com.fr.general.data.Condition; import com.fr.js.NameJavaScriptGroup; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; +import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.report.cell.cellattr.highlight.DefaultHighlight; import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightGroup; import com.fr.report.core.sort.common.CellSortAttr; import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.report.core.sort.sortexpression.SortExpression; +import com.fr.stable.CommonUtils; import java.util.List; @@ -69,6 +71,8 @@ public class SearchCellFormulaAction implements SearchCellFormula { searchCellSortAttr4Formula(cellInfo, formulaInfos); //单元格属性-形态 searchCellPresent4Formula(cellInfo, formulaInfos); + //单元格属性-其他-内容提示-自定义 + searchCellToolTip4Formula(cellInfo, formulaInfos); //单元格属性-其他-插入策略 searchCellInsertPolicy4Formula(cellInfo, formulaInfos); //单元格条件属性-参数-公式 @@ -84,6 +88,29 @@ public class SearchCellFormulaAction implements SearchCellFormula { } + private void searchCellToolTip4Formula(CellInfo cellInfo, List formulaInfos) { + if (cellInfo.getContent().getReplaceObject() instanceof TemplateCellElement) { + TemplateCellElement cellElement = (TemplateCellElement) cellInfo.getContent().getReplaceObject(); + if (isCellGUIAttrValid(cellElement.getCellGUIAttr())) { + CellGUIAttr attr = cellElement.getCellGUIAttr(); + ITContent attrContent = ITContent.copy(cellInfo.getContent()); + attrContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"), + Toolkit.i18nText("Fine-Design_Report_Other"), + Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"), + Toolkit.i18nText("Fine-Design_Basic_Custom") + ); + attrContent.setReplaceObject(attr.getTooltipText()); + attrContent.setHoldObject(attr); + formulaInfos.add(new FormulaInfo(attrContent)); + } + } + } + + private boolean isCellGUIAttrValid(CellGUIAttr attr) { + return attr != null && attr.isCustomTooltip() && CommonUtils.canBeFormula(attr.getTooltipText()); + } + private void searchCellHyperLink4Formula(CellInfo cellInfo, List formulaInfos) { NameJavaScriptGroup nameJavaScriptGroup = ((CellElement) cellInfo.getContent().getReplaceObject()).getNameHyperlinkGroup(); if (nameJavaScriptGroup != null) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index b4163f57bf..1bbba05b35 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -40,6 +40,10 @@ public class SearchTag { * sheet名称 */ public static final int SHEET_NAME = 7; + /** + * 单元格属性-其他-内容提示 + */ + public static final int CELL_TOOL_TIP = 8;