|
|
|
package com.fanruan.api.design;
|
|
|
|
|
|
|
|
import com.fr.base.TableData;
|
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane;
|
|
|
|
import com.fr.design.file.HistoryTemplateListPane;
|
|
|
|
import com.fr.design.i18n.Toolkit;
|
|
|
|
import com.fr.design.mainframe.DesignerBean;
|
|
|
|
import com.fr.design.mainframe.DesignerContext;
|
|
|
|
import com.fr.design.mainframe.DesignerFrame;
|
|
|
|
import com.fr.design.mainframe.JTemplate;
|
|
|
|
|
|
|
|
public class DesignKit {
|
|
|
|
/**
|
|
|
|
* 直接预览数据集,没有实际值及显示值
|
|
|
|
*
|
|
|
|
* @param tableData 数据集
|
|
|
|
*/
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 单例模式,返回DesignerFrame对象
|
|
|
|
*
|
|
|
|
* @return DesignerFrame对象
|
|
|
|
*/
|
|
|
|
public static DesignerFrame getDesignerFrame() {
|
|
|
|
return DesignerContext.getDesignerFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 得到当前在修改的模板
|
|
|
|
*
|
|
|
|
* @return 返回当前正在编辑的模板
|
|
|
|
*/
|
|
|
|
public static JTemplate<?, ?> getCurrentEditingTemplate() {
|
|
|
|
return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据名字获取已经定义的bean对象
|
|
|
|
*
|
|
|
|
* @param name bean的名字
|
|
|
|
* @return bean对象
|
|
|
|
*/
|
|
|
|
public static DesignerBean getDesignerBean(String name) {
|
|
|
|
return DesignerContext.getDesignerBean(name);
|
|
|
|
}
|
|
|
|
}
|