Browse Source

Merge pull request #5389 in DESIGN/design from release/11.0 to feature/x

* commit 'f0b2070a45c0522c75f5436b0897ea5cf5984bf4':
  REPORT-56686 远程设计权限管理看不到cptx 加上.后缀
  REPORT-56686 远程设计权限管理看不到cptx
  撤销
  REPORT-57147 设计器模版默认预览方式不生效
  REPORT-57209 共享数据集显示配置兼容
  REPORT-51472 平台开启的模版读不到状态的问题
  REPORT-56128【开发者预览支持调整模板布局】新自适应-设计画布里拖拽调整组件A大小,挤压绝对画布块,绝对画布块内组件会保持尺寸不变且超出绝对画布块;但开发者调试下,此场景,绝对画布块内组件尺寸适应区域调整。这里要不要统一一下效果啊@kerry
  REPORT-55481 模板Web属性的顶部和底部工具栏在权限编辑时,顶部工具栏被底部工具栏覆盖
research/11.0
superman 3 years ago
parent
commit
677ae1a706
  1. 22
      designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java
  2. 16
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 37
      designer-base/src/main/java/com/fr/design/data/tabledata/strategy/StrategyConfigHandler.java
  4. 131
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  5. 70
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/ServerStrategyConfigHandler.java
  6. 16
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/StrategyConfigHandler.java
  7. 50
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/TemplateStrategyConfigHandler.java
  8. 2
      designer-base/src/main/java/com/fr/design/remote/ui/AuthorityEditorPane.java
  9. 28
      designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java
  10. 3
      designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java
  11. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerESDActivator.java

22
designer-base/src/main/java/com/fr/design/data/DesignerStrategyConfigUtils.java → designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java

