From 417c65a18ed8ab4f516fa7b7f8d6d26f39474b71 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 6 Sep 2021 10:21:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-58036=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E5=8F=91=E5=B8=83=E5=89=8D=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=B5=8B=E8=AF=95=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题导出功能在11.0正式版中以插件的形式发布 【改动思路】 同上 --- .../dialog/TemplateThemeProfileDialog.java | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java index a1db7f5651..7974097b58 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java @@ -4,15 +4,7 @@ import com.fr.base.theme.TemplateTheme; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.theme.TemplateThemeProfilePane; -import com.fr.file.FILE; -import com.fr.file.FILEChooserPane; -import com.fr.file.FileFILE; -import com.fr.file.filter.ChooseFileFilter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.ListSet; -import com.fr.stable.xml.XMLPrintWriter; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -21,10 +13,6 @@ import java.awt.Dimension; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; import java.util.List; /** @@ -47,9 +35,6 @@ public class TemplateThemeProfileDialog extends Templat content.add(profilePane, BorderLayout.CENTER); setContentPane(createDialogContentPane(content, new UIButton[]{ - // 用于视觉设计师导出内置主题文件,发布前关闭 - // 后续由产品经理决定是否开启此功能 - createExportButton(profilePane), profilePane.createSaveButton(), profilePane.createSaveAsButton(this), createCancelButton() @@ -58,63 +43,6 @@ public class TemplateThemeProfileDialog extends Templat currentVisibleProfilePane = profilePane; } - private void exportTheme(T theme) { - FILEChooserPane fileChooser = FILEChooserPane.getInstance(true, true, new ChooseFileFilter() { - @Override - public boolean accept(FILE f) { - return f.isDirectory(); - } - - @Override - public String getDescription() { - return "export theme to xml"; - } - - @Override - public boolean containsExtension(String extension) { - return true; - } - - @Override - public String toString() { - return getDescription(); - } - }); - fileChooser.setCurrentDirectory(new FileFILE(new File("~/"))); - fileChooser.setFileNameTextField(theme.getName(), ".xml"); - FILE exportedFile = null; - - int result = fileChooser.showSaveDialog(DesignerContext.getDesignerFrame(), ".xml"); - if (result == FILEChooserPane.JOPTIONPANE_OK_OPTION || result == FILEChooserPane.OK_OPTION) { - exportedFile = fileChooser.getSelectedFILE(); - } - if (exportedFile == null) { - return; - } - - try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(exportedFile.getPath()))) { - XMLPrintWriter writer = XMLPrintWriter.create(bos); - theme.writeXML(writer); - writer.flush(); - writer.close(); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - public UIButton createExportButton(TemplateThemeProfilePane profilePane) { - UIButton exportButton = new UIButton(); - exportButton.setText(Toolkit.i18nText("Fine-Design_Basic_Export")); - exportButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - T theme = profilePane.updateBean(); - theme.getImageIdList().setIdList(new ListSet<>()); - exportTheme(theme); - } - }); - return exportButton; - } - private UIButton createCancelButton() { UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); button.addActionListener(new ActionListener() {