Browse Source

Pull request #10199: REPORT-75998 补充sheet名称、修复定位后滚动不到位的问题

Merge in DESIGN/design from ~DESTINY.LIN/design:feature/x to feature/x

* commit 'c032eb0d0c35294c0033cb1f72e13d89bc04cf28':
  REPORT-75998 补充字符串处理的Tag
  REPORT-75998 补充搜索单元格属性-其他-内容提示的公式
  REPORT-75998 补充sheet名称、修复定位后滚动不到位的问题
feature/x
Destiny.Lin-林锦龙 2 years ago
parent
commit
7d1a11dddf
  1. 13
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
  2. 29
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
  3. 5
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
  4. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
  5. 4
      designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java

13
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<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof CellGUIAttr) {
CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject();
attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr));
}
}
};
int index;

29
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<FormulaInfo> 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<FormulaInfo> formulaInfos) {
NameJavaScriptGroup nameJavaScriptGroup = ((CellElement) cellInfo.getContent().getReplaceObject()).getNameHyperlinkGroup();
if (nameJavaScriptGroup != null) {

5
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);

4
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;

4
designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java

@ -217,9 +217,9 @@ public class WorkSheetDesigner extends ReportComponent<WorkSheet, ElementCasePan
horizontalBar = getHorizontalScrollBar();
int m = columnRow.getColumn(), n = columnRow.getRow();
verticalBar.setMaximum(n);
verticalBar.setValue(n < 21 ? verticalBar.getValue() : n - 20);
verticalBar.setValue(n < 1 ? verticalBar.getValue() : n );
horizontalBar.setMaximum(m);
horizontalBar.setValue(m < 13 ? horizontalBar.getValue() : m - 12);
horizontalBar.setValue(m < 1 ? horizontalBar.getValue() : m );
// 选中
setSelection(cellSelection);
}

Loading…
Cancel
Save