Browse Source

REPORT-21017【新引擎】增加cptx文件类型及相关适配

feature/big-screen
kerry 5 years ago
parent
commit
ae154d063c
  1. 13
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  2. 10
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 2
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  4. 5
      designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java
  5. 9
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

13
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.cluster.ClusterBridge; import com.fr.cluster.ClusterBridge;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
@ -374,10 +375,11 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
if (WorkContext.getCurrent() != null) { if (WorkContext.getCurrent() != null) {
boolean pathSupportVcsAction = selectedOperation.getFilePath() != null && pathSupportVcsAction(selectedOperation.getFilePath());
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
//当前环境为远程环境时 //当前环境为远程环境时
FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode(); FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode();
if (selectedOperation.getFilePath() != null) { if (pathSupportVcsAction) {
if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) { if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) {
setEnabled(false); setEnabled(false);
} else { } else {
@ -388,11 +390,18 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
} else { } else {
//当前环境为本地环境时 //当前环境为本地环境时
setEnabled(selectedOperation.getFilePath() != null); setEnabled(pathSupportVcsAction);
} }
} }
} }
private boolean pathSupportVcsAction(String path) {
if (FileExtension.CPT.matchExtension(path) || FileExtension.FRM.matchExtension(path)) {
return true;
}
return false;
}
private void closeOpenedTemplate(String path, boolean isCurrentEditing) { private void closeOpenedTemplate(String path, boolean isCurrentEditing) {
for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) { for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) {
if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) { if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) {

10
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -628,13 +628,19 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
} }
protected void addChooseFILEFilter(FILEChooserPane fileChooser){ private void addChooseFILEFilter(FILEChooserPane fileChooser){
String appName = ProductConstants.APP_NAME; String appName = ProductConstants.APP_NAME;
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); if (FileExtension.CPT.matchExtension(this.suffix())){
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
}
if (FileExtension.FRM.matchExtension(this.suffix())) { if (FileExtension.FRM.matchExtension(this.suffix())) {
// richer:form文件 daniel 改成三个字 // richer:form文件 daniel 改成三个字
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
} }
addExtraChooseFILEFilter(fileChooser);
}
protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){
} }

2
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -725,11 +725,9 @@ public class FILEChooserPane extends BasicPane {
// ben:filefilter设置初值为cpt过滤 // ben:filefilter设置初值为cpt过滤
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
// richer:form文件 daniel 改成三个字 // richer:form文件 daniel 改成三个字
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRMX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File")));
} else { } else {
if (type == JFileChooser.OPEN_DIALOG) { if (type == JFileChooser.OPEN_DIALOG) {
this.addChooseFILEFilter(new ChooseFileFilter(EnumSet.of(FileExtension.XLS, FileExtension.XLSX), Toolkit.i18nText("Fine-Design_Basic_Import_Excel_Source"))); this.addChooseFILEFilter(new ChooseFileFilter(EnumSet.of(FileExtension.XLS, FileExtension.XLSX), Toolkit.i18nText("Fine-Design_Basic_Import_Excel_Source")));

5
designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.file.FILEChooserPane;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.report.poly.PolyWorkSheet; import com.fr.report.poly.PolyWorkSheet;
@ -44,4 +45,8 @@ public class JPolyWorkBook extends JWorkBook {
public void refreshEastPropertiesPane() { public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
} }
protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) {
}
} }

9
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -671,11 +671,13 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
// Export - MenuDef // Export - MenuDef
MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName()); MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName());
exportMenuDef.setIconPath("/com/fr/design/images/m_file/export.png"); exportMenuDef.setIconPath("/com/fr/design/images/m_file/export.png");
addShortCut(exportMenuDef, excelExportMenuDef);
return exportMenuDef;
}
protected void addShortCut(MenuDef exportMenuDef, MenuDef excelExportMenuDef) {
exportMenuDef.addShortCut(excelExportMenuDef, new PDFExportAction(this), new WordExportAction(this), new SVGExportAction(this), exportMenuDef.addShortCut(excelExportMenuDef, new PDFExportAction(this), new WordExportAction(this), new SVGExportAction(this),
new CSVExportAction(this), new TextExportAction(this), new EmbeddedExportExportAction(this)); new CSVExportAction(this), new TextExportAction(this), new EmbeddedExportExportAction(this));
return exportMenuDef;
} }
/** /**
@ -1169,8 +1171,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
return ViewRequestConstants.REPORT_VIEW_PATH; return ViewRequestConstants.REPORT_VIEW_PATH;
} }
protected void addChooseFILEFilter(FILEChooserPane fileChooser){ protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){
super.addChooseFILEFilter(fileChooser);
Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG);
for (ReportSupportedFileUIProvider provider : providers) { for (ReportSupportedFileUIProvider provider : providers) {
provider.addChooseFileFilter(fileChooser, this.suffix()); provider.addChooseFileFilter(fileChooser, this.suffix());

Loading…
Cancel
Save