Browse Source

esd-design内置融合

research/11.0
rinoux 4 years ago
parent
commit
8eaff4a29a
  1. 18
      designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java
  2. 11
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 44
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

18
designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java

@ -56,18 +56,18 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private void init() { private void init() {
setLayout(FRGUIPaneFactory.createM_BorderLayout()); setLayout(FRGUIPaneFactory.createM_BorderLayout());
this.selectAutoUpdate = new UIRadioButton(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Every-Interval")); this.selectAutoUpdate = new UIRadioButton(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Every_Interval"));
this.updateInterval = new UITextField(4); this.updateInterval = new UITextField(4);
this.shouldEvolve = new UICheckBox(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Auto-Evolved-Strategy"), false); this.shouldEvolve = new UICheckBox(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Auto_Evolved_Strategy"), false);
this.shouldEvolve.setEnabled(false); this.shouldEvolve.setEnabled(false);
this.updateIntervalCheckTips = new UILabel(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Error-Interval-Format")); this.updateIntervalCheckTips = new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Interval_Format"));
this.updateIntervalCheckTips.setForeground(Color.RED); this.updateIntervalCheckTips.setForeground(Color.RED);
this.updateIntervalCheckTips.setVisible(false); this.updateIntervalCheckTips.setVisible(false);
this.selectBySchema = new UIRadioButton(InterProviderFactory.getProvider().getLocText("ESD_Config-pane-Cron")); this.selectBySchema = new UIRadioButton(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cron"));
this.schemaTime = new UITextField(10); this.schemaTime = new UITextField(10);
this.schemaTimeCheckTips = new UILabel(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Error-Time-Format")); this.schemaTimeCheckTips = new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.schemaTimeCheckTips.setVisible(false); this.schemaTimeCheckTips.setVisible(false);
this.schemaTimeCheckTips.setForeground(Color.RED); this.schemaTimeCheckTips.setForeground(Color.RED);
@ -90,19 +90,19 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
} }
}); });
JPanel pane = FRGUIPaneFactory.createVerticalTitledBorderPane(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Cache-Update-Strategy")); JPanel pane = FRGUIPaneFactory.createVerticalTitledBorderPane(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Update_Strategy"));
add(pane, BorderLayout.NORTH); add(pane, BorderLayout.NORTH);
JPanel row1 = GUICoreUtils.createFlowPane(new Component[]{ JPanel row1 = GUICoreUtils.createFlowPane(new Component[]{
this.selectAutoUpdate, this.selectAutoUpdate,
this.updateInterval, this.updateInterval,
new UILabel(InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Minute-Update-Cache")), new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Minute_Update_Cache")),
this.shouldEvolve, this.shouldEvolve,
this.updateIntervalCheckTips this.updateIntervalCheckTips
}, 0, 5); }, 0, 5);
pane.add(row1); pane.add(row1);
ActionLabel actionLabel = new ActionLabel(InterProviderFactory.getProvider().getLocText("ESD_config-pane-Cron-Help")); ActionLabel actionLabel = new ActionLabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cron_Help"));
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -220,6 +220,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
protected String title4PopupWindow() { protected String title4PopupWindow() {
return InterProviderFactory.getProvider().getLocText("ESD_Config-Pane-Cache-Strategy-Config-Title"); return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title");
} }
} }

11
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -12,11 +12,6 @@ import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.DesignerStrategyConfigUtils; import com.fr.design.data.DesignerStrategyConfigUtils;
import com.fr.design.data.datapane.TableDataCreatorProducer;
import com.fr.design.data.datapane.TableDataNameObjectCreator;
import com.fr.design.data.datapane.TableDataSourceOP;
import com.fr.design.data.datapane.TableDataTree;
import com.fr.design.data.datapane.TableDataTreeDragSource;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane; import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane;
@ -37,7 +32,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WestRegionContainerPane;
import com.fr.design.menu.LineSeparator; import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
@ -56,7 +50,6 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -609,7 +602,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public String getName() { public String getName() {
return Toolkit.i18nText("ESD_Batch-Enable"); return Toolkit.i18nText("Fine-Design_ESD_Batch_Enable");
} }
@Override @Override
@ -656,7 +649,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public String getName() { public String getName() {
return Toolkit.i18nText("ESD_Batch-Disable"); return Toolkit.i18nText("Fine-Design_ESD_Batch_Disable");
} }
@Override @Override

