roger
11 months ago
3 changed files with 95 additions and 47 deletions
@ -0,0 +1,64 @@
|
||||
package com.fr.design.lock; |
||||
|
||||
import com.fr.design.file.HistoryTemplateListCache; |
||||
import com.fr.design.file.TemplateTreePane; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.utils.TemplateUtils; |
||||
import com.fr.file.FileNodeFILE; |
||||
import com.fr.file.filetree.FileNode; |
||||
import com.fr.stable.StableUtils; |
||||
import com.fr.stable.project.ProjectConstants; |
||||
|
||||
/** |
||||
* 被锁住的文件重新保存副本时的处理枚举类 |
||||
* |
||||
* @author Roger |
||||
* @since 11.0 |
||||
* Created on 2023/12/21 |
||||
*/ |
||||
public enum LockFileReSaveEnum { |
||||
|
||||
/** |
||||
* 保存目录树里面的模板副本 |
||||
*/ |
||||
TEMPLATE_TREE() { |
||||
@Override |
||||
public void action() { |
||||
FileNode node = TemplateTreePane.getInstance().getFileNode(); |
||||
if (node == null) { |
||||
return; |
||||
} |
||||
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getFilePath()); |
||||
TemplateUtils.createAndReOpenTemplate( |
||||
Toolkit.i18nText("Fine_Design_Template_Lock_Copy"), |
||||
new FileNodeFILE(new FileNode(selectedFilePath, false)), |
||||
false, |
||||
true); |
||||
} |
||||
}, |
||||
|
||||
/** |
||||
* 保存设计器里面已经打开的模板副本 |
||||
*/ |
||||
HISTORY_TEMPLATE_CACHE() { |
||||
@Override |
||||
public void action() { |
||||
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
||||
if (JTemplate.isValid(template)) { |
||||
TemplateUtils.createAndOpenTemplate( |
||||
Toolkit.i18nText("Fine_Design_Template_Backup"), |
||||
new FileNodeFILE(new FileNode(template.getPath(), false)), |
||||
true, |
||||
true, |
||||
//另存之后需要关闭的模板
|
||||
template); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
/** |
||||
* 如何保存模板副本 |
||||
*/ |
||||
public abstract void action(); |
||||
} |
Loading…
Reference in new issue