Browse Source

不是工程内的文件不进行解锁操作

bugfix/10.0
yaoh.wu 6 years ago
parent
commit
3f3bb397cc
  1. 16
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

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

@ -206,8 +206,7 @@ public class MutilTempalteTabPane extends JComponent {
openedTemplate.remove(jTemplate);
closeFormat(jTemplate);
HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate);
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(jTemplate.getPath());
closeAndFreeLock(jTemplate);
}
}
JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
@ -221,7 +220,6 @@ public class MutilTempalteTabPane extends JComponent {
if (openedTemplate.size() == 1) {
closeOther.setEnabled(false);
}
return closeOther;
}
@ -698,11 +696,19 @@ public class MutilTempalteTabPane extends JComponent {
private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath());
closeAndFreeLock(specifiedTemplate);
activeTemplate(fileName);
}
private void closeAndFreeLock(@Nonnull JTemplate<?, ?> template) {
FILE file = template.getEditingFILE();
// 只有是环境内的文件,才执行释放锁
if (file != null && file.isEnvFile()) {
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(template.getPath());
}
}
/**
* 关闭模板
*

Loading…
Cancel
Save