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); openedTemplate.remove(jTemplate);
closeFormat(jTemplate); closeFormat(jTemplate);
HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate);
// release lock closeAndFreeLock(jTemplate);
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(jTemplate.getPath());
} }
} }
JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
@ -221,7 +220,6 @@ public class MutilTempalteTabPane extends JComponent {
if (openedTemplate.size() == 1) { if (openedTemplate.size() == 1) {
closeOther.setEnabled(false); closeOther.setEnabled(false);
} }
return closeOther; return closeOther;
} }
@ -698,11 +696,19 @@ public class MutilTempalteTabPane extends JComponent {
private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) { private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock closeAndFreeLock(specifiedTemplate);
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath());
activeTemplate(fileName); 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