|
|
|
@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel;
|
|
|
|
|
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.gui.ilable.ActionLabel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
@ -90,9 +91,9 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
private IntegerEditor DBCP_MAX_WAIT = new IntegerEditor(); |
|
|
|
|
private UITextField DBCP_VALIDATION_QUERY = new UITextField(); |
|
|
|
|
|
|
|
|
|
private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")}); |
|
|
|
|
|
|
|
|
|
private IntegerEditor DBCP_TIMEBETWEENEVICTIONRUNSMILLS = new IntegerEditor(); |
|
|
|
|
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); |
|
|
|
@ -120,13 +121,13 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
userNameTextField.setName(USER_NAME); |
|
|
|
|
passwordTextField = new UIPasswordFieldWithFixedLength(15); |
|
|
|
|
dbtypeButton = new UIButton("."); |
|
|
|
|
dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL")); |
|
|
|
|
dbtypeButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL")); |
|
|
|
|
dbtypeButton.addActionListener(dbtypeButtonActionListener); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
JPanel dbtypePane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
dbtypePane.add(new UILabel((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database") + ":"))); |
|
|
|
|
dbtypePane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Database") + ":"))); |
|
|
|
|
JPanel dbtypeComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
Component[][] dbtypeComComponents = {{dbtypeComboBox}}; |
|
|
|
|
double[] dbtypeRowSize = {p}; |
|
|
|
@ -134,10 +135,10 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
dbtypeComPane = TableLayoutHelper.createTableLayoutPane(dbtypeComComponents, dbtypeRowSize, dbtypeColumnSize); |
|
|
|
|
|
|
|
|
|
JPanel driverPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
driverPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Driver") + ":")); |
|
|
|
|
driverPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Driver") + ":")); |
|
|
|
|
// 选择ODBC数据源的时候的提示链接
|
|
|
|
|
JPanel odbcTipsPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
odbcTipsLink = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")) { |
|
|
|
|
odbcTipsLink = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")) { |
|
|
|
|
@Override |
|
|
|
|
public void paintComponent(Graphics _gfx) { |
|
|
|
|
super.paintComponent(_gfx); |
|
|
|
@ -146,7 +147,7 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
odbcTipsPane.add(odbcTipsLink); |
|
|
|
|
odbcTipsLink.setPreferredSize(new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")), odbcTipsLink.getPreferredSize().height)); |
|
|
|
|
odbcTipsLink.setPreferredSize(new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")), odbcTipsLink.getPreferredSize().height)); |
|
|
|
|
odbcTipsLink.addActionListener(new ActionListener() { |
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
|
String url = CloudCenter.getInstance().acquireUrlByKind("odbc.help"); |
|
|
|
@ -167,26 +168,27 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
urlComPane = TableLayoutHelper.createCommonTableLayoutPane(urlComComponents, urlRowSize, urlColumnSize, 4); |
|
|
|
|
|
|
|
|
|
JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
userPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName") + ":")); |
|
|
|
|
userPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_UserName") + ":")); |
|
|
|
|
JPanel userComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}}; |
|
|
|
|
Component[][] userComComponents = {{userNameTextField, new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}}; |
|
|
|
|
double[] userRowSize = {p}; |
|
|
|
|
double[] userColumnSize = {f, p, f}; |
|
|
|
|
userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4); |
|
|
|
|
|
|
|
|
|
JPanel passwordPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":")); |
|
|
|
|
passwordPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password") + ":")); |
|
|
|
|
|
|
|
|
|
Component[][] components = {{dbtypePane, dbtypeComPane}, {driverPane, driverComboBoxAndTips}, {urlPane, urlComPane}, {userPane, userComPane},}; |
|
|
|
|
|
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f, 22}; |
|
|
|
|
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); |
|
|
|
|
// REPORT-41450 Windows环境的jdk11下dpi为125%时会因为缩放导致显示问题,因此加个水平gap值
|
|
|
|
|
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 6, 6); |
|
|
|
|
innerthis.add(centerPanel); |
|
|
|
|
JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
innerthis.add(southPanel); |
|
|
|
|
southPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 4, 20)); |
|
|
|
|
ActionLabel actionLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr")); |
|
|
|
|
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr")); |
|
|
|
|
southPanel.add(actionLabel, BorderLayout.EAST); |
|
|
|
|
actionLabel.addActionListener(new ActionListener() { |
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
@ -331,7 +333,7 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), ("Access"))) { |
|
|
|
|
// ben:这个能不能换种处理方案- -
|
|
|
|
|
JFileChooser filechooser = new JFileChooser(); |
|
|
|
|
filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open")); |
|
|
|
|
filechooser.setDialogTitle(Toolkit.i18nText("Fine-Design_Basic_Open")); |
|
|
|
|
filechooser.setMultiSelectionEnabled(false); |
|
|
|
|
filechooser.addChoosableFileFilter(new ChooseFileFilter(new String[]{"accdb", "mdb"}, "Microsoft Office Access")); |
|
|
|
|
int result = filechooser.showOpenDialog(DesignerContext.getDesignerFrame()); |
|
|
|
@ -373,19 +375,19 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
double[] rowSize = {f, f, f, f, f, f, f, f, f, f, f, f}; |
|
|
|
|
double[] columnSize = {f, f}; |
|
|
|
|
Component[][] comps = { |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Initial_Size") + ":", SwingConstants.RIGHT), DBCP_INITIAL_SIZE}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Idle") + ":", SwingConstants.RIGHT), DBCP_MAX_IDLE}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Min_Idle") + ":", SwingConstants.RIGHT), DBCP_MIN_IDLE}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.RIGHT), DBCP_MAX_WAIT}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.RIGHT), DBCP_TESTONBORROW}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Return") + ":", SwingConstants.RIGHT), DBCP_TESTONRETURN}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_While_Idle") + ":", SwingConstants.RIGHT), DBCP_TESTWHILEIDLE}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis") + ":", SwingConstants.RIGHT), |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Initial_Size") + ":", SwingConstants.RIGHT), DBCP_INITIAL_SIZE}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Idle") + ":", SwingConstants.RIGHT), DBCP_MAX_IDLE}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Min_Idle") + ":", SwingConstants.RIGHT), DBCP_MIN_IDLE}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.RIGHT), DBCP_MAX_WAIT}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.RIGHT), DBCP_TESTONBORROW}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Return") + ":", SwingConstants.RIGHT), DBCP_TESTONRETURN}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_While_Idle") + ":", SwingConstants.RIGHT), DBCP_TESTWHILEIDLE}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis") + ":", SwingConstants.RIGHT), |
|
|
|
|
DBCP_TIMEBETWEENEVICTIONRUNSMILLS}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run") + ":", SwingConstants.RIGHT), DBCP_NUMTESTSPEREVICTIONRUN}, |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis") + ":", SwingConstants.RIGHT), |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run") + ":", SwingConstants.RIGHT), DBCP_NUMTESTSPEREVICTIONRUN}, |
|
|
|
|
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis") + ":", SwingConstants.RIGHT), |
|
|
|
|
DBCP_MINEVICTABLEIDLETIMEMILLIS}}; |
|
|
|
|
|
|
|
|
|
JPanel contextPane = TableLayoutHelper.createGapTableLayoutPane(comps, rowSize, columnSize, 10, 4); |
|
|
|
@ -395,7 +397,7 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected String title4PopupWindow() { |
|
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr"); |
|
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|