Browse Source

REPORT-75998 完善替换后触发查找的整体逻辑,修复查找后没有全选的问题、完善图表搜索逻辑

feature/x
Destiny.Lin 2 years ago
parent
commit
e0e04607f1
  1. 109
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
  2. 18
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
  3. 35
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
  4. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
  5. 10
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  6. 10
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
  7. 23
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
  8. 8
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
  9. 18
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java

109
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java

@ -2,21 +2,34 @@ package com.fr.design.actions.replace.action.content.formula.chart;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.base.present.DictPresent;
import com.fr.base.present.FormulaPresent;
import com.fr.base.present.Present;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchTitle;
import com.fr.chart.chartattr.Title; import com.fr.chart.chartattr.Title;
import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.SeriesDefinition; import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction;
import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType;
import com.fr.design.actions.replace.info.CellInfo;
import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.JSInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.StringUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -44,7 +57,12 @@ public class SearchChartCollectionFormulaAction {
for (int i = 0; i < chartCollection.getChartCount(); i++) { for (int i = 0; i < chartCollection.getChartCount(); i++) {
ITContent chartContent = ITContent.copy(content); ITContent chartContent = ITContent.copy(content);
searchChartPatternFormula(formulaInfos, chartContent, chartCollection.getChart(i)); searchChartPatternFormula(formulaInfos, chartContent, chartCollection.getChart(i));
if (isChangeConfigAttrValid(chartCollection.getChangeConfigAttr())) {
//图表切换属性
dealChangeConfig(formulaInfos, chartContent, chartCollection.getChart(i));
}
//图表-交互属性-超级链接
dealChartHyperLink(formulaInfos, chartContent, chartCollection.getChart(i));
//数据-单元格数据-分类名&系列名&值 //数据-单元格数据-分类名&系列名&值
SearchChartDataFormulaManager searchChartDataFormulaManager = SearchChartDataFormulaManager.getInstance(); SearchChartDataFormulaManager searchChartDataFormulaManager = SearchChartDataFormulaManager.getInstance();
Map<String, SearchChartDataFormula> type = searchChartDataFormulaManager.getChartDataType(); Map<String, SearchChartDataFormula> type = searchChartDataFormulaManager.getChartDataType();
@ -56,9 +74,94 @@ public class SearchChartCollectionFormulaAction {
dataContent.addOtherPos(chartCollection.getChart(i).getChartName(), Toolkit.i18nText("Fine-Design_Basic_Data")); dataContent.addOtherPos(chartCollection.getChart(i).getChartName(), Toolkit.i18nText("Fine-Design_Basic_Data"));
searchChartDataFormula.searchChartDataFormula(formulaInfos, dataContent, provider); searchChartDataFormula.searchChartDataFormula(formulaInfos, dataContent, provider);
} }
//数据-形态
if (chartCollection.getChart(i).getFilterDefinition() != null) {
ITContent presentContent = ITContent.copy(content);
presentContent.addOtherPos(chartCollection.getChart(i).getChartName(), Toolkit.i18nText("Fine-Design_Basic_Data"));
searchFormulaFromChartPresent(formulaInfos, presentContent, chartCollection.getChart(i).getFilterDefinition());
}
}
}
private void dealChartHyperLink(List<FormulaInfo> formulaInfos, ITContent content, Chart chart) {
ITContent conditionContent = ITContent.copy(content);
if (StringUtils.isNotEmpty(chart.getChartName())) {
conditionContent.addOtherPos(chart.getChartName());
}
conditionContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Chart_Animation_Special"),
Toolkit.i18nText("Fine-Design_Chart_Interactive")
);
if (chart.getPlot() != null) {
NameJavaScriptGroup javaScriptGroup = chart.getPlot().getHotHyperLink();
if (javaScriptGroup != null) {
for (int i = 0; i < javaScriptGroup.size(); i++) {
NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i);
conditionContent.addOtherPos(javaScript.getName());
SearchJSHighlightAction action = SearchJSHighlightAction.getInstance();
action.searchJSFormulaFromOther(formulaInfos, conditionContent, javaScript.getJavaScript());
}
}
}
}
private void searchFormulaFromChartPresent(List<FormulaInfo> formulaInfos, ITContent content, TopDefinitionProvider provider) {
searchPresent4Formula(provider.getCategoryPresent(), content, formulaInfos);
searchPresent4Formula(provider.getSeriesPresent(), content, formulaInfos);
}
private void searchPresent4Formula(Present present, ITContent content, List<FormulaInfo> formulaInfos) {
if (present instanceof FormulaPresent) {
ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(present);
newContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Chart_Style_Present"),
Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"));
formulaInfos.add(new FormulaInfo(newContent));
}
if (present instanceof DictPresent) {
ITContent dictContent = ITContent.copy(content);
dictContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Chart_Style_Present"),
Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary")
);
DictPresent dictPresent = (DictPresent) present;
if (dictPresent.getDictionary() != null) {
DictionaryType type = DictionaryType.match(dictPresent.getDictionary().getClass().getSimpleName());
if (type != null) {
type.searchFormulaFromDictionary(dictContent, formulaInfos, dictPresent.getDictionary());
}
}
} }
} }
private boolean isChangeConfigAttrValid(AttrChangeConfig attrChangeConfig) {
return attrChangeConfig != null && attrChangeConfig.isEnable();
}
private void dealChangeConfig(List<FormulaInfo> formulaInfos, ITContent chartContent, Chart chart) {
ITContent content = ITContent.copy(chartContent);
if (StringUtils.isNotEmpty(chart.getChartName())) {
content.addOtherPos(chart.getChartName());
}
content.addOtherPos(
Toolkit.i18nText("Fine-Design_Chart_Type"),
Toolkit.i18nText("Fine-Design_Chart_Change_Config_Attributes")
);
if (isSwitchTitleValid(chart.getSwitchTitle())) {
SwitchTitle title = chart.getSwitchTitle();
content.setReplaceObject(title.getContent());
formulaInfos.add(new FormulaInfo(content));
}
}
private boolean isSwitchTitleValid(SwitchTitle title) {
return title != null && title.getContent() instanceof Formula;
}
private boolean isDefinitionValid(TopDefinitionProvider provider) { private boolean isDefinitionValid(TopDefinitionProvider provider) {
return provider != null && SearchChartDataFormulaManager.getInstance().getChartDataType().containsKey(provider.getClass().getSimpleName()); return provider != null && SearchChartDataFormulaManager.getInstance().getChartDataType().containsKey(provider.getClass().getSimpleName());
} }
@ -76,7 +179,7 @@ public class SearchChartCollectionFormulaAction {
} }
private void searchChartPatternFormulaFromAlertLine(List<FormulaInfo> formulaInfos, ITContent chartContent, Chart chart) { private void searchChartPatternFormulaFromAlertLine(List<FormulaInfo> formulaInfos, ITContent chartContent, Chart chart) {
if (chart.getPlot() != null){ if (chart.getPlot() != null) {
Axis xAxis = chart.getPlot().getxAxis(); Axis xAxis = chart.getPlot().getxAxis();
Axis yAxis = chart.getPlot().getyAxis(); Axis yAxis = chart.getPlot().getyAxis();
ITContent content = ITContent.copy(chartContent); ITContent content = ITContent.copy(chartContent);
@ -128,7 +231,7 @@ public class SearchChartCollectionFormulaAction {
} }
private void searchChartPatternFormulaFromAxisValue(List<FormulaInfo> formulaInfos, ITContent chartContent, Chart chart) { private void searchChartPatternFormulaFromAxisValue(List<FormulaInfo> formulaInfos, ITContent chartContent, Chart chart) {
if (chart.getPlot() != null){ if (chart.getPlot() != null) {
Axis xAxis = chart.getPlot().getxAxis(); Axis xAxis = chart.getPlot().getxAxis();
Axis yAxis = chart.getPlot().getyAxis(); Axis yAxis = chart.getPlot().getyAxis();
//样式-坐标轴-x轴 //样式-坐标轴-x轴

18
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java

@ -54,22 +54,24 @@ public class SearchChartJSAction {
SearchJSUtils.addJSInfosFromNameJS(conditionContent, nameJavaScripts, jsInfos); SearchJSUtils.addJSInfosFromNameJS(conditionContent, nameJavaScripts, jsInfos);
//图表-特效-交互属性-监控刷新 //图表-特效-交互属性-监控刷新
dealMonitorRefreshJS(conditionContent,chartCollection,jsInfos); dealMonitorRefreshJS(conditionContent, chartCollection, jsInfos);
for (int i = 0; i < chartCollection.getChartCount(); i++) { for (int i = 0; i < chartCollection.getChartCount(); i++) {
ITContent chartContent = ITContent.copy(content); ITContent chartContent = ITContent.copy(content);
chartContent.addOtherPos(chartCollection.getChart(i).getChartName()); chartContent.addOtherPos(chartCollection.getChart(i).getChartName());
//坐标轴
searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i)); searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i));
}
} }
}
private void dealMonitorRefreshJS(ITContent conditionContent, ChartCollection chartCollection, List<JSInfo> jsInfos) { private void dealMonitorRefreshJS(ITContent conditionContent, ChartCollection chartCollection, List<JSInfo> jsInfos) {
for (int i = 0 ; i < chartCollection.getChartCount() ; i ++){ for (int i = 0; i < chartCollection.getChartCount(); i++) {
if (chartCollection.getChart(i) instanceof VanChart){ if (chartCollection.getChart(i) instanceof VanChart) {
VanChart chart = (VanChart) chartCollection.getChart(i); VanChart chart = (VanChart) chartCollection.getChart(i);
if (isMonitorValid(chart.getRefreshMoreLabel())){ if (isMonitorValid(chart.getRefreshMoreLabel())) {
VanChartHtmlLabel htmlLabel = chart.getRefreshMoreLabel().getAttrTooltip().getContent().getHtmlLabel(); VanChartHtmlLabel htmlLabel = chart.getRefreshMoreLabel().getAttrTooltip().getContent().getHtmlLabel();
if (htmlLabel != null){ if (htmlLabel != null) {
ITContent content = ITContent.copy(conditionContent); ITContent content = ITContent.copy(conditionContent);
content.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh")); content.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"));
content.setReplaceObject(htmlLabel); content.setReplaceObject(htmlLabel);
@ -80,12 +82,12 @@ public class SearchChartJSAction {
} }
} }
private boolean isMonitorValid(RefreshMoreLabel moreLabel){ private boolean isMonitorValid(RefreshMoreLabel moreLabel) {
return moreLabel.isMoreLabel() && moreLabel.getAttrTooltip() != null && moreLabel.getAttrTooltip().isEnable(); return moreLabel.isMoreLabel() && moreLabel.getAttrTooltip() != null && moreLabel.getAttrTooltip().isEnable();
} }
private void searchAxisJS(List<JSInfo> jsInfos, ITContent chartContent, Chart chart) { private void searchAxisJS(List<JSInfo> jsInfos, ITContent chartContent, Chart chart) {
if (chart.getPlot() != null){ if (chart.getPlot() != null) {
Axis xAxis = chart.getPlot().getxAxis(); Axis xAxis = chart.getPlot().getxAxis();
Axis yAxis = chart.getPlot().getyAxis(); Axis yAxis = chart.getPlot().getyAxis();
if (xAxis instanceof VanChartAxis) { if (xAxis instanceof VanChartAxis) {

35
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java

@ -32,6 +32,7 @@ import java.util.Map;
public class SearchWebJSAction implements SearchJS { public class SearchWebJSAction implements SearchJS {
private final static Map<String, String> MAP = new HashMap<>(); private final static Map<String, String> MAP = new HashMap<>();
private final static Map<String, String> SERVER_MAP = new HashMap<>();
private List<WebContent> arrayList = new ArrayList<>(); private List<WebContent> arrayList = new ArrayList<>();
private SearchWebJSAction() { private SearchWebJSAction() {
@ -41,6 +42,9 @@ public class SearchWebJSAction implements SearchJS {
MAP.put("WebPage", Toolkit.i18nText("Fine-Design_Report_Pagination_Setting")); MAP.put("WebPage", Toolkit.i18nText("Fine-Design_Report_Pagination_Setting"));
MAP.put("WebWrite", Toolkit.i18nText("Fine-Design_Report_Write_Setting")); MAP.put("WebWrite", Toolkit.i18nText("Fine-Design_Report_Write_Setting"));
MAP.put("WebView", Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings")); MAP.put("WebView", Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings"));
SERVER_MAP.put("WebPage", Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter") + "-" + Toolkit.i18nText("Fine-Design_Report_Pagination_Setting"));
SERVER_MAP.put("WebWrite", Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter") + "-" + Toolkit.i18nText("Fine-Design_Report_Write_Setting"));
SERVER_MAP.put("WebView", Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter") + "-" + Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings"));
} }
@ -54,6 +58,27 @@ public class SearchWebJSAction implements SearchJS {
private void addJSInfos2ListFromWeb(JTemplate jTemplate, List<JSInfo> jsInfos) { private void addJSInfos2ListFromWeb(JTemplate jTemplate, List<JSInfo> jsInfos) {
dealServerWebAttr(jTemplate, jsInfos);
dealTemplateWebAttr(jTemplate, jsInfos);
}
private void dealServerWebAttr(JTemplate jTemplate, List<JSInfo> jsInfos) {
ReportWebAttr webReportAttr = ReportWebAttr.getInstance();
if (webReportAttr != null) {
webReportAttr.getWebWrite();
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false);
addWebContent2Array(webReportAttr);
for (int i = 0; i < arrayList.size(); i++) {
addJSInfos2ListFromServerWebAttr(content, jsInfos, arrayList.get(i));
}
}
}
private void dealTemplateWebAttr(JTemplate jTemplate, List<JSInfo> jsInfos) {
if (jTemplate.getTarget() instanceof WorkBook) { if (jTemplate.getTarget() instanceof WorkBook) {
WorkBook workBook = (WorkBook) jTemplate.getTarget(); WorkBook workBook = (WorkBook) jTemplate.getTarget();
ReportWebAttr webAttr = workBook.getReportWebAttr(); ReportWebAttr webAttr = workBook.getReportWebAttr();
@ -67,6 +92,15 @@ public class SearchWebJSAction implements SearchJS {
} }
} }
private void addJSInfos2ListFromServerWebAttr(ITContent content, List<JSInfo> jsInfos, WebContent webContent) {
ITContent newContent = ITContent.copy(content);
if (SERVER_MAP.containsKey(webContent.getClass().getSimpleName())) {
newContent.addOtherPos(SERVER_MAP.get(webContent.getClass().getSimpleName()));
}
addJSInfos2ListFromWebButton(newContent, jsInfos, webContent);
addJSInfos2ListFromWebListener(newContent, jsInfos, webContent);
}
private void addJSInfos2ListFromArray(ITContent content, List<JSInfo> jsInfos, WebContent webContent) { private void addJSInfos2ListFromArray(ITContent content, List<JSInfo> jsInfos, WebContent webContent) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
if (MAP.containsKey(webContent.getClass().getSimpleName())) { if (MAP.containsKey(webContent.getClass().getSimpleName())) {
@ -94,6 +128,7 @@ public class SearchWebJSAction implements SearchJS {
} }
private void addWebContent2Array(ReportWebAttr webAttr) { private void addWebContent2Array(ReportWebAttr webAttr) {
arrayList.clear();
if (webAttr != null) { if (webAttr != null) {
addContent(arrayList, webAttr.getWebWrite()); addContent(arrayList, webAttr.getWebWrite());
addContent(arrayList, webAttr.getWebPage()); addContent(arrayList, webAttr.getWebPage());

2
designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java

@ -2,6 +2,7 @@ package com.fr.design.actions.replace.info;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.js.JavaScriptImpl; import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScript;
@ -210,6 +211,7 @@ public enum ReplaceObject implements DealWithInfoValue {
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
info.updateOldStr(dbTableData.getQuery(), findStr); info.updateOldStr(dbTableData.getQuery(), findStr);
dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr));
//todo DesignTableDataManager
} }
@Override @Override

10
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java

@ -32,6 +32,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
/** /**
* 主面板 * 主面板
* *
@ -98,7 +100,7 @@ public class ITReplaceMainDialog extends UIDialog {
setSize(width, height); setSize(width, height);
setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385)); setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385));
northPane.fitScreen(0, 0,width); northPane.fitScreen(0, 0, width);
} }
@ -162,16 +164,14 @@ public class ITReplaceMainDialog extends UIDialog {
for (Info info : searchResultList) { for (Info info : searchResultList) {
if (info.getContent().isSelected()) { if (info.getContent().isSelected()) {
info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray());
ShowValueUtils.updateHighlight(info, replaceStr);
} }
} }
southPanel.getTableEditorPane().update(); southPanel.getTableEditorPane().update();
northPane.refreshReplaceInputComboBoxItems(); northPane.refreshReplaceInputComboBoxItems();
ITTableEditorPane.getEditTable().repaint(); ITTableEditorPane.getEditTable().repaint();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTabChange();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true);
setSearchFlag(false); setSearchFlag(false);
search();
} else { } else {
Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}; Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")};
int optionSelected = FineJOptionPane.showOptionDialog( int optionSelected = FineJOptionPane.showOptionDialog(
@ -291,6 +291,8 @@ public class ITReplaceMainDialog extends UIDialog {
itTableEditor.add(searchResultList); itTableEditor.add(searchResultList);
northPane.getResultLabel().setText("<html>" + Toolkit.i18nText("Fine-Design_Replace_Search_Finish") + "<font color = 'rgb(61,153,249)'>" + searchResultList.size() + "</font>" + Toolkit.i18nText("Fine-Design_Replace_Result")); northPane.getResultLabel().setText("<html>" + Toolkit.i18nText("Fine-Design_Replace_Search_Finish") + "<font color = 'rgb(61,153,249)'>" + searchResultList.size() + "</font>" + Toolkit.i18nText("Fine-Design_Replace_Result"));
} }
ITTableEditorPane.ITHeaderRenderer renderer = (ITTableEditorPane.ITHeaderRenderer) getEditTable().getTableHeader().getDefaultRenderer();
renderer.refreshHeader(getEditTable());
itTableEditor.fireTableDataChanged(); itTableEditor.fireTableDataChanged();
northPane.refreshFindInputComboBoxItems(); northPane.refreshFindInputComboBoxItems();
setSearchFlag(true); setSearchFlag(true);

10
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java

@ -5,11 +5,14 @@ import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ReportComponentComposite;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.AbstractCellEditor; import javax.swing.AbstractCellEditor;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import java.awt.Component; import java.awt.Component;
@ -36,10 +39,11 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
paraButton.addActionListener(new ActionListener() { paraButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), 7); ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), 6);
if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) {
ITReplaceMainDialog.setITReplaceFlag(true); ITReplaceMainDialog.setITReplaceFlag(true);
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString()))); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString())));
ReportComponentComposite composite = (ReportComponentComposite) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getCurrentReportComponentPane();
} }
ITReplaceMainDialog.setITReplaceFlag(false); ITReplaceMainDialog.setITReplaceFlag(false);
} }
@ -60,7 +64,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
*/ */
@Override @Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
ITContent content = (ITContent) table.getValueAt(row, 7); ITContent content = (ITContent) table.getValueAt(row, 6);
paraButton.setEnabled(content.isJumpAble()); paraButton.setEnabled(content.isJumpAble());
return paraButton; return paraButton;
} }
@ -78,7 +82,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
*/ */
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
ITContent content = (ITContent) table.getValueAt(row, 7); ITContent content = (ITContent) table.getValueAt(row, 6);
paraButton.setEnabled(content.isJumpAble()); paraButton.setEnabled(content.isJumpAble());
return paraButton; return paraButton;
} }

23
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java

@ -31,7 +31,6 @@ public class ITTableEditor extends UITableModelAdapter {
Toolkit.i18nText("Fine-Design_Replace_Template_Name"), Toolkit.i18nText("Fine-Design_Replace_Template_Name"),
Toolkit.i18nText("Fine-Design_Replace_Sheet_Name"), Toolkit.i18nText("Fine-Design_Replace_Sheet_Name"),
Toolkit.i18nText("Fine-Design_Replace_Block_Name"), Toolkit.i18nText("Fine-Design_Replace_Block_Name"),
Toolkit.i18nText("Fine-Design_Replace_Location"),
Toolkit.i18nText("Fine-Design_Replace_Location_Info"), Toolkit.i18nText("Fine-Design_Replace_Location_Info"),
Toolkit.i18nText("Fine-Design_Replace_Operator"), Toolkit.i18nText("Fine-Design_Replace_Operator"),
}); });
@ -43,14 +42,13 @@ public class ITTableEditor extends UITableModelAdapter {
UILabel.class, UILabel.class,
UILabel.class, UILabel.class,
UILabel.class, UILabel.class,
UILabel.class,
ITTableButton.class, ITTableButton.class,
}); });
this.setDefaultEditor(ITTableButton.class, new ITTableButton()); this.setDefaultEditor(ITTableButton.class, new ITTableButton());
this.setDefaultRenderer(ITTableButton.class, new ITTableButton()); this.setDefaultRenderer(ITTableButton.class, new ITTableButton());
this.createTable().getColumnModel().getColumn(7).setMaxWidth(50); this.createTable().getColumnModel().getColumn(6).setMaxWidth(50);
this.createTable().getColumnModel().getColumn(0).setMaxWidth(50); this.createTable().getColumnModel().getColumn(0).setMaxWidth(50);
} }
@ -83,7 +81,7 @@ public class ITTableEditor extends UITableModelAdapter {
*/ */
@Override @Override
public boolean isCellEditable(int row, int col) { public boolean isCellEditable(int row, int col) {
return col == 7 || col == 0; return col == 6 || col == 0;
} }
/** /**
@ -157,21 +155,10 @@ public class ITTableEditor extends UITableModelAdapter {
return " " + content.getBlockName(); return " " + content.getBlockName();
} }
}, },
/** /**
* 第六列展示位置 * 第六列展示路径
*/ */
INDEX_5(5) { INDEX_5(5) {
@Override
public Object returnContentObject(ITContent content) {
return " " + content.getShowObject();
}
},
/**
* 第七列展示路径
*/
INDEX_6(6) {
@Override @Override
public Object returnContentObject(ITContent content) { public Object returnContentObject(ITContent content) {
return " " + content.getOtherPos(); return " " + content.getOtherPos();
@ -179,9 +166,9 @@ public class ITTableEditor extends UITableModelAdapter {
}, },
/** /**
* 展示定位按钮 * 展示定位按钮
*/ */
INDEX_7(7) { INDEX_6(6) {
@Override @Override
public Object returnContentObject(ITContent content) { public Object returnContentObject(ITContent content) {
return content; return content;

8
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java

@ -128,6 +128,12 @@ public class ITTableEditorPane<T> extends BasicPane {
}); });
} }
public void refreshHeader(JTable table) {
selectBox.setSelected(true);
int rowHeight = table.getRowHeight();
table.updateUI();
table.setRowHeight(rowHeight);
}
@Override @Override
public Component getTableCellRendererComponent(JTable table, public Component getTableCellRendererComponent(JTable table,
@ -149,6 +155,8 @@ public class ITTableEditorPane<T> extends BasicPane {
component.setBorder(UIManager.getBorder("TableHeader.cellBorder")); component.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return component; return component;
} }
} }

18
designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java

@ -73,7 +73,7 @@ public class SearchJSUtils {
*/ */
private static void addHtmlLabel2Array(List<Pair<VanChartHtmlLabel, String>> arrayList, ChartCollection collection) { private static void addHtmlLabel2Array(List<Pair<VanChartHtmlLabel, String>> arrayList, ChartCollection collection) {
for (int i = 0; i < collection.getChartCount(); i++) { for (int i = 0; i < collection.getChartCount(); i++) {
if (collection.getChart(i) instanceof VanChart){ if (collection.getChart(i) instanceof VanChart) {
VanChart chart = ((VanChart) collection.getChart(i)); VanChart chart = ((VanChart) collection.getChart(i));
int size = chart.getPlot().getConditionCollection().getConditionAttrSize(); int size = chart.getPlot().getConditionCollection().getConditionAttrSize();
ConditionCollection conditionCollection = chart.getPlot().getConditionCollection(); ConditionCollection conditionCollection = chart.getPlot().getConditionCollection();
@ -152,23 +152,23 @@ public class SearchJSUtils {
for (int t = 0; t < conditionSize; t++) { for (int t = 0; t < conditionSize; t++) {
DataSeriesCondition condition = conditionAttr.getDataSeriesCondition(t); DataSeriesCondition condition = conditionAttr.getDataSeriesCondition(t);
String str = Toolkit.i18nText("Fine-Design_Chart_Animation_Special") + "-" + Toolkit.i18nText("Fine-Design_Chart_Condition_Display"); String str = Toolkit.i18nText("Fine-Design_Chart_Animation_Special") + "-" + Toolkit.i18nText("Fine-Design_Chart_Condition_Display");
if (StringUtils.isNotEmpty(conditionAttr.getName())){ if (StringUtils.isNotEmpty(conditionAttr.getName())) {
str += "-"+conditionAttr.getName(); str += "-" + conditionAttr.getName();
} }
if (condition instanceof AttrTooltip) { if (condition instanceof AttrTooltip) {
arrayList.add(new Pair<>(((AttrTooltip) condition).getContent().getHtmlLabel(), str+"-"+Toolkit.i18nText("Fine-Design_Chart_Data_Point_Tooltip"))); arrayList.add(new Pair<>(((AttrTooltip) condition).getContent().getHtmlLabel(), str + "-" + Toolkit.i18nText("Fine-Design_Chart_Data_Point_Tooltip")));
} }
if (condition instanceof AttrLabel){ if (condition instanceof AttrLabel) {
AttrLabel label = (AttrLabel) condition; AttrLabel label = (AttrLabel) condition;
if (isAttrLabelValid(label)){ if (isAttrLabelValid(label)) {
arrayList.add(new Pair<>(label.getContent().getHtmlLabel(), str+"-"+Toolkit.i18nText("Fine-Design_Chart_Label"))); arrayList.add(new Pair<>(label.getContent().getHtmlLabel(), str + "-" + Toolkit.i18nText("Fine-Design_Chart_Label")));
} }
} }
} }
} }
private static boolean isAttrLabelValid(AttrLabel label){ private static boolean isAttrLabelValid(AttrLabel label) {
return label.isEnable() && label.getContent() != null && label.getContent().getHtmlLabel() != null; return label.isEnable() && label.getContent() != null && label.getContent().getHtmlLabel() != null;
} }
@ -181,7 +181,7 @@ public class SearchJSUtils {
public static List<NameJavaScript> getNameJavaScript(ChartCollection chartCollection) { public static List<NameJavaScript> getNameJavaScript(ChartCollection chartCollection) {
ArrayList<NameJavaScript> nameJavaScriptArrayList = new ArrayList<>(); ArrayList<NameJavaScript> nameJavaScriptArrayList = new ArrayList<>();
for (int i = 0; i < chartCollection.getChartCount(); i++) { for (int i = 0; i < chartCollection.getChartCount(); i++) {
if (chartCollection.getChart(i) instanceof VanChart){ if (chartCollection.getChart(i) instanceof VanChart) {
VanChart chart = ((VanChart) chartCollection.getChart(i)); VanChart chart = ((VanChart) chartCollection.getChart(i));
NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink(); NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink();
addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup); addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup);

Loading…
Cancel
Save