forked from fanruan/finekit
Browse Source
* 'master' of https://cloud.finedevelop.com/scm/tc/finekit: KERNEL-1165 将标记为open的类删掉 KERNEL-1165 新增包装类 增加几个常量 脚本公式API 脚本公式API 更多的API 更多的API 组件兼容 兼容问题 KERNEL-1118 删除一个不用修改的地方 KERNEL-1118 按照要求去除不需要更改的地方,以及修改Constants接口。 KERNEL-1118 将插件中设计到的能包装的类全部加一层包装。 KERNEL-1118 将插件中设计到的能包装的类全部加一层包装。 # Conflicts: # src/main/java/com/fanruan/api/design/macro/UIConstants.java # src/main/java/com/fanruan/api/design/ui/toolbar/ToolBarDef.javapull/1/head
zjz1993
5 years ago
34 changed files with 834 additions and 72 deletions
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
<attribute name="test" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
<attribute name="test" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="output" path="target/classes"/> |
||||
</classpath> |
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>finekit</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.m2e.core.maven2Builder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1 |
||||
org.eclipse.jdt.apt.aptEnabled=false |
@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1 |
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 |
||||
org.eclipse.jdt.core.compiler.compliance=1.8 |
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled |
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning |
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore |
||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled |
||||
org.eclipse.jdt.core.compiler.release=disabled |
||||
org.eclipse.jdt.core.compiler.source=1.8 |
@ -0,0 +1,4 @@
|
||||
activeProfiles= |
||||
eclipse.preferences.version=1 |
||||
resolveWorkspaceProjects=true |
||||
version=1 |
@ -0,0 +1,41 @@
|
||||
package com.fanruan.api.conf; |
||||
|
||||
import com.fr.config.Configuration; |
||||
import com.fr.config.holder.ConfigChangeListener; |
||||
import com.fr.transaction.Configurations; |
||||
import com.fr.transaction.ValidateProxy; |
||||
import com.fr.transaction.WorkerFacade; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
* 配置监听管理器 |
||||
*/ |
||||
public class ConfigurationKit { |
||||
|
||||
/** |
||||
* 注册监听配置变化的监听器 |
||||
* |
||||
* @param listener 监听器 |
||||
*/ |
||||
public static void registerListener(ConfigChangeListener listener) { |
||||
ValidateProxy.getInstance().getValidateManager().registerListener(listener); |
||||
} |
||||
|
||||
/** |
||||
* 保存配置 |
||||
* |
||||
* @param type 配置的类型 |
||||
* @param action 保存动作 |
||||
*/ |
||||
public static void modify(Class<? extends Configuration> type, Runner action) { |
||||
Configurations.modify(new WorkerFacade(type) { |
||||
@Override |
||||
public void run() { |
||||
action.run(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fanruan.api.conf; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
*/ |
||||
public interface Runner { |
||||
|
||||
void run(); |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fanruan.api.conf.xml; |
||||
|
||||
import com.fr.config.holder.Conf; |
||||
import com.fr.config.holder.impl.xml.XmlConf; |
||||
import com.fr.stable.xml.XMLable; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
* 将xml文件写入fine_conf_entity的帮助类,不建议使用 |
||||
*/ |
||||
public class XmlHolderKit { |
||||
|
||||
/** |
||||
* 创建一个要写入配置的xml多项 |
||||
* @param t 配置对象 |
||||
* @param clazz 类型 |
||||
* @param xmlTag xml标签 |
||||
* @param <T> 类型 |
||||
* @return 配置对象 |
||||
*/ |
||||
public static <T extends XMLable> Conf<T> obj(T t, Class<T> clazz, String xmlTag) { |
||||
return new XmlConf(t, clazz, xmlTag); |
||||
} |
||||
} |
@ -0,0 +1,72 @@
|
||||
package com.fanruan.api.design.ui.component; |
||||
|
||||
import com.fanruan.api.design.macro.UIConstants; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.border.TitledBorder; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
* 带标题的边框 |
||||
*/ |
||||
public class UITitledBorder extends TitledBorder { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public static UITitledBorder createBorderWithTitle(String title) { |
||||
return new UITitledBorder(title); |
||||
} |
||||
|
||||
public static UITitledBorder createBorderWithTitle(String title, int roundedCorner) { |
||||
return new UITitledBorder(title, roundedCorner); |
||||
} |
||||
|
||||
private UITitledBorder(String title) { |
||||
super( |
||||
BorderFactory.createCompoundBorder( |
||||
BorderFactory.createEmptyBorder( |
||||
0, |
||||
0, |
||||
5, |
||||
0), |
||||
new UIRoundedBorder( |
||||
UIConstants.TITLED_BORDER_COLOR, |
||||
1, |
||||
10) |
||||
), |
||||
title, |
||||
TitledBorder.LEADING, |
||||
TitledBorder.TOP, |
||||
null, |
||||
new Color(1, 159, 222) |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @param title title |
||||
* @param roundedCorner corner width 圆弧宽度,即圆角直径 |
||||
*/ |
||||
private UITitledBorder(String title, int roundedCorner) { |
||||
super( |
||||
BorderFactory.createCompoundBorder( |
||||
BorderFactory.createEmptyBorder( |
||||
0, |
||||
0, |
||||
5, |
||||
0), |
||||
new UIRoundedBorder( |
||||
UIConstants.TITLED_BORDER_COLOR, |
||||
1, |
||||
roundedCorner) |
||||
), |
||||
title, |
||||
TitledBorder.LEADING, |
||||
TitledBorder.TOP, |
||||
null, |
||||
new Color(1, 159, 222) |
||||
); |
||||
} |
||||
} |
@ -1,4 +1,4 @@
|
||||
package com.fanruan.api.design.ui.container; |
||||
|
||||
public abstract class BasicBeanPane extends com.fr.design.beans.BasicBeanPane{ |
||||
public abstract class BasicBeanPane<T> extends com.fr.design.beans.BasicBeanPane<T> { |
||||
} |
||||
|
@ -1,36 +1,40 @@
|
||||
package com.fanruan.api.design.ui.container; |
||||
|
||||
import com.fanruan.api.design.ui.container.BasicPane; |
||||
|
||||
import java.awt.*; |
||||
|
||||
public class BasicDialog extends com.fr.design.dialog.BasicDialog{ |
||||
public BasicDialog(Dialog parent){ |
||||
public class BasicDialog extends com.fr.design.dialog.BasicDialog { |
||||
|
||||
public BasicDialog(Dialog parent) { |
||||
super(parent); |
||||
} |
||||
|
||||
public BasicDialog(Dialog parent, BasicPane pane){ |
||||
public BasicDialog(Dialog parent, BasicPane pane) { |
||||
super(parent, pane); |
||||
} |
||||
|
||||
public BasicDialog(Dialog parent, BasicPane pane, boolean isNeedButton){ |
||||
public BasicDialog(Dialog parent, BasicPane pane, boolean isNeedButton) { |
||||
super(parent, pane, isNeedButton); |
||||
} |
||||
|
||||
public BasicDialog(Frame parent){ |
||||
public BasicDialog(Frame parent) { |
||||
super(parent); |
||||
} |
||||
|
||||
public BasicDialog(Frame parent, BasicPane pane){ |
||||
public BasicDialog(Frame parent, BasicPane pane) { |
||||
super(parent, pane); |
||||
} |
||||
|
||||
public BasicDialog(Frame parent, BasicPane pane, boolean isNedButtonPane){ |
||||
public BasicDialog(Frame parent, BasicPane pane, boolean isNedButtonPane) { |
||||
super(parent, pane, isNedButtonPane); |
||||
} |
||||
|
||||
@Override |
||||
public void checkValid(){ |
||||
protected void setBasicDialogSize(Dimension dimension) { |
||||
super.setBasicDialogSize(dimension); |
||||
} |
||||
|
||||
@Override |
||||
public void checkValid() throws Exception { |
||||
|
||||
} |
||||
} |
||||
|
@ -1,5 +1,98 @@
|
||||
package com.fanruan.api.design.ui.container; |
||||
|
||||
|
||||
import com.fanruan.api.design.util.GUICoreKit; |
||||
import com.fr.design.dialog.DialogActionListener; |
||||
import com.fr.design.dialog.UIDialog; |
||||
|
||||
import java.awt.*; |
||||
|
||||
public abstract class BasicPane extends com.fr.design.dialog.BasicPane { |
||||
|
||||
/** |
||||
* 显示窗口 |
||||
* |
||||
* @param window 窗口 |
||||
* @return 对话框 |
||||
*/ |
||||
public BasicDialog showWindow(Window window) { |
||||
return this.showWindow(window, null); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 显示窗口 |
||||
* |
||||
* @param window 窗口 |
||||
* @param l 对话框监听器 |
||||
* @return 对话框 |
||||
*/ |
||||
public BasicDialog showWindow(Window window, DialogActionListener l) { |
||||
return showWindowWithCustomSize(window, l, BasicDialog.DEFAULT); |
||||
} |
||||
|
||||
public BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) { |
||||
BasicDialog dg; |
||||
if (window instanceof Frame) { |
||||
dg = new DIALOG((Frame) window); |
||||
} else { |
||||
dg = new DIALOG((Dialog) window); |
||||
} |
||||
|
||||
if (l != null) { |
||||
dg.addDialogActionListener(l); |
||||
} |
||||
dg.setBasicDialogSize(dimension); |
||||
GUICoreKit.centerWindow(dg); |
||||
dg.setResizable(false); |
||||
return dg; |
||||
} |
||||
|
||||
private class DIALOG extends BasicDialog { |
||||
public DIALOG(Frame parent) { |
||||
super(parent, BasicPane.this); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
public DIALOG(Dialog parent) { |
||||
super(parent, BasicPane.this); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
|
||||
public DIALOG(Frame parent, boolean isNeedButtonPane) { |
||||
super(parent, BasicPane.this, isNeedButtonPane); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
|
||||
public DIALOG(Dialog parent, boolean isNeedButtonPane) { |
||||
super(parent, BasicPane.this, isNeedButtonPane); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
|
||||
public void checkValid() throws Exception { |
||||
BasicPane.this.checkValid(); |
||||
} |
||||
|
||||
} |
||||
|
||||
private class UnsizedDialog extends UIDialog { |
||||
|
||||
public UnsizedDialog(Frame parent) { |
||||
super(parent, BasicPane.this); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
public UnsizedDialog(Dialog parent) { |
||||
super(parent, BasicPane.this); |
||||
this.setTitle(BasicPane.this.title4PopupWindow()); |
||||
} |
||||
|
||||
|
||||
public void checkValid() throws Exception { |
||||
BasicPane.this.checkValid(); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,8 +1,8 @@
|
||||
package com.fanruan.api.design.ui.container; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
|
||||
public class DialogActionAdapter extends com.fr.design.dialog.DialogActionAdapter{ |
||||
public DialogActionAdapter(){ |
||||
public class DialogActionAdapter extends com.fr.design.dialog.DialogActionAdapter { |
||||
|
||||
public DialogActionAdapter() { |
||||
|
||||
} |
||||
} |
||||
|
@ -1,10 +1,36 @@
|
||||
package com.fanruan.api.design.ui.toolbar; |
||||
|
||||
/* |
||||
* 用来定义工具栏 |
||||
* */ |
||||
public class ToolBarDef extends com.fr.design.menu.ToolBarDef{ |
||||
public ToolBarDef() { |
||||
|
||||
import com.fanruan.api.design.ui.component.UIToolbar; |
||||
import com.fr.design.gui.itoolbar.UIToolBarUI; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
*/ |
||||
public class ToolBarDef extends com.fr.design.menu.ToolBarDef { |
||||
|
||||
public static UIToolbar createJToolBar(final Color background) { |
||||
UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT); |
||||
toolbar.setUI(new UIToolBarUI() { |
||||
@Override |
||||
public void paint(Graphics g, JComponent c) { |
||||
Graphics2D g2 = (Graphics2D) g; |
||||
g2.setColor(background); |
||||
g2.fillRect(0, 0, c.getWidth(), c.getHeight()); |
||||
} |
||||
}); |
||||
toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); |
||||
return toolbar; |
||||
} |
||||
|
||||
public static UIToolbar createJToolBar() { |
||||
UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT); |
||||
toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); |
||||
return toolbar; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,12 @@
|
||||
package com.fanruan.api.design.work; |
||||
|
||||
import com.fr.base.TableData; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-30 |
||||
* 数据插件继承此抽象类 |
||||
*/ |
||||
public abstract class AbstractTableDataPane<T extends TableData> extends com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane<T> { |
||||
} |
@ -1,7 +1,249 @@
|
||||
package com.fanruan.api.design.work; |
||||
|
||||
|
||||
import com.fanruan.api.design.ui.component.UIButton; |
||||
import com.fanruan.api.design.ui.component.UIComboBox; |
||||
import com.fanruan.api.design.ui.component.UILabel; |
||||
import com.fanruan.api.design.ui.container.BasicBeanPane; |
||||
import com.fanruan.api.log.LogKit; |
||||
import com.fanruan.api.macro.EncodeConstants; |
||||
import com.fanruan.api.util.ArrayKit; |
||||
import com.fanruan.api.util.StringKit; |
||||
import com.fr.data.impl.Connection; |
||||
import com.fr.data.impl.JDBCDatabaseConnection; |
||||
import com.fr.data.impl.JNDIDatabaseConnection; |
||||
import com.fr.data.operator.DataOperator; |
||||
import com.fr.design.data.datapane.connect.JDBCDefPane; |
||||
import com.fr.design.data.datapane.connect.JNDIDefPane; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.scrollruler.ModLineBorder; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
|
||||
import javax.swing.*; |
||||
public abstract class DatabaseConnectionPane extends com.fr.design.data.datapane.connect.DatabaseConnectionPane{ |
||||
import java.awt.*; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
import java.awt.event.WindowAdapter; |
||||
import java.awt.event.WindowEvent; |
||||
|
||||
/** |
||||
* 数据连接面板 |
||||
* |
||||
* @param <E> 数据连接类型 |
||||
*/ |
||||
public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connection> extends BasicBeanPane<Connection> { |
||||
|
||||
private UILabel message; |
||||
private UIButton okButton; |
||||
private UIButton cancelButton; |
||||
private JDialog dialog; |
||||
private UILabel uiLabel; |
||||
|
||||
private UIComboBox<String> charSetComboBox; |
||||
private String originalCharSet = null; |
||||
|
||||
public DatabaseConnectionPane() { |
||||
this.initComponents(); |
||||
} |
||||
|
||||
protected void initComponents() { |
||||
message = new UILabel(); |
||||
uiLabel = new UILabel(); |
||||
okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); |
||||
cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); |
||||
String[] defaultEncode = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encode_Auto")}; |
||||
charSetComboBox = new UIComboBox<>(ArrayKit.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY)); |
||||
this.setLayout(new BorderLayout()); |
||||
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); |
||||
this.add(northPane, BorderLayout.NORTH); |
||||
|
||||
JPanel testPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
||||
northPane.add(testPane, BorderLayout.NORTH); |
||||
UIButton testButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); |
||||
testPane.add(testButton); |
||||
testButton.addActionListener(testConnectionActionListener); |
||||
testPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 4)); |
||||
|
||||
northPane.add(mainPanel(), BorderLayout.CENTER); |
||||
|
||||
JPanel chartSetPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); |
||||
northPane.add(chartSetPane); |
||||
chartSetPane.setBorder(BorderFactory.createTitledBorder( |
||||
new ModLineBorder(ModLineBorder.TOP), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced") |
||||
)); |
||||
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":")); |
||||
} |
||||
|
||||
protected abstract JPanel mainPanel(); |
||||
|
||||
@Override |
||||
public void populateBean(com.fr.data.impl.Connection ob) { |
||||
this.originalCharSet = ob.getOriginalCharsetName(); |
||||
if (StringKit.isBlank(originalCharSet)) { |
||||
this.charSetComboBox.setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encode_Auto")); |
||||
} else { |
||||
this.charSetComboBox.setSelectedItem(ob.getOriginalCharsetName()); |
||||
} |
||||
|
||||
populateSubDatabaseConnectionBean((E) ob); |
||||
} |
||||
|
||||
protected abstract void populateSubDatabaseConnectionBean(E ob); |
||||
|
||||
@Override |
||||
public com.fr.data.impl.Connection updateBean() { |
||||
E ob = updateSubDatabaseConnectionBean(); |
||||
|
||||
ob.setOriginalCharsetName(this.originalCharSet); |
||||
if (this.charSetComboBox.getSelectedIndex() == 0) { |
||||
ob.setNewCharsetName(null); |
||||
ob.setOriginalCharsetName(null); |
||||
} else { |
||||
ob.setNewCharsetName(EncodeConstants.ENCODING_GBK); |
||||
ob.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem())); |
||||
|
||||
} |
||||
|
||||
return ob; |
||||
} |
||||
|
||||
protected abstract E updateSubDatabaseConnectionBean(); |
||||
|
||||
ActionListener testConnectionActionListener = new ActionListener() { |
||||
public void actionPerformed(ActionEvent evt) { |
||||
|
||||
final SwingWorker connectionThread = new SwingWorker() { |
||||
protected Object doInBackground() throws Exception { |
||||
try { |
||||
com.fr.data.impl.Connection database = DatabaseConnectionPane.this.updateBean(); |
||||
boolean connect = DataOperator.getInstance().testConnection(database); |
||||
okButton.setEnabled(true); |
||||
message.setText(database.connectMessage(connect)); |
||||
if (connect) { |
||||
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); |
||||
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); |
||||
} else { |
||||
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); |
||||
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); |
||||
} |
||||
} catch (Exception exp) { |
||||
LogKit.error(exp.getMessage(), exp); |
||||
} |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
connectionThread.execute(); |
||||
initDialogPane(); |
||||
okButton.addActionListener(new ActionListener() { |
||||
public void actionPerformed(ActionEvent e) { |
||||
dialog.dispose(); |
||||
} |
||||
}); |
||||
cancelButton.addActionListener(new ActionListener() { |
||||
public void actionPerformed(ActionEvent e) { |
||||
dialog.dispose(); |
||||
connectionThread.cancel(true); |
||||
} |
||||
}); |
||||
|
||||
dialog.addWindowListener(new WindowAdapter() { |
||||
public void windowClosed(WindowEvent e) { |
||||
connectionThread.cancel(true); |
||||
} |
||||
}); |
||||
|
||||
dialog.show(); |
||||
dialog.dispose(); |
||||
} |
||||
}; |
||||
|
||||
private void initDialogPane() { |
||||
|
||||
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection") + "..."); |
||||
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0)); |
||||
okButton.setEnabled(false); |
||||
|
||||
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(DatabaseConnectionPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"), true); |
||||
dialog.setSize(new Dimension(268, 118)); |
||||
okButton.setEnabled(false); |
||||
JPanel jp = new JPanel(); |
||||
JPanel upPane = new JPanel(); |
||||
JPanel downPane = new JPanel(); |
||||
uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); |
||||
|
||||
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
||||
upPane.add(uiLabel); |
||||
upPane.add(message); |
||||
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
||||
downPane.add(okButton); |
||||
downPane.add(cancelButton); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
jp.add(upPane); |
||||
jp.add(downPane); |
||||
dialog.add(jp); |
||||
dialog.setResizable(false); |
||||
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(DatabaseConnectionPane.this)); |
||||
} |
||||
|
||||
|
||||
public static class JDBC extends com.fr.design.data.datapane.connect.DatabaseConnectionPane<JDBCDatabaseConnection> { |
||||
private static JDBCDefPane jdbcDefPane = new JDBCDefPane(); |
||||
|
||||
@Override |
||||
protected JPanel mainPanel() { |
||||
return jdbcDefPane; |
||||
} |
||||
|
||||
@Override |
||||
protected boolean isFineBI() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
protected void populateSubDatabaseConnectionBean(JDBCDatabaseConnection ob) { |
||||
jdbcDefPane.populate(ob); |
||||
} |
||||
|
||||
@Override |
||||
protected JDBCDatabaseConnection updateSubDatabaseConnectionBean() { |
||||
return jdbcDefPane.update(); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "JDBC"; |
||||
} |
||||
} |
||||
|
||||
public static class JNDI extends com.fr.design.data.datapane.connect.DatabaseConnectionPane<JNDIDatabaseConnection> { |
||||
private static JNDIDefPane jndiDefPane = new JNDIDefPane(); |
||||
|
||||
@Override |
||||
protected JPanel mainPanel() { |
||||
return jndiDefPane; |
||||
} |
||||
|
||||
@Override |
||||
protected boolean isFineBI() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
protected void populateSubDatabaseConnectionBean(JNDIDatabaseConnection ob) { |
||||
jndiDefPane.populate(ob); |
||||
} |
||||
|
||||
@Override |
||||
protected JNDIDatabaseConnection updateSubDatabaseConnectionBean() { |
||||
return jndiDefPane.update(); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "JNDI"; |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,4 +1,15 @@
|
||||
package com.fanruan.api.err; |
||||
|
||||
public class UtilEvalError extends com.fr.stable.UtilEvalError{ |
||||
/** |
||||
* 公式计算异常 |
||||
*/ |
||||
public class UtilEvalError extends com.fr.stable.UtilEvalError { |
||||
|
||||
public UtilEvalError() { |
||||
|
||||
} |
||||
|
||||
public UtilEvalError(String message) { |
||||
super(message); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,23 @@
|
||||
package com.fanruan.api.macro; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-09-02 |
||||
* 常量 |
||||
*/ |
||||
public interface Constants { |
||||
|
||||
int CENTER = 0; |
||||
|
||||
int TOP = 1; |
||||
|
||||
|
||||
int LEFT = 2; |
||||
|
||||
|
||||
int BOTTOM = 3; |
||||
|
||||
|
||||
int RIGHT = 4; |
||||
} |
Loading…
Reference in new issue