|
|
|
@ -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<String, BaseFormula> 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<String, BaseFormula> 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<String, BaseFormula> hyperLinkEditorMap) { |
|
|
|
|
List<Editor> 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<Editor> createEditors4Chart(HashMap hyperLinkEditorMap) { |
|
|
|
|
private static List<Editor> createEditors4Chart(Map<String, BaseFormula> hyperLinkEditorMap) { |
|
|
|
|
List<Editor> lists = new ArrayList<>(); |
|
|
|
|
if (hyperLinkEditorMap == null) { |
|
|
|
|
return lists; |
|
|
|
|