|
|
|
@ -6,6 +6,7 @@ import com.fr.design.actions.file.export.PDFExportAction;
|
|
|
|
|
import com.fr.design.actions.file.export.SVGExportAction; |
|
|
|
|
import com.fr.design.actions.file.export.TextExportAction; |
|
|
|
|
import com.fr.design.actions.file.export.WordExportAction; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.design.mainframe.JWorkBook; |
|
|
|
|
import com.fr.design.menu.MenuDef; |
|
|
|
|
import com.fr.design.menu.ShortCut; |
|
|
|
@ -14,6 +15,7 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.main.impl.WorkBook; |
|
|
|
|
import com.fr.nx.app.designer.utils.CptCompileUtil; |
|
|
|
|
import com.fr.nx.cptx.entry.metadata.CptxMetadata; |
|
|
|
|
import com.fr.nx.app.designer.menu.CalculateAttrAction; |
|
|
|
|
import com.fr.nx.app.designer.toolbar.TemplateTransformer; |
|
|
|
@ -92,26 +94,31 @@ public class JStreamBook extends JWorkBook {
|
|
|
|
|
new CSVExportAction(this), new TextExportAction(this)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getPath() { |
|
|
|
|
return getEditingFILE().getPath() + getSuffix(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getTemplateName() { |
|
|
|
|
return getEditingFILE().getName() + getSuffix(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getSuffix() { |
|
|
|
|
CptxMetadata metadata = CptxFileUtils.getMetadata(this.getEditingFILE().getPath()); |
|
|
|
|
String path = this.getEditingFILE().getPath(); |
|
|
|
|
CptxMetadata metadata = CptxFileUtils.getMetadata(path); |
|
|
|
|
//兼容另存为模式中标题显示
|
|
|
|
|
if (metadata != null && metadata.isForceCpt()) { |
|
|
|
|
return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); |
|
|
|
|
if (path.endsWith(".cptx")){ |
|
|
|
|
return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); |
|
|
|
|
} else if (path.endsWith(".cpt")){ |
|
|
|
|
return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Paging_Engine_Not_Work"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ShortCut[] shortcut4TemplateMenu() { |
|
|
|
|
return ArraysUtil.insert(super.shortcut4TemplateMenu(), new CalculateAttrAction(this), 5); |
|
|
|
|
//兼容另存为流程中,在cptx转换成cpt时,在不重新关闭打开文件的基础上刷新面板
|
|
|
|
|
if (!CptCompileUtil.isNewEngine(this.getTarget())){ |
|
|
|
|
return ArraysUtil.insert(super.shortcut4TemplateMenu(), new CalculateAttrAction(this), 5); |
|
|
|
|
} else { |
|
|
|
|
return super.shortcut4TemplateMenu(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|