package com.fr.design; import com.fr.base.Parameter; import com.fr.base.io.BaseBook; import com.fr.data.TableDataSource; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplateProvider; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; import com.fr.stable.js.WidgetName; import java.util.Iterator; import java.util.List; import java.util.Map; /** * 设计器模式 FormModel or WorkBookModel *
* 指的是编辑的模板是普通报表还是决策报表
*
* @author zhou
* @since 2012-7-26上午11:24:54
*/
public abstract class DesignModelAdapter
* 由于在参数面板拖动过程中频繁获取
* 远程设计时数据集参数rpc 调用需要考虑网络等因素,因此会比较缓慢,引起参数面板拖动卡顿,
* 所以缓存一下,并且在参数改动时及时缓存
*
* @return Parameter[] 模板的所有参数
*/
public Parameter[] getParameters() {
return parameters == null ? new Parameter[0] : parameters;
}
/**
* 模板参数(报表参数)
*
* 既然全部参数都,那么这个也缓存一下,并且在参数改动时及时缓存
*
* @return Parameter[] 模板参数
* @deprecated use {@link DesignModelAdapter#getTemplateParameters()} instead
*/
@Deprecated
public Parameter[] getReportParameters() {
return getTemplateParameters();
}
/**
* 模板参数(报表参数)
*
* 既然全部参数都,那么这个也缓存一下,并且在参数改动时及时缓存
*
* @return Parameter[] 模板参数
*/
public Parameter[] getTemplateParameters() {
return templateParameters == null ? new Parameter[0] : templateParameters;
}
/**
* 数据源参数
*
* 既然全部参数都,那么这个也缓存一下,并且在参数改动时及时缓存
*
* @return Parameter[] 数据源参数
*/
public Parameter[] getTableDataParameters() {
return tableDataParameters == null ? new Parameter[0] : tableDataParameters;
}
/**
* 重命名TableData后的一些操作
*
* @param oldName 旧名字
* @param newName 新名字.
* @return 返回是否名字一样.
*/
public boolean renameTableData(String oldName, String newName) {
return renameTableData(oldName, newName, true);
}
/**
* 重命名数据集
*
* @param oldName 旧名字
* @param newName 新名字
* @param isNeedFireModified 是否需要触发保存
* @return 重命名成功返回True
*/
public boolean renameTableData(String oldName, String newName, boolean isNeedFireModified) {
if (!ComparatorUtils.equals(oldName, newName)) {
TableDataSource tds = getBook();
boolean b;
b = tds.renameTableData(oldName, newName);
if (!b) {
return b;
}
if (isNeedFireModified) {
fireTargetModified();
}
}
return true;
}
/**
* 重命名tabledata
*
* @param map 新名字
*/
public void renameTableData(Map