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..39ccf32585 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 @@ -14,18 +14,21 @@ import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; 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 +72,8 @@ public class SearchCellFormulaAction implements SearchCellFormula { searchCellSortAttr4Formula(cellInfo, formulaInfos); //单元格属性-形态 searchCellPresent4Formula(cellInfo, formulaInfos); + //单元格属性-其他-内容提示-自定义 + searchCellToolTip4Formula(cellInfo, formulaInfos); //单元格属性-其他-插入策略 searchCellInsertPolicy4Formula(cellInfo, formulaInfos); //单元格条件属性-参数-公式 @@ -84,6 +89,30 @@ 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); + attrContent.setTag(SearchTag.CELL_TOOL_TIP); + 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/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index de653dd706..0f9124721f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -66,7 +66,10 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { String name = workBook.getReportName(i); if (CommonUtils.canBeFormula(name)) { ITContent sheetContent = ITContent.copy(content); - sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Replace_Sheet")); + sheetContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Replace_Sheet"), + name + ); sheetContent.setReplaceObject(name); sheetContent.setHoldObject(workBook); sheetContent.setTag(SearchTag.SHEET_NAME); 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; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java index 0529cf82a3..629f71b6bb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java @@ -217,9 +217,9 @@ public class WorkSheetDesigner extends ReportComponent