From 51707f46458173c358d7d454ad455ec787072e67 Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 28 Aug 2019 19:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/design/DesignKit.java | 20 +++ .../api/design/ui/action/UpdateAction.java | 8 +- .../api/design/ui/component/UISpinner.java | 18 +++ .../api/design/ui/component/UITable.java | 35 ++++++ .../ui/component/code/SyntaxConstants.java | 15 +++ .../ui/component/table/UITableEditorPane.java | 5 +- .../table/model/ParameterTableModel.java | 39 +++--- .../table/model/UITableModelAdapter.java | 9 +- .../api/design/ui/editor/ValueEditors.java | 117 ++++++------------ .../api/design/util/I18nDesignKit.java | 31 ----- 10 files changed, 154 insertions(+), 143 deletions(-) create mode 100644 src/main/java/com/fanruan/api/design/ui/component/UISpinner.java create mode 100644 src/main/java/com/fanruan/api/design/ui/component/UITable.java delete mode 100644 src/main/java/com/fanruan/api/design/util/I18nDesignKit.java diff --git a/src/main/java/com/fanruan/api/design/DesignKit.java b/src/main/java/com/fanruan/api/design/DesignKit.java index ca39118..267c9cb 100644 --- a/src/main/java/com/fanruan/api/design/DesignKit.java +++ b/src/main/java/com/fanruan/api/design/DesignKit.java @@ -2,6 +2,7 @@ package com.fanruan.api.design; import com.fr.base.TableData; import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.i18n.Toolkit; public class DesignKit { /** @@ -11,4 +12,23 @@ public class DesignKit { public static void previewTableData(TableData tableData){ PreviewTablePane.previewTableData(tableData, -1, -1); } + + /** + * 文本国际化 + * @param key 国际化键 + * @return 国际化后的值 + */ + public static String i18nText(String key) { + return Toolkit.i18nText(key); + } + + /** + * 带参数的文本国际化 + * @param key 国际化键 + * @param args 参数 + * @return 国际化后的值 + */ + public static String i18nText(String key, Object... args) { + return Toolkit.i18nText(key, args); + } } diff --git a/src/main/java/com/fanruan/api/design/ui/action/UpdateAction.java b/src/main/java/com/fanruan/api/design/ui/action/UpdateAction.java index ce788ba..3a2bdf3 100644 --- a/src/main/java/com/fanruan/api/design/ui/action/UpdateAction.java +++ b/src/main/java/com/fanruan/api/design/ui/action/UpdateAction.java @@ -1,8 +1,8 @@ package com.fanruan.api.design.ui.action; -import java.awt.event.ActionEvent; +/** + * 用于各种菜单动作实现的抽象类 + */ +public abstract class UpdateAction extends com.fr.design.actions.UpdateAction { -public class UpdateAction extends com.fr.design.actions.UpdateAction{ - @Override - public void actionPerformed(ActionEvent evt) {} } diff --git a/src/main/java/com/fanruan/api/design/ui/component/UISpinner.java b/src/main/java/com/fanruan/api/design/ui/component/UISpinner.java new file mode 100644 index 0000000..1439377 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/component/UISpinner.java @@ -0,0 +1,18 @@ +package com.fanruan.api.design.ui.component; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-08-28 + * 数字滚动控件 + */ +public class UISpinner extends com.fr.design.gui.ispinner.UISpinner { + + public UISpinner(double minValue, double maxValue, double delta) { + super(minValue, maxValue, delta); + } + + public UISpinner(double minValue, double maxValue, double delta, double defaultValue) { + super(minValue, maxValue, delta, defaultValue); + } +} diff --git a/src/main/java/com/fanruan/api/design/ui/component/UITable.java b/src/main/java/com/fanruan/api/design/ui/component/UITable.java new file mode 100644 index 0000000..79adf0a --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/component/UITable.java @@ -0,0 +1,35 @@ +package com.fanruan.api.design.ui.component; + +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-08-28 + * 表格控件 + */ +public class UITable extends com.fr.design.gui.itable.UITable { + + public UITable() { + super(); + } + + public UITable(int columnSize) { + super(columnSize); + } + + /** + * @param values 一个列表,里面装有字符串数组,每个数组代表一行内容 + */ + public UITable(@NotNull List values) { + super(values); + } + + public UITable(int columnSize, boolean needAWTEventListener) { + super(columnSize, needAWTEventListener); + } + + +} diff --git a/src/main/java/com/fanruan/api/design/ui/component/code/SyntaxConstants.java b/src/main/java/com/fanruan/api/design/ui/component/code/SyntaxConstants.java index f2a5756..d49dc7c 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/code/SyntaxConstants.java +++ b/src/main/java/com/fanruan/api/design/ui/component/code/SyntaxConstants.java @@ -8,13 +8,28 @@ package com.fanruan.api.design.ui.component.code; */ public interface SyntaxConstants { + /** + * 普通文本编辑器 + */ String SYNTAX_STYLE_NONE = "text/plain"; + /** + * java编辑器 + */ String SYNTAX_STYLE_JAVA = "text/java"; + /** + * javascript编辑器 + */ String SYNTAX_STYLE_JAVASCRIPT = "text/javascript"; + /** + * sql编辑器 + */ String SYNTAX_STYLE_SQL = "text/sql"; + /** + * 公式编辑器 + */ String SYNTAX_STYLE_FORMULA = "text/formula"; } diff --git a/src/main/java/com/fanruan/api/design/ui/component/table/UITableEditorPane.java b/src/main/java/com/fanruan/api/design/ui/component/table/UITableEditorPane.java index 58990cf..3bff89a 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/table/UITableEditorPane.java +++ b/src/main/java/com/fanruan/api/design/ui/component/table/UITableEditorPane.java @@ -7,13 +7,14 @@ import com.fanruan.api.design.ui.component.table.model.UITableModelAdapter; * @author richie * @version 10.0 * Created by richie on 2019-08-28 + * 可增、删、改的表格控件 */ public class UITableEditorPane extends com.fr.design.gui.itableeditorpane.UITableEditorPane { - + public UITableEditorPane(UITableModelAdapter adapter) { super(adapter); } - + public UITableEditorPane(UITableModelAdapter adapter, String leftLabelName) { super(adapter, leftLabelName); } diff --git a/src/main/java/com/fanruan/api/design/ui/component/table/model/ParameterTableModel.java b/src/main/java/com/fanruan/api/design/ui/component/table/model/ParameterTableModel.java index 47e14ce..1b358cc 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/table/model/ParameterTableModel.java +++ b/src/main/java/com/fanruan/api/design/ui/component/table/model/ParameterTableModel.java @@ -2,12 +2,12 @@ package com.fanruan.api.design.ui.component.table.model; import com.fanruan.api.cal.ParameterKit; +import com.fanruan.api.design.DesignKit; import com.fanruan.api.design.ui.component.UILabel; import com.fanruan.api.design.ui.component.UITextField; import com.fanruan.api.design.ui.component.table.action.UITableEditAction; import com.fanruan.api.design.ui.editor.ValueEditorPane; import com.fanruan.api.design.ui.editor.ValueEditors; -import com.fanruan.api.design.util.I18nDesignKit; import com.fanruan.api.log.LogKit; import com.fanruan.api.util.IOKit; import com.fanruan.api.util.StringKit; @@ -24,7 +24,7 @@ import java.awt.event.ActionEvent; import java.util.Collections; /** - * 表格模型 + * 编辑参数的表格模型,通常来说就是两列:参数名和参数值 */ public class ParameterTableModel extends UITableModelAdapter { @@ -40,7 +40,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(int paraUseType) { - super(new String[]{I18nDesignKit.i18nText("Fine-Design_Basic_Parameter"), I18nDesignKit.i18nText("Fine-Design_Basic_Value")}); + super(new String[]{DesignKit.i18nText("Fine-Design_Basic_Parameter"), DesignKit.i18nText("Fine-Design_Basic_Value")}); this.setColumnClass(new Class[]{ParameterEditor.class, ParameterValueEditor.class}); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); @@ -48,7 +48,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(int paraUseType, Component component) { - super(new String[]{I18nDesignKit.i18nText("Fine-Design_Basic_Parameter"), I18nDesignKit.i18nText("Fine-Design_Basic_Value")}); + super(new String[]{DesignKit.i18nText("Fine-Design_Basic_Parameter"), DesignKit.i18nText("Fine-Design_Basic_Value")}); this.setColumnClass(new Class[]{ParameterEditor.class, ParameterValueEditor.class}); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); @@ -57,7 +57,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane, Component component) { - super(new String[]{I18nDesignKit.i18nText("Fine-Design_Basic_Parameter"), I18nDesignKit.i18nText("Fine-Design_Basic_Value")}); + super(new String[]{DesignKit.i18nText("Fine-Design_Basic_Parameter"), DesignKit.i18nText("Fine-Design_Basic_Value")}); this.setColumnClass(new Class[]{ParameterEditor.class, ParameterValueEditor.class}); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(valueEditorPane)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); @@ -101,21 +101,10 @@ public class ParameterTableModel extends UITableModelAdapter return new UITableEditAction[]{new AddParameterAction(), new DeleteAction(), new MoveUpAction(), new MoveDownAction()}; } - - /** - * 生成上移下移按钮 - * - * @return UItableEdit数组. - */ - public UITableEditAction[] createDBTableAction() { - return new UITableEditAction[]{new MoveUpAction(), new MoveDownAction()}; - } - - - private class AddParameterAction extends AddTableRowAction { + protected class AddParameterAction extends AddTableRowAction { public AddParameterAction() { - + super(); } @Override @@ -137,12 +126,12 @@ public class ParameterTableModel extends UITableModelAdapter private Component component = null; public DeleteAction() { - this.setName(I18nDesignKit.i18nText("Fine-Design_Report_Delete")); + this.setName(DesignKit.i18nText("Fine-Design_Report_Delete")); this.setSmallIcon(IOKit.readIcon("/com/fr/base/images/cell/control/remove.png")); } public DeleteAction(Component component) { - this.setName(I18nDesignKit.i18nText("Fine-Design_Report_Delete")); + this.setName(DesignKit.i18nText("Fine-Design_Report_Delete")); this.setSmallIcon(IOKit.readIcon("/com/fr/base/images/cell/control/remove.png")); this.component = component; } @@ -151,7 +140,7 @@ public class ParameterTableModel extends UITableModelAdapter public void actionPerformed(ActionEvent e) { int[] selectedRow = table.getSelectedRows(); if (isMultiSelected()) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), I18nDesignKit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), DesignKit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); return; } if (table.getCellEditor() != null) { @@ -169,7 +158,7 @@ public class ParameterTableModel extends UITableModelAdapter component = DesignerContext.getDesignerFrame(); } int val = JOptionPane.showConfirmDialog(component, - I18nDesignKit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", I18nDesignKit.i18nText("Fine-Design_Basic_Remove"), + DesignKit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", DesignKit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (val != JOptionPane.OK_OPTION) { return; @@ -200,7 +189,7 @@ public class ParameterTableModel extends UITableModelAdapter protected class MoveUpAction extends UITableEditAction { public MoveUpAction() { - this.setName(I18nDesignKit.i18nText("Fine-Design_Basic_Utils_Move_Up")); + this.setName(DesignKit.i18nText("Fine-Design_Basic_Utils_Move_Up")); this.setSmallIcon(IOKit.readIcon("/com/fr/design/images/control/up.png")); } @@ -224,7 +213,7 @@ public class ParameterTableModel extends UITableModelAdapter protected class MoveDownAction extends UITableEditAction { public MoveDownAction() { - this.setName(I18nDesignKit.i18nText("Fine-Design_Basic_Utils_Move_Down")); + this.setName(DesignKit.i18nText("Fine-Design_Basic_Utils_Move_Down")); this.setSmallIcon(IOKit.readIcon("/com/fr/design/images/control/down.png")); } @@ -337,7 +326,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterValueRenderer(ValueEditorPane valueEditorPane) { - disableLabel = new UILabel(I18nDesignKit.i18nText("Fine-Design_Basic_Set_Paramete_Name")); + disableLabel = new UILabel(DesignKit.i18nText("Fine-Design_Basic_Set_Paramete_Name")); disableLabel.setForeground(Color.pink); disableLabel.setHorizontalAlignment(SwingConstants.CENTER); diff --git a/src/main/java/com/fanruan/api/design/ui/component/table/model/UITableModelAdapter.java b/src/main/java/com/fanruan/api/design/ui/component/table/model/UITableModelAdapter.java index be67a98..be69b7a 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/table/model/UITableModelAdapter.java +++ b/src/main/java/com/fanruan/api/design/ui/component/table/model/UITableModelAdapter.java @@ -1,7 +1,7 @@ package com.fanruan.api.design.ui.component.table.model; +import com.fanruan.api.design.DesignKit; import com.fanruan.api.design.ui.component.table.action.UITableEditAction; -import com.fanruan.api.design.util.I18nDesignKit; import com.fanruan.api.util.IOKit; import com.fr.design.mainframe.DesignerContext; @@ -12,6 +12,7 @@ import java.awt.event.ActionEvent; * @author richie * @version 10.0 * Created by richie on 2019-08-28 + * */ public abstract class UITableModelAdapter extends com.fr.design.gui.itableeditorpane.UITableModelAdapter { @@ -25,7 +26,7 @@ public abstract class UITableModelAdapter extends com.fr.design.gui.itableedi protected abstract class AddTableRowAction extends UITableEditAction { public AddTableRowAction() { - this.setName(I18nDesignKit.i18nText("Fine-Design_Report_Insert")); + this.setName(DesignKit.i18nText("Fine-Design_Report_Insert")); this.setSmallIcon(IOKit.readIcon("/com/fr/base/images/cell/control/add.png")); } @@ -42,7 +43,7 @@ public abstract class UITableModelAdapter extends com.fr.design.gui.itableedi protected abstract class EditAction extends UITableEditAction { public EditAction() { - this.setName(I18nDesignKit.i18nText("Fine-Design_Report_Edit")); + this.setName(DesignKit.i18nText("Fine-Design_Report_Edit")); this.setSmallIcon(IOKit.readIcon("/com/fr/design/images/control/edit.png")); } @@ -50,7 +51,7 @@ public abstract class UITableModelAdapter extends com.fr.design.gui.itableedi public void actionPerformed(ActionEvent e) { final int selectedRow = table.getSelectedRow(); if (selectedRow > table.getRowCount() - 1 || selectedRow < 0) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), I18nDesignKit.i18nText("Fine-Design_Basic_No-Alternatives")); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), DesignKit.i18nText("Fine-Design_Basic_No-Alternatives")); return; } stopCellEditing(); diff --git a/src/main/java/com/fanruan/api/design/ui/editor/ValueEditors.java b/src/main/java/com/fanruan/api/design/ui/editor/ValueEditors.java index ae7fe0d..4dda75f 100644 --- a/src/main/java/com/fanruan/api/design/ui/editor/ValueEditors.java +++ b/src/main/java/com/fanruan/api/design/ui/editor/ValueEditors.java @@ -1,7 +1,7 @@ package com.fanruan.api.design.ui.editor; +import com.fanruan.api.design.DesignKit; import com.fanruan.api.design.ui.component.table.model.ParameterTableModel; -import com.fanruan.api.design.util.I18nDesignKit; import com.fanruan.api.util.StringKit; import com.fr.base.BaseFormula; import com.fr.design.editor.editor.BooleanEditor; @@ -22,7 +22,6 @@ import com.fr.design.editor.editor.TextEditor; import com.fr.design.editor.editor.WidgetNameEditor; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -85,18 +84,18 @@ public class ValueEditors { * @return 返回公式编辑器面板 */ public static ValueEditorPane createFormulaValueEditorPane() { - return createValueEditorPane(new Editor[]{new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula"))}, + return createValueEditorPane(new Editor[]{new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula"))}, StringKit.EMPTY, StringKit.EMPTY); } /** * 创建基本的值编辑器面板 * - * @param editor_center_width 指定值编辑器的主体宽度 + * @param editorCenterWidth 指定值编辑器的主体宽度 * @return 返回值编辑器面板 */ - public static ValueEditorPane createBasicValueEditorPane(int editor_center_width) { - return createValueEditorPane(basicEditors(), StringKit.EMPTY, StringKit.EMPTY, editor_center_width); + public static ValueEditorPane createBasicValueEditorPane(int editorCenterWidth) { + return createValueEditorPane(basicEditors(), StringKit.EMPTY, StringKit.EMPTY, editorCenterWidth); } /** @@ -108,24 +107,6 @@ public class ValueEditors { return createValueEditorPane(formEditors(), StringKit.EMPTY, StringKit.EMPTY); } - /** - * StoreProced用的EditorPane - * - * @return 值编辑器面板 - */ - public static ValueEditorPane createStoreProcedValueEditorPane() { - return createValueEditorPane(StoreProcedureEditors(), StringKit.EMPTY, StringKit.EMPTY); - } - - /** - * 扩展的ValueEditorPane - * - * @return 值编辑器面板 - */ - public static ValueEditorPane createExtendedValueEditorPane() { - return createValueEditorPane(extendedEditors(), StringKit.EMPTY, StringKit.EMPTY); - } - /** * URL使用的ValueEditorPane * @@ -166,24 +147,6 @@ public class ValueEditors { return createValueEditorPane(basicEditorsWithoutFormula(), StringKit.EMPTY, StringKit.EMPTY); } - /** - * 创建NoCRNoColumn - * - * @return 值编辑器 - */ - public static ValueEditorPane createNoCRNoColumnValueEditorPane() { - return createValueEditorPane(noCRnoColumnEditors(), StringKit.EMPTY, StringKit.EMPTY); - } - - /** - * 创建数值编辑器 - * - * @return 值编辑器 - */ - public static ValueEditorPane createNumberValueEditorPane() { - return createValueEditorPane(numberEditors(), StringKit.EMPTY, StringKit.EMPTY); - } - /** * 创建日期编辑器 * @@ -203,7 +166,7 @@ public class ValueEditors { return createValueEditorPaneWithUseType(paraUseType, null); } - public static ValueEditorPane createValueEditorPaneWithUseType(int paraUseType, HashMap hyperLinkEditorMap) { + public static ValueEditorPane createValueEditorPaneWithUseType(int paraUseType, Map hyperLinkEditorMap) { if (paraUseType == ParameterTableModel.NO_CHART_USE) { return createBasicValueEditorPane(); } else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) { @@ -219,7 +182,7 @@ public class ValueEditors { * @param hyperLinkEditorMap 超链下拉参数类型 * @return 值编辑器 */ - public static ValueEditorPane createChartHotValueEditorPane(HashMap hyperLinkEditorMap) { + public static ValueEditorPane createChartHotValueEditorPane(Map hyperLinkEditorMap) { return createValueEditorPane(chartHotEditors(hyperLinkEditorMap), StringKit.EMPTY, StringKit.EMPTY); } @@ -229,12 +192,12 @@ public class ValueEditors { * @return 值编辑器 */ public static Editor[] basicEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new SpinnerIntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor }; @@ -246,15 +209,15 @@ public class ValueEditors { * @return 值编辑器 */ public static Editor[] formEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor, - new WidgetNameEditor(I18nDesignKit.i18nText("Fine-Design_Report_Widget")) + new WidgetNameEditor(DesignKit.i18nText("Fine-Design_Report_Widget")) }; } @@ -264,16 +227,16 @@ public class ValueEditors { * @return 值编辑器 */ public static Editor[] extendedEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell")) + new ColumnRowEditor(DesignKit.i18nText("Fine-Design_Basic_Cell")) }; } @@ -283,17 +246,17 @@ public class ValueEditors { * @return 值编辑器 */ public static Editor[] extendedCellGroupEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell")), - new ColumnRowGroupEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell_Group")) + new ColumnRowEditor(DesignKit.i18nText("Fine-Design_Basic_Cell")), + new ColumnRowGroupEditor(DesignKit.i18nText("Fine-Design_Basic_Cell_Group")) }; } @@ -304,8 +267,8 @@ public class ValueEditors { */ public static Editor[] cellGroupEditor() { return new Editor[]{ - new ColumnRowEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell")), - new ColumnRowGroupEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell_Group")) + new ColumnRowEditor(DesignKit.i18nText("Fine-Design_Basic_Cell")), + new ColumnRowGroupEditor(DesignKit.i18nText("Fine-Design_Basic_Cell_Group")) }; } @@ -318,7 +281,7 @@ public class ValueEditors { */ public static Editor[] URLEditors(String popupName, String textEditorValue) { return new Editor[]{ - new NoneEditor(textEditorValue, StringKit.isEmpty(popupName) ? I18nDesignKit.i18nText("Fine-Design_Basic_None") : popupName), + new NoneEditor(textEditorValue, StringKit.isEmpty(popupName) ? DesignKit.i18nText("Fine-Design_Basic_None") : popupName), new TextEditor() }; } @@ -332,9 +295,9 @@ public class ValueEditors { */ public static Editor[] dateEditors(String popupName, String textEditorValue) { return new Editor[]{ - new NoneEditor(textEditorValue, StringKit.isEmpty(popupName) ? I18nDesignKit.i18nText("Fine-Design_Basic_None") : popupName), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), - new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")) + new NoneEditor(textEditorValue, StringKit.isEmpty(popupName) ? DesignKit.i18nText("Fine-Design_Basic_None") : popupName), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), + new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")) }; } @@ -344,16 +307,16 @@ public class ValueEditors { * @return 值编辑器 */ public static Editor[] allEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), - new ColumnRowEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Cell")), + new ColumnRowEditor(DesignKit.i18nText("Fine-Design_Basic_Cell")), new ColumnSelectedEditor(), }; } @@ -368,7 +331,7 @@ public class ValueEditors { new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), }; } @@ -379,12 +342,12 @@ public class ValueEditors { * @return 编辑器 */ public static Editor[] noCRnoColumnEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor, new ParameterEditor(), @@ -397,7 +360,7 @@ public class ValueEditors { * @return 编辑器 */ public static Editor[] numberEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ new IntegerEditor(), new DoubleEditor(), @@ -412,9 +375,9 @@ public class ValueEditors { * @return 编辑器 */ public static Editor[] dateEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); return new Editor[]{ - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), formulaEditor, new ParameterEditor(), }; @@ -426,14 +389,14 @@ public class ValueEditors { * @return 存储过程的编辑器 */ public static Editor[] StoreProcedureEditors() { - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); formulaEditor.setEnabled(true); return new Editor[]{ new CursorEditor(), new TextEditor(), new IntegerEditor(), new DoubleEditor(), - new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date")), + new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date")), new BooleanEditor(), formulaEditor }; @@ -444,16 +407,16 @@ public class ValueEditors { * * @return 值编辑器 */ - public static Editor[] chartHotEditors(HashMap hyperLinkEditorMap) { + public static Editor[] chartHotEditors(Map hyperLinkEditorMap) { List list = createEditors4Chart(hyperLinkEditorMap); list.add(new TextEditor()); list.add(new IntegerEditor()); list.add(new DoubleEditor()); - list.add(new DateEditor(true, I18nDesignKit.i18nText("Fine-Design_Basic_Date"))); + list.add(new DateEditor(true, DesignKit.i18nText("Fine-Design_Basic_Date"))); list.add(new BooleanEditor()); - FormulaEditor formulaEditor = new FormulaEditor(I18nDesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); + FormulaEditor formulaEditor = new FormulaEditor(DesignKit.i18nText("Fine-Design_Basic_Parameter_Formula")); formulaEditor.setEnabled(true); list.add(formulaEditor); @@ -465,7 +428,7 @@ public class ValueEditors { * * @return 值编辑器 */ - private static List createEditors4Chart(HashMap hyperLinkEditorMap) { + private static List createEditors4Chart(Map hyperLinkEditorMap) { List lists = new ArrayList<>(); if (hyperLinkEditorMap == null) { return lists; diff --git a/src/main/java/com/fanruan/api/design/util/I18nDesignKit.java b/src/main/java/com/fanruan/api/design/util/I18nDesignKit.java deleted file mode 100644 index 32a39ea..0000000 --- a/src/main/java/com/fanruan/api/design/util/I18nDesignKit.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.fanruan.api.design.util; - -import com.fr.design.i18n.Toolkit; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-08-28 - * 设计器国际化工具类,设计器相关类的国际化都需要调用这个类才行 - */ -public class I18nDesignKit { - - /** - * 文本国际化 - * @param key 国际化键 - * @return 国际化后的值 - */ - public static String i18nText(String key) { - return Toolkit.i18nText(key); - } - - /** - * 带参数的文本国际化 - * @param key 国际化键 - * @param args 参数 - * @return 国际化后的值 - */ - public static String i18nText(String key, Object... args) { - return Toolkit.i18nText(key, args); - } -}