Browse Source

file extension

research/10.0
yaoh.wu 6 years ago
parent
commit
5442e99400
  1. 5
      designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java
  2. 10
      designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractExcelExportAction.java
  3. 2
      designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java

5
designer-form/src/main/java/com/fr/design/actions/file/export/EmbeddedFormExportExportAction.java

@ -2,17 +2,18 @@ package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.base.Parameter;
import com.fr.base.extension.FileExtension;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JForm;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.io.exporter.ExporterKey;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.form.main.Form;
import com.fr.io.exporter.DesignExportScope;
import com.fr.io.exporter.DesignExportType;
import com.fr.io.exporter.ExporterKey;
import com.fr.stable.ArrayUtils;
import java.util.HashMap;
@ -71,6 +72,6 @@ public class EmbeddedFormExportExportAction extends AbstractExportAction<JForm>
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"frm"}, Toolkit.i18nText("Fine-Design_Form_EmbeddedTD"));
return new ChooseFileFilter(FileExtension.FRM.getExtensions(), Toolkit.i18nText("Fine-Design_Form_EmbeddedTD"));
}
}

10
designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractExcelExportAction.java

@ -4,6 +4,7 @@
package com.fr.design.actions.file.export;
import com.fr.base.ExcelUtils;
import com.fr.base.extension.FileExtension;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JWorkBook;
import com.fr.file.filter.ChooseFileFilter;
@ -23,9 +24,10 @@ public abstract class AbstractExcelExportAction extends AbstractWorkBookExportAc
protected ChooseFileFilter getChooseFileFilter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (ReportUtils.hasLayerReport4Template(tpl)) {
return new ChooseFileFilter(new String[]{"zip"}, "ZIP");
return new ChooseFileFilter(FileExtension.ZIP, "ZIP");
} else {
return new ChooseFileFilter(new String[]{"xls", "xlsx"}, Toolkit.i18nText("Fine-Design_Report_Export_Excel"));
return new ChooseFileFilter(new String[]{FileExtension.XLSX.getExtension(), FileExtension.XLS.getExtension()},
Toolkit.i18nText("Fine-Design_Report_Export_Excel"));
}
}
@ -33,9 +35,9 @@ public abstract class AbstractExcelExportAction extends AbstractWorkBookExportAc
protected String getDefaultExtension() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (ReportUtils.hasLayerReport4Template(tpl)) {
return "zip";
return FileExtension.ZIP.getExtension();
} else {
return ExcelUtils.checkThirdJarSupportPOI() ? "xlsx" : "xls";
return ExcelUtils.checkThirdJarSupportPOI() ? FileExtension.XLSX.getExtension() : FileExtension.XLS.getExtension();
}
}
}

2
designer-realize/src/main/java/com/fr/design/actions/file/export/EmbeddedExportExportAction.java

@ -33,7 +33,7 @@ public class EmbeddedExportExportAction extends AbstractWorkBookExportAction {
@Override
protected String getDefaultExtension() {
return getEditingComponent().suffix().substring(1);
return FileExtension.CPT.getExtension();
}
@Override

Loading…
Cancel
Save