44
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -5,6 +5,8 @@ import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -119,8 +121,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
protected void filter(Connection connection, String conName, List<String> nameList) { protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{ connection.addConnection(nameList, conName, new Class[]{
com.fr.data.impl.JDBCDatabaseConnection.class, JDBCDatabaseConnection.class,
com.fr.data.impl.JNDIDatabaseConnection.class JNDIDatabaseConnection.class
}); });
} }
@ -258,14 +260,14 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
toolBarDef.addShortCut(this.dbTableDataMenuHandler.createQueryAction()); toolBarDef.addShortCut(this.dbTableDataMenuHandler.createQueryAction());
} }
UILabel esdSettingsLabel = new UILabel(Toolkit.i18nText("ESD_DBTableData-Pane-Cache-Settings")); UILabel esdSettingsLabel = new UILabel(Toolkit.i18nText("Fine-Design_ESD_Cache_Settings"));
this.configFromList = new UIComboBox(ConfigFrom.values()); this.configFromList = new UIComboBox(ConfigFrom.values());
this.esdEnabled = new UICheckBox(Toolkit.i18nText("ESD_DBTableData-Pane-Enable-Cache")); this.esdEnabled = new UICheckBox(Toolkit.i18nText("Fine-Design_ESD_Enable_Cache"));
this.barErrorTips = new UILabel(); this.barErrorTips = new UILabel();
this.barErrorTips.setForeground(Color.RED); this.barErrorTips.setForeground(Color.RED);
this.barErrorTips.setVisible(false); this.barErrorTips.setVisible(false);
esdSettingsBtn = new UIButton(Toolkit.i18nText("ESD_DBTableData-Pane-Strategy-Config")); esdSettingsBtn = new UIButton(Toolkit.i18nText("Fine-Design_ESD_Strategy_Config"));
esdSettingsBtn.addActionListener(new ActionListener() { esdSettingsBtn.addActionListener(new ActionListener() {
@ -301,12 +303,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}); });
this.configFromList.setSelectedIndex(DBTableDataPane.ConfigFrom.GLOBAL.getIndex()); this.configFromList.setSelectedIndex(DBTableDataPane.ConfigFrom.GLOBAL.getIndex());
this.configFromList.addActionListener(new ActionListener() { this.configFromList.addActionListener(e -> setEsdEnabled());
@Override
public void actionPerformed(ActionEvent e) {
setEsdEnabled();
}
});
UIToolbar editToolBar = ToolBarDef.createJToolBar(); UIToolbar editToolBar = ToolBarDef.createJToolBar();
toolBarDef.updateToolBar(editToolBar); toolBarDef.updateToolBar(editToolBar);
@ -405,7 +402,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
Connection db = dbTableData.getDatabase(); Connection db = dbTableData.getDatabase();
String query = dbTableData.getQuery(); String query = dbTableData.getQuery();
boolean isShare = dbTableData.isShare();
this.pageQuery = dbTableData.getPageQuerySql(); this.pageQuery = dbTableData.getPageQuerySql();
this.connectionTableProcedurePane.setSelectedDatabaseConnection(db); this.connectionTableProcedurePane.setSelectedDatabaseConnection(db);
this.sqlTextPane.setText(query); this.sqlTextPane.setText(query);
@ -433,19 +429,19 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
protected StrategyConfig mapStrategyConfig(DBTableData dbTableData) { protected StrategyConfig mapStrategyConfig(DBTableData dbTableData) {
//获取配置,如果是模版数据集,dbTableData实例应该是ESDBTableData,如果是服务器数据集是DBTableData //获取配置,如果是模版数据集,dbTableData实例应该是DBTableData,如果是服务器数据集是DBTableData
StrategyConfig strategyConfig = null; StrategyConfig strategyConfig = null;
if (dbTableData instanceof DBTableData) { if (dbTableData != null) {
//设置保存数据集的事件检查钩子 //设置保存数据集的事件检查钩子
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath(); String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath();
//新建模版此时不存在,不需要注册钩子 //新建模版此时不存在,不需要注册钩子
if (((DBTableData) dbTableData).getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) { if (dbTableData.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) {
((DBTableData) dbTableData).setXmlSavedHook(new ESDBTableDataSavedHook(tplPath, (DBTableData) dbTableData)); dbTableData.setXmlSavedHook(new DBTableDataSavedHook(tplPath, dbTableData));
} }
//获取当前的缓存配置,没有就创建一份 //获取当前的缓存配置,没有就创建一份
String dsName = ((DBTableData) this.dbTableData).getDsName(); String dsName = this.dbTableData.getDsName();
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName); strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName);
if (strategyConfig == null && dbTableData.isShare()) { if (strategyConfig == null && dbTableData.isShare()) {
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true); strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true);
@ -603,9 +599,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
enum ConfigFrom { enum ConfigFrom {
GLOBAL(0, Toolkit.i18nText("ESD_DBTableData-Pane-Use-Global-Settings")), GLOBAL(0, Toolkit.i18nText("Fine-Design_ESD_Use_Global_Settings")),
INDIVIDUAL(1, Toolkit.i18nText("ESD_DBTableData-Pane-Use-Individual-Settings")); INDIVIDUAL(1, Toolkit.i18nText("Fine-Design_ESD_Use_Individual_Settings"));
int index; int index;
@ -637,7 +633,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
private static class ESDBTableDataSavedHook implements XMLSavedHook<DBTableData> { private static class DBTableDataSavedHook implements XMLSavedHook<DBTableData> {
private static final long serialVersionUID = 4925391747683335372L; private static final long serialVersionUID = 4925391747683335372L;
@ -648,11 +644,11 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private String origQuery; private String origQuery;
public ESDBTableDataSavedHook(String tplPath, DBTableData origESDBTableData) { public DBTableDataSavedHook(String tplPath, DBTableData origDBTableData) {
this.tplPath = tplPath; this.tplPath = tplPath;
this.origName = origESDBTableData.getDsName(); this.origName = origDBTableData.getDsName();
this.origConnection = origESDBTableData.getDatabase().toString(); this.origConnection = origDBTableData.getDatabase().toString();
this.origQuery = origESDBTableData.getQuery(); this.origQuery = origDBTableData.getQuery();
} }
@Override @Override

Loading…
Cancel
Save