|
|
@ -1,7 +1,6 @@ |
|
|
|
package com.fr.design.utils; |
|
|
|
package com.fr.design.utils; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
import com.fr.base.io.BaseBook; |
|
|
|
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.TemplateTreePane; |
|
|
|
import com.fr.design.file.TemplateTreePane; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
@ -17,9 +16,9 @@ import com.fr.stable.CoreConstants; |
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.server.lock.TplOperator; |
|
|
|
import com.fr.workspace.server.lock.TplOperator; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author hades |
|
|
|
* @author hades |
|
|
@ -65,12 +64,7 @@ public class TemplateUtils { |
|
|
|
if (!needOpen) { |
|
|
|
if (!needOpen) { |
|
|
|
// 从当前编辑模板中生成备份文件
|
|
|
|
// 从当前编辑模板中生成备份文件
|
|
|
|
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
content = template.exportData(); |
|
|
|
BaseBook target = template.getTarget(); |
|
|
|
|
|
|
|
if (target != null) { |
|
|
|
|
|
|
|
target.export(outputStream); |
|
|
|
|
|
|
|
content = outputStream.toByteArray(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
content = WorkContext.getWorkResource().readFully(oldPath); |
|
|
|
content = WorkContext.getWorkResource().readFully(oldPath); |
|
|
|
} |
|
|
|
} |
|
|
|