From 47806c617bb1253904452f80571d248bf8121821 Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 12 Jul 2018 17:28:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-9505=20=E4=BF=AE=E6=94=B9=E6=9D=A5?= =?UTF-8?q?=E8=87=AA=E6=A1=8C=E9=9D=A2=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 6 +----- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 6 ++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 575aea91bd..804ea550b4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -55,13 +55,11 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.stable.project.ProjectConstants; -import com.fr.workspace.WorkContext; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; import java.awt.*; -import java.io.ByteArrayOutputStream; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -656,9 +654,7 @@ public abstract class JTemplate> return false; } try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - this.getTarget().export(out); - WorkContext.getWorkResource().write(editingFILE.getPath(), out.toByteArray()); + this.getTarget().export(editingFILE.asOutputStream()); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 66a3c03bd0..61e385e072 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -13,6 +13,7 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; +import com.fr.workspace.resource.WorkResourceOutputStream; import javax.swing.*; import java.io.ByteArrayInputStream; @@ -337,10 +338,7 @@ public class FileNodeFILE implements FILE { if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { return null; } - return FRContext.getCommonOperator().writeBean( - envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1), - ProjectConstants.REPORTLETS_NAME - ); + return new WorkResourceOutputStream(envPath); } /** From e3f479e66fe30544982f68fae239214001cea53e Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 12 Jul 2018 17:37:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-9505=20=E4=BF=AE=E6=94=B9=E6=9D=A5?= =?UTF-8?q?=E8=87=AA=E6=A1=8C=E9=9D=A2=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/file/LocalePane.java | 5 ++--- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java index ebe5f1b55a..8d97152228 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java @@ -18,6 +18,7 @@ import com.fr.stable.StableUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; +import com.fr.workspace.resource.WorkResourceOutputStream; import javax.swing.*; import javax.swing.event.DocumentEvent; @@ -233,11 +234,9 @@ public class LocalePane extends BasicPane { properties.setProperty(GeneralUtils.objectToString(customTableModel.getValueAt(j, 0)), GeneralUtils.objectToString(customTableModel.getValueAt(j, i))); } - OutputStream out = null; try { - out = FRContext.getCommonOperator().writeBean(PREFIX + fileName + ".properties", ProjectConstants.LOCALE_NAME); + OutputStream out = new WorkResourceOutputStream(StableUtils.pathJoin(ProjectConstants.LOCALE_NAME, PREFIX + fileName + ".properties")); properties.store(out, null); - out.flush(); out.close(); } catch (Exception e) { diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 61e385e072..55aa491583 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -8,12 +8,12 @@ import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.workspace.resource.WorkResourceOutputStream; import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; -import com.fr.workspace.resource.WorkResourceOutputStream; import javax.swing.*; import java.io.ByteArrayInputStream;