Browse Source

Merge pull request #15988 in DESIGN/design from fbp/feature to fbp/research

* commit '30f54e3c478358a36f066e17217cc8a0e016bd86':
  Revert "REPORT-145379 远程设计调试工具适配gzip"
  REPORT-145379 远程设计调试工具适配gzip
  REPORT-145372 修复设计器双击模板tab栏后台NPE的问题
  Revert "REPORT-145338 修复远程切换大量exist操作的问题"
  REPORT-145338 修复远程切换大量exist操作的问题
  REPORT-145338 修复远程切换大量exist操作的问题
fbp/research
superman 1 month ago
parent
commit
c334219cc2
  1. 7
      designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java
  2. 23
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

7
designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java

@ -4,8 +4,6 @@ import com.fr.base.io.IOFile;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate;
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.persistence.StrategyConfigsAttr;
import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget;
@ -13,7 +11,6 @@ import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.esd.event.xml.XMLSavedHook;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import java.nio.file.Paths;
import java.util.HashMap;
@ -48,7 +45,9 @@ public class StrategyConfigAttrUtils {
//新建模版此时不存在,不需要注册钩子
//不处理外部路径,保存到设计器才处理
String path = jTemplate.getPath();
if (attr.getXmlSavedHook() == null && !Paths.get(path).isAbsolute() && WorkContext.getWorkResource().exist(path)) {
if (attr.getXmlSavedHook() == null
&& !Paths.get(path).isAbsolute()
&& jTemplate.getEditingFILE().isMemFile()) {
attr.setXmlSavedHook(new StrategyConfigsAttrSavedHook(jTemplate.getPath(), attr));
}
return attr;

23
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -116,7 +116,6 @@ public class MultiTemplateTabPane extends Row {
private boolean hoverMoreAction = false;
private Icon clodeIcon = new LazyIcon("clear");
private boolean isShowList = false;
private JButton leadingActionButton;
private final UIToolbar leadingToolBar = new UIToolbar();
//自动新建的模板B若没有进行任何编辑,切换到其他
@ -203,17 +202,6 @@ public class MultiTemplateTabPane extends Row {
updateLeadingToolBar();
}
/**
* 为前导动作添加监听
*
* @param l 监听器
*/
public void addLeadingAction(ActionListener l) {
newTemplateAction = l;
leadingActionButton.removeActionListener(newTemplateAction);
leadingActionButton.addActionListener(newTemplateAction);
}
public void setToolBarEnable(boolean enable) {
leadingToolBar.setEnabled(enable);
}
@ -787,7 +775,9 @@ public class MultiTemplateTabPane extends Row {
public void mouseClicked(MouseEvent e) {
// 双击添加模板
if (e.getClickCount() == DOUBLE_CLICK
&& isOverBlank(e.getX())) {
&& isOverBlank(e.getX())
&& newTemplateAction != null
) {
newTemplateAction.actionPerformed(null);
}
}
@ -1003,6 +993,7 @@ public class MultiTemplateTabPane extends Row {
/**
* 创建新建模板的前导区工具按钮
*
* @return
*/
private ToolBarDef createLeadingToolBarDef() {
@ -1013,17 +1004,21 @@ public class MultiTemplateTabPane extends Row {
/**
* 创建新建文件的按钮数组
*
* @return
*/
public ShortCut[] createNewTemplateShortCuts() {
ArrayList<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new NewWorkBookToolButtonAction());
NewWorkBookToolButtonAction action = new NewWorkBookToolButtonAction();
shortCuts.add(action);
newTemplateAction = action;
return shortCuts.toArray(new ShortCut[0]);
}
/**
* 插入插件中的按钮
*
* @return
*/
protected void insertLeadingToolButton(ToolBarDef toolBarDef, String anchor) {

3
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -98,8 +98,7 @@ public class CenterRegionContainerPane extends JPanel {
}
private MultiTemplateTabPane initTemplateTabPane() {
MultiTemplateTabPane templateTabPane = MultiTemplateTabPane.getInstance();
return templateTabPane;
return MultiTemplateTabPane.getInstance();
}
public ToolBarMenuDock getToolBarMenuDock() {

Loading…
Cancel
Save