Browse Source

REPORT-11315 关闭其他模板时释放锁;打开模板过多时,关闭其中部分模板锁不释放问题

research/10.0
yaoh.wu 6 years ago
parent
commit
db6239a952
  1. 15
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

15
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -203,10 +203,14 @@ public class MutilTempalteTabPane extends JComponent {
} }
for (int i = 0; i < panes.length; i++) { for (int i = 0; i < panes.length; i++) {
if (i != selectedIndex) { if (i != selectedIndex) {
JTemplate<?, ?> jTemplate = panes[i];
//判断关闭的模板是不是格式刷的被参照的模板 //判断关闭的模板是不是格式刷的被参照的模板
openedTemplate.remove(panes[i]); openedTemplate.remove(jTemplate);
closeFormat(panes[i]); closeFormat(jTemplate);
HistoryTemplateListCache.getInstance().closeSelectedReport(panes[i]); HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate);
// release lock
String path = jTemplate.getEditingFILE().getPath();
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path);
} }
} }
JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
@ -215,8 +219,6 @@ public class MutilTempalteTabPane extends JComponent {
THIS.repaint(); THIS.repaint();
} }
//如果取消保存了,则不关闭其他模板 //如果取消保存了,则不关闭其他模板
} }
}); });
if (openedTemplate.size() == 1) { if (openedTemplate.size() == 1) {
@ -693,7 +695,8 @@ public class MutilTempalteTabPane extends JComponent {
specifiedTemplate.saveTemplate(); specifiedTemplate.saveTemplate();
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock // release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); String path = specifiedTemplate.getEditingFILE().getPath();
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path);
activeTemplate(filename); activeTemplate(filename);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));

Loading…
Cancel
Save