Browse Source

esd-design内置融合

research/11.0
rinoux 3 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() {
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.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.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.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.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.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);
JPanel row1 = GUICoreUtils.createFlowPane(new Component[]{
this.selectAutoUpdate,
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.updateIntervalCheckTips
}, 0, 5);
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() {
@Override
public void actionPerformed(ActionEvent e) {
@ -220,6 +220,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
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.DesignTableDataManager;
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.tabledatapane.AbstractTableDataPane;
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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WestRegionContainerPane;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
@ -56,7 +50,6 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
@ -609,7 +602,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override
public String getName() {
return Toolkit.i18nText("ESD_Batch-Enable");
return Toolkit.i18nText("Fine-Design_ESD_Batch_Enable");
}
@Override
@ -656,7 +649,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override
public String getName() {
return Toolkit.i18nText("ESD_Batch-Disable");
return Toolkit.i18nText("Fine-Design_ESD_Batch_Disable");
}
@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.impl.Connection;
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.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -119,8 +121,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{
com.fr.data.impl.JDBCDatabaseConnection.class,
com.fr.data.impl.JNDIDatabaseConnection.class
JDBCDatabaseConnection.class,
JNDIDatabaseConnection.class
});
}
@ -258,14 +260,14 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
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.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.setForeground(Color.RED);
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() {
@ -301,12 +303,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
});
this.configFromList.setSelectedIndex(DBTableDataPane.ConfigFrom.GLOBAL.getIndex());
this.configFromList.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setEsdEnabled();
}
});
this.configFromList.addActionListener(e -> setEsdEnabled());
UIToolbar editToolBar = ToolBarDef.createJToolBar();
toolBarDef.updateToolBar(editToolBar);
@ -405,7 +402,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
Connection db = dbTableData.getDatabase();
String query = dbTableData.getQuery();
boolean isShare = dbTableData.isShare();
this.pageQuery = dbTableData.getPageQuerySql();
this.connectionTableProcedurePane.setSelectedDatabaseConnection(db);
this.sqlTextPane.setText(query);
@ -433,19 +429,19 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
protected StrategyConfig mapStrategyConfig(DBTableData dbTableData) {
//获取配置,如果是模版数据集,dbTableData实例应该是ESDBTableData,如果是服务器数据集是DBTableData
//获取配置,如果是模版数据集,dbTableData实例应该是DBTableData,如果是服务器数据集是DBTableData
StrategyConfig strategyConfig = null;
if (dbTableData instanceof DBTableData) {
if (dbTableData != null) {
//设置保存数据集的事件检查钩子
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath();
//新建模版此时不存在,不需要注册钩子
if (((DBTableData) dbTableData).getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) {
((DBTableData) dbTableData).setXmlSavedHook(new ESDBTableDataSavedHook(tplPath, (DBTableData) dbTableData));
if (dbTableData.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) {
dbTableData.setXmlSavedHook(new DBTableDataSavedHook(tplPath, dbTableData));
}
//获取当前的缓存配置,没有就创建一份
String dsName = ((DBTableData) this.dbTableData).getDsName();
String dsName = this.dbTableData.getDsName();
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName);
if (strategyConfig == null && dbTableData.isShare()) {
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true);
@ -603,9 +599,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
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;
@ -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;
@ -648,11 +644,11 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private String origQuery;
public ESDBTableDataSavedHook(String tplPath, DBTableData origESDBTableData) {
public DBTableDataSavedHook(String tplPath, DBTableData origDBTableData) {
this.tplPath = tplPath;
this.origName = origESDBTableData.getDsName();
this.origConnection = origESDBTableData.getDatabase().toString();
this.origQuery = origESDBTableData.getQuery();
this.origName = origDBTableData.getDsName();
this.origConnection = origDBTableData.getDatabase().toString();
this.origQuery = origDBTableData.getQuery();
}
@Override

Loading…
Cancel
Save