Browse Source

REPORT-80695 【模板全局级别查找替换二期】更改部分静态,删减多余代码

feature/x
Destiny.Lin 2 years ago
parent
commit
c015116670
  1. 6
      designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java
  2. 12
      designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java
  3. 12
      designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java
  4. 28
      designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java
  5. 8
      designer-realize/src/main/java/com/fr/design/actions/replace/info/DataSourceInfo.java
  6. 20
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  7. 11
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java

6
designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java

@ -8,7 +8,7 @@ import com.fr.design.actions.replace.action.setting.action.SearchCellFormatActio
import com.fr.design.actions.replace.action.setting.action.SearchConnectionAction; import com.fr.design.actions.replace.action.setting.action.SearchConnectionAction;
import com.fr.design.actions.replace.action.setting.action.SearchDSColumnAction; import com.fr.design.actions.replace.action.setting.action.SearchDSColumnAction;
import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.CellInfo;
import com.fr.design.actions.replace.info.ConnectionInfo; import com.fr.design.actions.replace.info.DataSourceInfo;
import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.ui.ITReplaceNorthPanel; import com.fr.design.actions.replace.ui.ITReplaceNorthPanel;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -224,10 +224,10 @@ public enum SettingController implements ShowValue {
@Override @Override
public List<? extends Info> addMatchResult(List<? extends Info> list, String settingStr, String extraStr) { public List<? extends Info> addMatchResult(List<? extends Info> list, String settingStr, String extraStr) {
List<ConnectionInfo> connectionInfos = new ArrayList<>(); List<DataSourceInfo> connectionInfos = new ArrayList<>();
for (Info info : list) { for (Info info : list) {
if (StringUtils.equals(info.getContent().getShowStr(), settingStr)) { if (StringUtils.equals(info.getContent().getShowStr(), settingStr)) {
connectionInfos.add((ConnectionInfo) info); connectionInfos.add((DataSourceInfo) info);
} }
} }
return connectionInfos; return connectionInfos;

12
designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java

@ -6,7 +6,7 @@ import com.fr.data.TableDataSource;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.actions.replace.action.SearchAction; import com.fr.design.actions.replace.action.SearchAction;
import com.fr.design.actions.replace.info.ConnectionInfo; import com.fr.design.actions.replace.info.DataSourceInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
@ -25,7 +25,7 @@ import java.util.Map;
* created by Destiny.Lin on 2022-10-26 * created by Destiny.Lin on 2022-10-26
*/ */
public class SearchConnectionAction implements SearchAction { public class SearchConnectionAction implements SearchAction {
private List<ConnectionInfo> connectionInfos = new ArrayList<>(); private List<DataSourceInfo> connectionInfos = new ArrayList<>();
private SearchConnectionAction() { private SearchConnectionAction() {
@ -34,7 +34,7 @@ public class SearchConnectionAction implements SearchAction {
@Override @Override
public void search4Infos(JTemplate jTemplate) { public void search4Infos(JTemplate jTemplate) {
List<ConnectionInfo> connectionInfos = new ArrayList<>(); List<DataSourceInfo> connectionInfos = new ArrayList<>();
Map<String, Connection> map = ConnectionConfig.getInstance().getConnections(); Map<String, Connection> map = ConnectionConfig.getInstance().getConnections();
Map<String, Connection> needMap = new HashMap<>(); Map<String, Connection> needMap = new HashMap<>();
TableDataSource source = (TableDataSource) jTemplate.getTarget(); TableDataSource source = (TableDataSource) jTemplate.getTarget();
@ -55,7 +55,7 @@ public class SearchConnectionAction implements SearchAction {
content.setTemplateName(jTemplate.getTemplateName()); content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false); content.setJumpAble(false);
content.setShowStr(name); content.setShowStr(name);
connectionInfos.add(new ConnectionInfo(content)); connectionInfos.add(new DataSourceInfo(content));
} }
setConnectionInfos(connectionInfos); setConnectionInfos(connectionInfos);
} }
@ -70,11 +70,11 @@ public class SearchConnectionAction implements SearchAction {
return data instanceof TableDataConnection && ((TableDataConnection) data).getDatabase() instanceof NameDatabaseConnection; return data instanceof TableDataConnection && ((TableDataConnection) data).getDatabase() instanceof NameDatabaseConnection;
} }
public List<ConnectionInfo> getConnectionInfos() { public List<DataSourceInfo> getConnectionInfos() {
return connectionInfos; return connectionInfos;
} }
public void setConnectionInfos(List<ConnectionInfo> connectionInfos) { public void setConnectionInfos(List<DataSourceInfo> connectionInfos) {
this.connectionInfos = connectionInfos; this.connectionInfos = connectionInfos;
} }

12
designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java

@ -3,7 +3,7 @@ package com.fr.design.actions.replace.action.setting.action;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.actions.replace.action.SearchAction; import com.fr.design.actions.replace.action.SearchAction;
import com.fr.design.actions.replace.info.DSColumnInfo; import com.fr.design.actions.replace.info.DataSourceInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -19,7 +19,7 @@ import java.util.List;
* created by Destiny.Lin on 2022-10-26 * created by Destiny.Lin on 2022-10-26
*/ */
public class SearchDSColumnAction implements SearchAction { public class SearchDSColumnAction implements SearchAction {
private List<DSColumnInfo> dsColumnInfos = new ArrayList<>(); private List<DataSourceInfo> dsColumnInfos = new ArrayList<>();
private SearchDSColumnAction() { private SearchDSColumnAction() {
@ -27,7 +27,7 @@ public class SearchDSColumnAction implements SearchAction {
@Override @Override
public void search4Infos(JTemplate jTemplate) { public void search4Infos(JTemplate jTemplate) {
List<DSColumnInfo> dsColumnInfos = new ArrayList<>(); List<DataSourceInfo> dsColumnInfos = new ArrayList<>();
TableDataSource source = (TableDataSource) jTemplate.getTarget(); TableDataSource source = (TableDataSource) jTemplate.getTarget();
Iterator dataIterator = source.getTableDataNameIterator(); Iterator dataIterator = source.getTableDataNameIterator();
while (dataIterator.hasNext()) { while (dataIterator.hasNext()) {
@ -38,16 +38,16 @@ public class SearchDSColumnAction implements SearchAction {
content.setReplaceObject(data); content.setReplaceObject(data);
content.setShowStr(dataName); content.setShowStr(dataName);
content.setTemplateName(jTemplate.getTemplateName()); content.setTemplateName(jTemplate.getTemplateName());
dsColumnInfos.add(new DSColumnInfo(content)); dsColumnInfos.add(new DataSourceInfo(content));
setDsColumnInfos(dsColumnInfos); setDsColumnInfos(dsColumnInfos);
} }
} }
public List<DSColumnInfo> getDsColumnInfos() { public List<DataSourceInfo> getDsColumnInfos() {
return dsColumnInfos; return dsColumnInfos;
} }
public void setDsColumnInfos(List<DSColumnInfo> dsColumnInfos) { public void setDsColumnInfos(List<DataSourceInfo> dsColumnInfos) {
this.dsColumnInfos = dsColumnInfos; this.dsColumnInfos = dsColumnInfos;
} }

28
designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java

@ -1,28 +0,0 @@
package com.fr.design.actions.replace.info;
import com.fr.design.actions.replace.info.base.ITContent;
/**
* 存储数据列
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-10-26
*/
public class DSColumnInfo implements Info {
private ITContent content;
public DSColumnInfo(ITContent content) {
this.content = content;
}
@Override
public ITContent getContent() {
return content;
}
public void setContent(ITContent content) {
this.content = content;
}
}

8
designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java → designer-realize/src/main/java/com/fr/design/actions/replace/info/DataSourceInfo.java

@ -3,17 +3,17 @@ package com.fr.design.actions.replace.info;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
/** /**
* 存储数据连接 * 存储数据源相关的信息后续数据源部分如果有自己额外的信息把这个当成父类进行拓展即可
* *
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-10-26 * created by Destiny.Lin on 2022-10-28
*/ */
public class ConnectionInfo implements Info { public class DataSourceInfo implements Info{
private ITContent content; private ITContent content;
public ConnectionInfo(ITContent content) { public DataSourceInfo(ITContent content) {
this.content = content; this.content = content;
} }

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

@ -214,7 +214,7 @@ public class ITReplaceMainDialog extends UIDialog {
Toolkit.i18nText("Fine-Design_Replace_Message"), Toolkit.i18nText("Fine-Design_Replace_Message"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.ERROR_MESSAGE, JOptionPane.WARNING_MESSAGE,
null, null,
// 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框)
options, options,
@ -437,7 +437,7 @@ public class ITReplaceMainDialog extends UIDialog {
Toolkit.i18nText("Fine-Design_Replace_Message"), Toolkit.i18nText("Fine-Design_Replace_Message"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.ERROR_MESSAGE, JOptionPane.WARNING_MESSAGE,
null, null,
// 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框)
options, options,
@ -535,8 +535,12 @@ public class ITReplaceMainDialog extends UIDialog {
return searchContentResultList; return searchContentResultList;
} }
public void setSearchContentResultList(List<? extends Info> searchContentResultList) { /**
this.searchContentResultList = searchContentResultList; * 设置模板内容数据
* @param searchContentResultList 模板内容表格的数据
*/
public static void setSearchContentResultList(List<? extends Info> searchContentResultList) {
ITReplaceMainDialog.searchContentResultList = searchContentResultList;
} }
/** /**
@ -547,8 +551,12 @@ public class ITReplaceMainDialog extends UIDialog {
return searchSettingResultList; return searchSettingResultList;
} }
public void setSearchSettingResultList(List<? extends Info> searchSettingResultList) { /**
this.searchSettingResultList = searchSettingResultList; * 设置设置项的数据
* @param searchSettingResultList 设置项表格的数据
*/
public static void setSearchSettingResultList(List<? extends Info> searchSettingResultList) {
ITReplaceMainDialog.searchSettingResultList = searchSettingResultList;
} }
/** /**

11
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java

@ -14,7 +14,7 @@ import java.awt.Color;
*/ */
public class ITReplaceSouthPanel { public class ITReplaceSouthPanel {
ITTableEditorPane tableEditorPane; ITTableEditorPane tableEditorPane;
public static ITTableEditor itTableEditor; private static ITTableEditor itTableEditor;
//勾选框索引 //勾选框索引
public static final int CHECKBOX_INDEX = 0; public static final int CHECKBOX_INDEX = 0;
//ITContent在表格的列索引 //ITContent在表格的列索引
@ -56,7 +56,12 @@ public class ITReplaceSouthPanel {
return itTableEditor; return itTableEditor;
} }
public void setItTableEditor(ITTableEditor itTableEditor) { /**
this.itTableEditor = itTableEditor; * 设置表格的editor可用于刷新表格的数据
*
* @param itTableEditor 表格的editor
*/
public static void setItTableEditor(ITTableEditor itTableEditor) {
ITReplaceSouthPanel.itTableEditor = itTableEditor;
} }
} }

Loading…
Cancel
Save