Browse Source

REPORT-8790 改动太多了,先commit一次

master
ju 6 years ago
parent
commit
74b5a1bcfb
  1. 5
      designer-base/src/com/fr/design/formula/JavaEditorPane.java
  2. 3
      designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  3. 3
      designer-base/src/com/fr/design/remote/ui/UserManagerPane.java
  4. 10
      designer-base/src/com/fr/file/FileNodeFILE.java

5
designer-base/src/com/fr/design/formula/JavaEditorPane.java

@ -16,6 +16,7 @@ import com.fr.stable.JavaCompileInfo;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
@ -113,7 +114,7 @@ public class JavaEditorPane extends BasicPane {
private InputStream getJavaSourceInputStream() {
String javaPath = getJavaPath();
try {
return new ByteArrayInputStream(FRContext.getCurrentEnv().getFileOperator().read(StableUtils.pathJoin(ProjectConstants.CLASSES_NAME, javaPath)));
return new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.CLASSES_NAME, javaPath)));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
@ -156,7 +157,7 @@ public class JavaEditorPane extends BasicPane {
return;
}
try {
FRContext.getCurrentEnv().getFileOperator().write(text.getBytes(EncodeConstants.ENCODING_UTF_8), StableUtils.pathJoin(ProjectConstants.CLASSES_NAME, getJavaPath()));
WorkContext.getWorkResource().write(StableUtils.pathJoin(ProjectConstants.CLASSES_NAME, getJavaPath()), text.getBytes(EncodeConstants.ENCODING_UTF_8));
JOptionPane.showMessageDialog(null, Inter.getLocText(new String[]{"Save", "Successfully"}) + "!");
fireSaveActionListener();
} catch (Exception e) {

3
designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -3,11 +3,8 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.base.operator.file.FileOperator;
import com.fr.core.env.proxy.EnvProxy;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.file.filetree.FileNode;
import com.fr.general.web.ParameterConstants;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;

3
designer-base/src/com/fr/design/remote/ui/UserManagerPane.java

@ -1,8 +1,5 @@
package com.fr.design.remote.ui;
import com.fr.core.env.EnvContext;
import com.fr.core.env.proxy.EnvProxy;
import com.fr.core.env.resource.EnvConfigUtils;
import com.fr.design.border.UITitledBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;

10
designer-base/src/com/fr/file/FileNodeFILE.java

@ -12,9 +12,9 @@ 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 javax.swing.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
@ -200,7 +200,7 @@ public class FileNodeFILE implements FILE {
}
try {
return FRContext.getCurrentEnv().getFileOperator().createFolder(StableUtils.pathJoin(node.getEnvPath(), name));
return WorkContext.getWorkResource().create(StableUtils.pathJoin(node.getEnvPath(), name));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
@ -267,7 +267,7 @@ public class FileNodeFILE implements FILE {
}
try {
return FRContext.getCurrentEnv().getFileOperator().createFile(node.getEnvPath());
return WorkContext.getWorkResource().create(node.getEnvPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
@ -290,8 +290,8 @@ public class FileNodeFILE implements FILE {
if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
return null;
}
InputStream in = new ByteArrayInputStream(FRContext.getCurrentEnv().getFileOperator().read(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1))));
InputStream in = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1))));
return envPath.endsWith(".cpt") || envPath.endsWith(".frm")
? XMLEncryptUtils.decodeInputStream(in) : in;

Loading…
Cancel
Save