Browse Source

Merge pull request #220 in DESIGN/design from ~JU/design:release/10.0 to release/10.0

* commit 'e3f479e66fe30544982f68fae239214001cea53e':
  REPORT-9505 修改来自桌面的文件失败
  REPORT-9505 修改来自桌面的文件失败
master
ju 7 years ago
parent
commit
405e3ac13e
  1. 5
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 6
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java

5
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.bridge.StableFactory;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResourceOutputStream;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent; 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))); properties.setProperty(GeneralUtils.objectToString(customTableModel.getValueAt(j, 0)), GeneralUtils.objectToString(customTableModel.getValueAt(j, i)));
} }
OutputStream out = null;
try { 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); properties.store(out, null);
out.flush(); out.flush();
out.close(); out.close();
} catch (Exception e) { } catch (Exception e) {

6
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.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.undo.UndoManager; import javax.swing.undo.UndoManager;
import java.awt.*; import java.awt.*;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -656,9 +654,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return false; return false;
} }
try { try {
ByteArrayOutputStream out = new ByteArrayOutputStream(); this.getTarget().export(editingFILE.asOutputStream());
this.getTarget().export(out);
WorkContext.getWorkResource().write(editingFILE.getPath(), out.toByteArray());
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE);

6
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -8,6 +8,7 @@ import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.workspace.resource.WorkResourceOutputStream;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -337,10 +338,7 @@ public class FileNodeFILE implements FILE {
if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
return null; return null;
} }
return FRContext.getCommonOperator().writeBean( return new WorkResourceOutputStream(envPath);
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1),
ProjectConstants.REPORTLETS_NAME
);
} }
/** /**

Loading…
Cancel
Save