@ -5,6 +5,7 @@ import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.esd.core.strategy.config.StrategyConfig; import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.core.strategy.config.StrategyConfigHelper; import com.fr.esd.core.strategy.config.StrategyConfigHelper;
import com.fr.esd.core.strategy.config.service.StrategyConfigService;
import com.fr.esd.core.strategy.persistence.StrategyConfigsAttr; import com.fr.esd.core.strategy.persistence.StrategyConfigsAttr;
import com.fr.esd.event.DSMapping; import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.DsNameTarget;
@ -25,7 +26,7 @@ import java.util.Set;
* @version 10.0 * @version 10.0
* Created by rinoux on 2020/10/28 * Created by rinoux on 2020/10/28
*/ */
public class DesignerStrategyConfigUtils { public class StrategyConfigAttrUtils {
/** /**
* 获取当前编辑模版的数据集缓存配置属性 * 获取当前编辑模版的数据集缓存配置属性
@ -55,25 +56,6 @@ public class DesignerStrategyConfigUtils {
} }
/**
* 当前编辑的模版是否被批量开启
*
* @return
*/
public static boolean isEditingTemplateRecommended() {
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
FILE file = jTemplate.getEditingFILE();
if (file != null) {
String path = file.getPath();
return StrategyConfigHelper.recommended(path);
}
}
return false;
}
/** /**
* 获取模版数据集配置 * 获取模版数据集配置
* *

16
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -11,7 +11,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.DesignerStrategyConfigUtils; import com.fr.design.data.StrategyConfigAttrUtils;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane; import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane;
@ -291,10 +291,10 @@ public class TableDataTreePane extends BasicTableDataTreePane {
editingConfig.setDsName(tdName); editingConfig.setDsName(tdName);
if (!ComparatorUtils.equals(oldName, tdName)) { if (!ComparatorUtils.equals(oldName, tdName)) {
//重命名 //重命名
DesignerStrategyConfigUtils.removeStrategyConfig(oldName); StrategyConfigAttrUtils.removeStrategyConfig(oldName);
} }
DesignerStrategyConfigUtils.addStrategyConfig(editingConfig); StrategyConfigAttrUtils.addStrategyConfig(editingConfig);
} }
((DBTableData) td).setDsName(tdName); ((DBTableData) td).setDsName(tdName);
} }
@ -588,7 +588,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
if (wrapper.getTableData() instanceof DBTableData) { if (wrapper.getTableData() instanceof DBTableData) {
DBTableData td = (DBTableData) wrapper.getTableData(); DBTableData td = (DBTableData) wrapper.getTableData();
StrategyConfig config = DesignerStrategyConfigUtils.getStrategyConfig(wrapper.getTableDataName()); StrategyConfig config = StrategyConfigAttrUtils.getStrategyConfig(wrapper.getTableDataName());
if (config == null) { if (config == null) {
result.put(td, td.isShare() ? ESDStatus.SINGLE_ON : ESDStatus.SINGLE_OFF); result.put(td, td.isShare() ? ESDStatus.SINGLE_ON : ESDStatus.SINGLE_OFF);
} else { } else {
@ -632,14 +632,14 @@ public class TableDataTreePane extends BasicTableDataTreePane {
StrategyConfig strategyConfig = getOrCreateStrategyConfig(dsName); StrategyConfig strategyConfig = getOrCreateStrategyConfig(dsName);
strategyConfig.setEnable(true); strategyConfig.setEnable(true);
strategyConfig.setUseGlobal(false); strategyConfig.setUseGlobal(false);
DesignerStrategyConfigUtils.addStrategyConfig(strategyConfig); StrategyConfigAttrUtils.addStrategyConfig(strategyConfig);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
} }
} }
private @NotNull StrategyConfig getOrCreateStrategyConfig(String dsName) { private @NotNull StrategyConfig getOrCreateStrategyConfig(String dsName) {
StrategyConfig config = DesignerStrategyConfigUtils.getStrategyConfig(dsName); StrategyConfig config = StrategyConfigAttrUtils.getStrategyConfig(dsName);
if (config == null) { if (config == null) {
config = StrategyConfigHelper.createStrategyConfig(true); config = StrategyConfigHelper.createStrategyConfig(true);
@ -680,7 +680,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
StrategyConfig strategyConfig = getOrCreateStrategyConfig(dsName); StrategyConfig strategyConfig = getOrCreateStrategyConfig(dsName);
strategyConfig.setEnable(false); strategyConfig.setEnable(false);
strategyConfig.setUseGlobal(false); strategyConfig.setUseGlobal(false);
DesignerStrategyConfigUtils.addStrategyConfig(strategyConfig); StrategyConfigAttrUtils.addStrategyConfig(strategyConfig);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
} }
@ -814,7 +814,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
checkButtonEnabled(); checkButtonEnabled();
//删掉缓存配置 //删掉缓存配置
DesignerStrategyConfigUtils.removeStrategyConfig(selectedNO.getName()); StrategyConfigAttrUtils.removeStrategyConfig(selectedNO.getName());
// 如果一个模版是平台开启,这个数据集的配置不会存xml,预览模版时直接从全局配置copy,这样 // 如果一个模版是平台开启,这个数据集的配置不会存xml,预览模版时直接从全局配置copy,这样
// 导致删除的时候StrategyConfigsAttrSavedHook没有通过前后配置比较感知数据集被删除,因此不会发出事件让其失效 // 导致删除的时候StrategyConfigsAttrSavedHook没有通过前后配置比较感知数据集被删除,因此不会发出事件让其失效

37
designer-base/src/main/java/com/fr/design/data/tabledata/strategy/StrategyConfigHandler.java

@ -0,0 +1,37 @@
package com.fr.design.data.tabledata.strategy;
import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.query.StrategicTableData;
/**
* @author rinoux
* @version 10.0
* Created by rinoux on 2021/3/19
*/
public abstract class StrategyConfigHandler<T extends StrategicTableData> {
private final T tableData;
public StrategyConfigHandler(T tableData) {
this.tableData = tableData;
}
protected T getTableData() {
return tableData;
}
/**
* 查找配置
*
* @return 缓存配置
*/
public abstract StrategyConfig find();
/**
* 保存配置
*
* @param config 缓存配置
*/
public abstract void save(T saved, StrategyConfig config);
}

131
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -12,19 +12,19 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignerStrategyConfigUtils; import com.fr.design.data.StrategyConfigAttrUtils;
import com.fr.design.data.datapane.ESDStrategyConfigPane; import com.fr.design.data.datapane.ESDStrategyConfigPane;
import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane; import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane;
import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.datapane.preview.sql.PreviewPerformedSqlPane; import com.fr.design.data.datapane.preview.sql.PreviewPerformedSqlPane;
import com.fr.design.data.datapane.sqlpane.SQLEditPane; import com.fr.design.data.datapane.sqlpane.SQLEditPane;
import com.fr.design.data.tabledata.tabledatapane.db.ServerStrategyConfigHandler; import com.fr.design.data.tabledata.strategy.StrategyConfigHandler;
import com.fr.design.data.tabledata.tabledatapane.db.DBTableDataSavedHook;
import com.fr.design.data.tabledata.tabledatapane.db.StrategyConfigFrom; import com.fr.design.data.tabledata.tabledatapane.db.StrategyConfigFrom;
import com.fr.design.data.tabledata.tabledatapane.db.StrategyConfigHandler;
import com.fr.design.data.tabledata.tabledatapane.db.TemplateStrategyConfigHandler;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.DBTableDataMenuHandler; import com.fr.design.fun.DBTableDataMenuHandler;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -43,7 +43,11 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.ParameterUtils; import com.fr.design.utils.ParameterUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.esd.core.strategy.config.StrategyConfig; import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.core.strategy.config.StrategyConfigHelper;
import com.fr.esd.core.strategy.config.service.StrategyConfigService; import com.fr.esd.core.strategy.config.service.StrategyConfigService;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.esd.query.StrategicTableData; import com.fr.esd.query.StrategicTableData;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -53,6 +57,7 @@ import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Box; import javax.swing.Box;
@ -101,7 +106,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
//配置 //配置
private StrategyConfig strategyConfig; private StrategyConfig strategyConfig;
private StrategyConfigHandler configHandler; private StrategyConfigHandler<DBTableData> configHandler;
public DBTableDataPane() { public DBTableDataPane() {
@ -348,7 +353,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
//判断是不是模版数据集 //判断是不是模版数据集
switch (this.dbTableData.getScope()) { switch (this.dbTableData.getScope()) {
case TEMPLATE: case TEMPLATE:
setEsdEnableStatus(DesignerStrategyConfigUtils.isEditingTemplateRecommended(), false); String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath();
setEsdEnableStatus(StrategyConfigService.isTemplateEnabled(tplPath), false);
break; break;
case SERVER: case SERVER:
//不会走到这里 //不会走到这里
@ -619,4 +625,117 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
return this.title; return this.title;
} }
} }
/**
* 服务器数据集配置处理器
*/
private static class ServerStrategyConfigHandler extends StrategyConfigHandler<DBTableData> {
private final String origName;
private final String origConnection;
private final String origQuery;
public ServerStrategyConfigHandler(DBTableData tableData) {
super(tableData);
this.origName = tableData.getDsName();
this.origConnection = tableData.getDatabase().toString();
this.origQuery = tableData.getQuery();
}
@Override
public StrategyConfig find() {
StrategyConfig strategyConfig = null;
if (getTableData() != null) {
try {
strategyConfig = getTableData().getStrategyConfig() == null ? null : getTableData().getStrategyConfig().clone();
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return strategyConfig;
}
@Override
public void save(DBTableData saved, StrategyConfig strategyConfig) {
String conn = saved.getDatabase().toString();
String query = saved.getQuery();
//检查数据链接和sql是否修改,如果修改需要触发缓存监听事件
if (!conn.equals(origConnection) || !query.equals(origQuery)) {
if (StringUtils.isNotEmpty(origName)) {
//新建数据集的origName为null,不用触发
StrategyEventsNotifier.modifyDataSet(DSMapping.ofServerDS(new DsNameTarget(origName)));
}
}
//配置变动事件
try {
final StrategyConfig orig = getTableData().getStrategyConfig();
saved.setStrategyConfig(strategyConfig.clone());
StrategyEventsNotifier.compareAndFireConfigEvents(orig, strategyConfig, DSMapping.ofServerDS(new DsNameTarget(saved.getDsName())));
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
/**
* 模版数据集配置处理器
*/
private static class TemplateStrategyConfigHandler extends StrategyConfigHandler<DBTableData> {
public TemplateStrategyConfigHandler(DBTableData tableData) {
super(tableData);
}
@Override
public StrategyConfig find() {
StrategyConfig strategyConfig = null;
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath();
if (getTableData() != null && StringUtils.isNotEmpty(tplPath)) {
//设置保存数据集的事件检查钩子
//新建模版此时不存在,不需要注册钩子
if (getTableData().getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) {
getTableData().setXmlSavedHook(new DBTableDataSavedHook(tplPath, getTableData()));
}
//获取当前的缓存配置,没有就创建一份
String dsName = getTableData().getDsName();
//这里为了之前兼容插件创建的配置,缓存配置不在DBTableData,而是从模版attr读取
strategyConfig = StrategyConfigAttrUtils.getStrategyConfig(dsName);
if (useGlobal(getTableData(), strategyConfig, tplPath)) {
//使用全局配置
strategyConfig = StrategyConfigHelper.createStrategyConfig(true);
} else if (getTableData().isShare()) {
//使用共享数据集兼容配置
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true);
}
}
return strategyConfig;
}
private boolean useGlobal(DBTableData dbTableData, StrategyConfig strategyConfig, String tplPath) {
//非共享且配置为空或者指定使用全局配置时,检查是否全局开启
if (!dbTableData.isShare() && (strategyConfig == null || strategyConfig.isUseGlobal())) {
//模版里面没有配置,检查模版是否被开启
return StrategyConfigService.isTemplateEnabled(tplPath);
}
return false;
}
@Override
public void save(DBTableData saved, StrategyConfig config) {
//DBTableDataSavedHook处理了
}
}
} }

70
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/ServerStrategyConfigHandler.java

@ -1,70 +0,0 @@
package com.fr.design.data.tabledata.tabledatapane.db;
import com.fr.data.impl.DBTableData;
import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
/**
* @author rinoux
* @version 10.0
* Created by rinoux on 2021/3/19
*/
public class ServerStrategyConfigHandler implements StrategyConfigHandler {
private final DBTableData tableData;
private final String origName;
private final String origConnection;
private final String origQuery;
public ServerStrategyConfigHandler(DBTableData tableData) {
this.tableData = tableData;
this.origName = tableData.getDsName();
this.origConnection = tableData.getDatabase().toString();
this.origQuery = tableData.getQuery();
}
@Override
public StrategyConfig find() {
StrategyConfig strategyConfig = null;
if (tableData != null) {
try {
strategyConfig = tableData.getStrategyConfig() == null ? null : tableData.getStrategyConfig().clone();
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return strategyConfig;
}
@Override
public void save(DBTableData saved, StrategyConfig strategyConfig) {
String conn = saved.getDatabase().toString();
String query = saved.getQuery();
//检查数据链接和sql是否修改,如果修改需要触发缓存监听事件
if (!conn.equals(origConnection) || !query.equals(origQuery)) {
if (StringUtils.isNotEmpty(origName)) {
//新建数据集的origName为null,不用触发
StrategyEventsNotifier.modifyDataSet(DSMapping.ofServerDS(new DsNameTarget(origName)));
}
}
//配置变动事件
try {
final StrategyConfig orig = tableData.getStrategyConfig();
saved.setStrategyConfig(strategyConfig.clone());
StrategyEventsNotifier.compareAndFireConfigEvents(orig, strategyConfig, DSMapping.ofServerDS(new DsNameTarget(saved.getDsName())));
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

16
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/StrategyConfigHandler.java

@ -1,16 +0,0 @@
package com.fr.design.data.tabledata.tabledatapane.db;
import com.fr.data.impl.DBTableData;
import com.fr.esd.core.strategy.config.StrategyConfig;
/**
* @author rinoux
* @version 10.0
* Created by rinoux on 2021/3/19
*/
public interface StrategyConfigHandler {
StrategyConfig find();
void save(DBTableData saved, StrategyConfig config);
}

50
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/db/TemplateStrategyConfigHandler.java

@ -1,50 +0,0 @@
package com.fr.design.data.tabledata.tabledatapane.db;
import com.fr.base.TableData;
import com.fr.data.impl.DBTableData;
import com.fr.design.data.DesignerStrategyConfigUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.esd.query.StrategicTableData;
import com.fr.workspace.WorkContext;
/**
* @author rinoux
* @version 10.0
* Created by rinoux on 2021/3/19
*/
public class TemplateStrategyConfigHandler implements StrategyConfigHandler {
DBTableData tableData;
public TemplateStrategyConfigHandler(DBTableData tableData) {
this.tableData = tableData;
}
@Override
public StrategyConfig find() {
StrategyConfig strategyConfig = null;
if (tableData != null) {
//设置保存数据集的事件检查钩子
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath();
//新建模版此时不存在,不需要注册钩子
if (tableData.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) {
tableData.setXmlSavedHook(new DBTableDataSavedHook(tplPath, tableData));
}
//获取当前的缓存配置,没有就创建一份
String dsName = tableData.getDsName();
//这里为了之前兼容插件创建的配置,缓存配置不在DBTableData,而是从模版attr读取
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName);
}
return strategyConfig;
}
@Override
public void save(DBTableData saved, StrategyConfig config) {
}
}

2
designer-base/src/main/java/com/fr/design/remote/ui/AuthorityEditorPane.java

@ -38,7 +38,7 @@ public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> {
) )
) )
); );
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cptx", ".cpt", ".class", ".frm", ".form"});
tree.setDigIn(true); tree.setDigIn(true);
tree.setFileNodeFilter(filter); tree.setFileNodeFilter(filter);
UIScrollPane scrollPane = new UIScrollPane(tree); UIScrollPane scrollPane = new UIScrollPane(tree);

28
designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java

@ -1,7 +1,5 @@
package com.fr.design.fit.common; package com.fr.design.fit.common;
import com.fr.decision.ExtraDecisionClassManager;
import com.fr.decision.fun.EmailSendProvider;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.fit.DesignerUIModeConfig;
import com.fr.design.fit.NewJForm; import com.fr.design.fit.NewJForm;
@ -13,7 +11,6 @@ import com.fr.design.fit.attrpane.RootDesignExtendDefinePane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.design.parameter.RootDesignDefinePane; import com.fr.design.parameter.RootDesignDefinePane;
import com.fr.design.preview.FormAdaptivePreview; import com.fr.design.preview.FormAdaptivePreview;
import com.fr.design.preview.FormPreview; import com.fr.design.preview.FormPreview;
@ -25,8 +22,8 @@ import com.fr.design.widget.ui.designer.layout.FRAbsoluteLayoutDefinePane;
import com.fr.design.widget.ui.designer.layout.FRFitLayoutDefinePane; import com.fr.design.widget.ui.designer.layout.FRFitLayoutDefinePane;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.MemFILE; import com.fr.file.MemFILE;
import com.fr.form.fit.NewFormMarkAttr;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
@ -152,11 +149,34 @@ public class AdaptiveSwitchUtil {
if (DesignerUIModeConfig.getInstance().newUIMode() && jForm.getTarget().getReportFitAttr() != null && isSwitchJFromIng()) { if (DesignerUIModeConfig.getInstance().newUIMode() && jForm.getTarget().getReportFitAttr() != null && isSwitchJFromIng()) {
jForm.getTarget().setReportFitAttr(shiftReportFitAttr(old, jForm.getTarget().getReportFitAttr().isFitFont())); jForm.getTarget().setReportFitAttr(shiftReportFitAttr(old, jForm.getTarget().getReportFitAttr().isFitFont()));
} }
processAbsoluteLayoutCompatible(jForm.getTarget());
TemplateTool.saveForm(jForm); TemplateTool.saveForm(jForm);
} }
return template; return template;
} }
private static void processAbsoluteLayoutCompatible(Form form){
Form.traversalWidget(form.getContainer(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
if (widget.acceptType(WAbsoluteBodyLayout.class)) {
return;
}
WAbsoluteLayout absoluteLayout = (WAbsoluteLayout) widget;
//切换到新模板后,内部的绝对画布块都要设置成适应缩放的逻辑
absoluteLayout.setCompState(0);
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, WAbsoluteLayout.class);
}
/** /**
* @Description: 创建模板核心方法 * @Description: 创建模板核心方法
* @param old 以前的方法 * @param old 以前的方法

3
designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java

@ -38,6 +38,9 @@ public class TemplateTool {
private static Listener<JTemplate> switchListener = new Listener<JTemplate>() { private static Listener<JTemplate> switchListener = new Listener<JTemplate>() {
@Override @Override
public void on(Event event, JTemplate jTemplate) { public void on(Event event, JTemplate jTemplate) {
if (!(jTemplate instanceof JForm)) {
return;
}
JFormType currentType = JFormType.OLD_TYPE; JFormType currentType = JFormType.OLD_TYPE;
if (AdaptiveSwitchUtil.isSwitchJFromIng()) { if (AdaptiveSwitchUtil.isSwitchJFromIng()) {
currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE; currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE;

4
designer-realize/src/main/java/com/fr/start/module/DesignerESDActivator.java

@ -1,6 +1,9 @@
package com.fr.start.module; package com.fr.start.module;
import com.fr.esd.cache.manager.RecommendManager;
import com.fr.esd.core.strategy.config.service.StrategyConfigService; import com.fr.esd.core.strategy.config.service.StrategyConfigService;
import com.fr.esd.core.strategy.recomend.EnabledTemplateService;
import com.fr.esd.core.strategy.recomend.EnabledTemplateServiceProvider;
import com.fr.esd.impl.strategy.config.service.DefaultStrategyConfigServiceProvider; import com.fr.esd.impl.strategy.config.service.DefaultStrategyConfigServiceProvider;
import com.fr.module.Activator; import com.fr.module.Activator;
@ -13,6 +16,7 @@ public class DesignerESDActivator extends Activator {
@Override @Override
public void start() { public void start() {
StrategyConfigService.setService(new DefaultStrategyConfigServiceProvider()); StrategyConfigService.setService(new DefaultStrategyConfigServiceProvider());
EnabledTemplateService.getInstance().registerService(path -> RecommendManager.getInstance().findByPath(path) != null);
} }
@Override @Override

Loading…
Cancel
Save