ju 7 years ago
parent
commit
63bc6e2fea
  1. 10
      designer-base/src/com/fr/design/actions/file/LocalePane.java
  2. 4
      designer-base/src/com/fr/design/data/datapane/ChoosePane.java
  3. 16
      designer-base/src/com/fr/design/data/tabledata/tabledatapane/ClassNameSelectPane.java
  4. 2
      designer-base/src/com/fr/design/data/tabledata/wrapper/StoreProcedureNameWrapper.java
  5. 4
      designer-base/src/com/fr/design/file/HistoryTemplateListPane.java
  6. 6
      designer-base/src/com/fr/design/file/TemplateTreePane.java
  7. 5
      designer-base/src/com/fr/design/formula/JavaEditorPane.java
  8. 7
      designer-base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java
  9. 18
      designer-base/src/com/fr/design/gui/itree/filetree/FileNodeComparator.java
  10. 14
      designer-base/src/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  11. 31
      designer-base/src/com/fr/design/gui/itree/filetree/ReportletPane.java
  12. 5
      designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  13. 2
      designer-base/src/com/fr/design/mainframe/DesignerFrame.java
  14. 4
      designer-base/src/com/fr/design/mainframe/JTemplate.java
  15. 10
      designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java
  16. 3
      designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  17. 7
      designer-base/src/com/fr/design/remote/ui/AuthorityEditorPane.java
  18. 2
      designer-base/src/com/fr/design/roleAuthority/RoleDataWrapper.java
  19. 8
      designer-base/src/com/fr/design/widget/IconDefinePane.java
  20. 8
      designer-base/src/com/fr/file/FILEChooserPane.java
  21. 2
      designer-base/src/com/fr/file/FileNodeFILE.java
  22. 6
      designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java
  23. 2
      designer-form/src/com/fr/design/parameter/FormParameterReader.java
  24. 7
      designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  25. 30
      designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  26. 2
      designer-realize/src/com/fr/design/parameter/WorkBookParameterReader.java
  27. 10
      designer-realize/src/com/fr/start/Designer.java

10
designer-base/src/com/fr/design/actions/file/LocalePane.java

@ -4,13 +4,13 @@
package com.fr.design.actions.file;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode;
import com.fr.general.Env;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -180,11 +180,8 @@ public class LocalePane extends BasicPane {
}
private void initCustomProperties() throws Exception {
Env env = FRContext.getCurrentEnv();
if (env == null) {
return;
}
FileNode[] fileNodes = env.getFileOperator().list(ProjectConstants.LOCALE_NAME);
FileNode[] fileNodes = FRContext.getFileOperator().list(ProjectConstants.LOCALE_NAME);
if (ArrayUtils.getLength(fileNodes) == 0) {
return;
}
@ -220,6 +217,7 @@ public class LocalePane extends BasicPane {
*
*/
public void save() {
Env env = FRContext.getCurrentEnv();
if (env == null) {
return;

4
designer-base/src/com/fr/design/data/datapane/ChoosePane.java

@ -10,7 +10,6 @@ import com.fr.data.core.db.dialect.DialectFactory;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData;
import com.fr.data.operator.DataOperator;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.DesignTableDataManager;
@ -37,6 +36,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -463,7 +463,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
// 显示Table数据.
TableData tableData = null;
if (FRContext.getCurrentEnv() instanceof LocalEnv) {
if (WorkContext.getCurrent().isLocal()) {
tableData = new DBTableData(database, DataCoreUtils.createSelectSQL(paras.getSchemaName(), paras.getTableName(),
DialectFactory.getDialectByName(paras.getDatabaseName())));
} else {

16
designer-base/src/com/fr/design/data/tabledata/tabledatapane/ClassNameSelectPane.java

@ -1,19 +1,15 @@
package com.fr.design.data.tabledata.tabledatapane;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.tree.TreeSelectionModel;
import com.fr.base.FRContext;
import com.fr.design.gui.itree.filetree.ClassFileTree;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.tree.TreeSelectionModel;
import java.awt.*;
public class ClassNameSelectPane extends BasicPane {
private ClassFileTree classFileTree;
@ -27,7 +23,7 @@ public class ClassNameSelectPane extends BasicPane {
Inter.getLocText("Function-Choose_Function_Class") + ":"));
classFileTree = new ClassFileTree();
classFileTree.refreshEnv(FRContext.getCurrentEnv());
classFileTree.refreshEnv();
classFileTree.getSelectionModel().setSelectionMode(
TreeSelectionModel.SINGLE_TREE_SELECTION);
this.add(new JScrollPane(classFileTree), BorderLayout.CENTER);

2
designer-base/src/com/fr/design/data/tabledata/wrapper/StoreProcedureNameWrapper.java

@ -1,7 +1,6 @@
package com.fr.design.data.tabledata.wrapper;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.impl.storeproc.ProcedureDataModel;
@ -94,7 +93,6 @@ public final class StoreProcedureNameWrapper implements TableDataWrapper {
return columnNameList;
}
columnNameList = new ArrayList<String>();
Env env = FRContext.getCurrentEnv();
if (!WorkContext.getCurrent().isLocal()) {
try {
createStore(false);

4
designer-base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -1,6 +1,5 @@
package com.fr.design.file;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.design.DesignModelAdapter;
@ -366,8 +365,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
*/
public void openContainerFolder() {
FileNode fileNode = new FileNode(((JTemplate<?, ?>) list.getSelectedValue()).getEditingFILE().getPath(), false);
Env env = FRContext.getCurrentEnv();
if (env.isLocalEnv()) {
if (WorkContext.getCurrent().isLocal()) {
IOUtils.openWindowsFolder(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), fileNode.getEnvPath()));
}
}

6
designer-base/src/com/fr/design/file/TemplateTreePane.java

@ -3,7 +3,6 @@
*/
package com.fr.design.file;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.io.FileAssistUtils;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -100,7 +99,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
*/
public void refreshDockingView() {
reportletsTree.setFileNodeFilter(new IOFileNodeFilter(FRContext.getCurrentEnv().getSupportedTypes()));
reportletsTree.refreshEnv(FRContext.getCurrentEnv());
reportletsTree.refreshEnv();
}
/*
@ -141,8 +140,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
*/
public void openContainerFolder() {
FileNode fn = TemplateTreePane.this.reportletsTree.getSelectedFileNode();
Env localEnv = FRContext.getCurrentEnv();
String filePath = StableUtils.pathJoin(localEnv.getPath(), fn.getEnvPath());
String filePath = StableUtils.pathJoin(WorkContext.getCurrent().getPath(), fn.getEnvPath());
filePath = filePath.substring(0, filePath.lastIndexOf(CoreConstants.SEPARATOR));
try {
Desktop.getDesktop().open(new File(filePath));

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

@ -1,6 +1,5 @@
package com.fr.design.formula;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
@ -176,8 +175,8 @@ public class JavaEditorPane extends BasicPane {
@Override
protected JavaCompileInfo doInBackground() throws Exception {
Env env = FRContext.getCurrentEnv();
return env.getCommonOperator().compile(javaText.getText());
return FRContext.getCommonOperator().compile(javaText.getText());
}
public void done() {

7
designer-base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java

@ -1,6 +1,5 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
@ -28,7 +27,6 @@ import java.util.Arrays;
public class EnvFileTree extends RefreshableJTree {
protected FileNodeFilter filter;
protected Env env;
protected String treeRootPath = "";
protected String[] subPathes;
@ -191,7 +189,7 @@ public class EnvFileTree extends RefreshableJTree {
FileNode[] res_fns = null;
try {
res_fns = env == null ? new FileNode[0] : env.getFileOperator().list(filePath);
res_fns = FRContext.getCurrentEnv() == null ? new FileNode[0] : FRContext.getFileOperator().list(filePath);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
@ -239,8 +237,7 @@ public class EnvFileTree extends RefreshableJTree {
/*
* 改变Env后,根据构造函数时设置的RootPathes,重新加载
*/
public void refreshEnv(Env env) {
this.env = env;
public void refreshEnv() {
DefaultTreeModel m_model = (DefaultTreeModel) this.getModel();
ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) m_model.getRoot();

18
designer-base/src/com/fr/design/gui/itree/filetree/FileNodeComparator.java

@ -1,9 +1,9 @@
package com.fr.design.gui.itree.filetree;
import java.util.Comparator;
import com.fr.dav.LocalEnv;
import com.fr.file.filetree.FileNode;
import com.fr.general.adaptor.WorkspaceAdaptor;
import java.util.Comparator;
/**
* FileTreeNode compare...
@ -26,8 +26,6 @@ public class FileNodeComparator implements Comparator<FileNode> {
* v1 is equal to v2, or < 0 if v1 is less than v2.
* It must handle null values for the comparison values.
*
* @param v1 comparison value.
* @param v2 comparison value.
* @return < 0, 0, or > 0 for v1<v2, v1==v2, or v1>v2.
*/
public int compare(FileNode nameNode1, FileNode nameNode2) {
@ -60,14 +58,14 @@ public class FileNodeComparator implements Comparator<FileNode> {
*/
private int groupByFileType(FileNode nameNode1, FileNode nameNode2,
int i) {
if(i< LocalEnv.FILE_TYPE.length){
if(nameNode1.isFileType(LocalEnv.FILE_TYPE[i]))
if(nameNode2.isFileType(LocalEnv.FILE_TYPE[i]))
if (i < WorkspaceAdaptor.FILE_TYPE.length) {
if (nameNode1.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
if (nameNode2.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase());
else
return-1;
else
if(nameNode2.isFileType(LocalEnv.FILE_TYPE[i]))
else if (nameNode2.isFileType(WorkspaceAdaptor.FILE_TYPE[i]))
return 1;
else{
return groupByFileType(nameNode1, nameNode2, i+1);

14
designer-base/src/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -1,17 +1,15 @@
package com.fr.design.gui.itree.filetree;
import java.io.File;
import javax.swing.Icon;
import javax.swing.UIManager;
import javax.swing.filechooser.FileSystemView;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.dav.LocalEnv;
import com.fr.design.icon.LockIcon;
import com.fr.file.filetree.FileNode;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
public class FileTreeIcon {
private FileTreeIcon() {}
@ -118,7 +116,7 @@ public class FileTreeIcon {
public static Icon getIcon(FileNode node, boolean isShowLock) {
String path = StableUtils.pathJoin(new String[]{FRContext.getCurrentEnv().getPath(), node.getEnvPath()});
if (FRContext.getCurrentEnv() instanceof LocalEnv) {
if (WorkContext.getCurrent().isLocal()) {
File ff = new File(path);
if (ff.exists()) {
if(node.isDirectory()){

31
designer-base/src/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -1,23 +1,18 @@
package com.fr.design.gui.itree.filetree;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.filetree.IOFileNodeFilter;
import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class ReportletPane extends BasicPane {
private TemplateFileTree templateReportletTree;
@ -60,8 +55,8 @@ public class ReportletPane extends BasicPane {
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree();
cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS");
this.refreshEnv(FRContext.getCurrentEnv());
this.refreshEnv();
}
/*
@ -92,11 +87,11 @@ public class ReportletPane extends BasicPane {
/**
* 刷新Env
* @param env 环境
*/
public void refreshEnv(Env env) {
this.templateReportletTree.refreshEnv(env);
this.classReportletTree.refreshEnv(env);
public void refreshEnv() {
this.templateReportletTree.refreshEnv();
this.classReportletTree.refreshEnv();
}
@Override

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

@ -1,6 +1,5 @@
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.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -102,7 +101,7 @@ public class TemplateFileTree extends EnvFileTree {
}
public FileNode[] listFile(String path) throws Exception {
return FRContext.getCurrentEnv().getFileOperator().list(
return FRContext.getFileOperator().list(
path,
new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CPTX, FileExtension.FRMX});
}
@ -110,7 +109,7 @@ public class TemplateFileTree extends EnvFileTree {
/*
* 改变Env后,根据构造函数时设置的RootPaths,重新加载
*/
public void refreshEnv(Env env) {
public void refreshEnv() {
DefaultTreeModel defaultTreeModel = (DefaultTreeModel) this.getModel();
ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot();

2
designer-base/src/com/fr/design/mainframe/DesignerFrame.java

@ -652,7 +652,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
String envName = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo env = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName);
if (env != null) {
// defaultTitleSB.append(env.getDescription(envName));
defaultTitleSB.append(WorkContext.getCurrent().getDescription());
if (editingTemplate != null) {
String path = editingTemplate.getEditingFILE().getPath();
if (!editingTemplate.getEditingFILE().exists()) {

4
designer-base/src/com/fr/design/mainframe/JTemplate.java

@ -544,7 +544,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
boolean access = false;
try {
access = FRContext.getCurrentEnv().getOrganizationOperator().canAccess(this.getEditingFILE().getPath());
access = FRContext.getOrganizationOperator().canAccess(this.getEditingFILE().getPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -594,7 +594,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (isOkOperation(chooseResult)) {
boolean access = false;
try {
access = FRContext.getCurrentEnv().getOrganizationOperator().canAccess(fileChooser.getSelectedFILE().getPath());
access = FRContext.getOrganizationOperator().canAccess(fileChooser.getSelectedFILE().getPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

10
designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe.loghandler.socketio;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.mainframe.loghandler.DesignerLogHandler;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -10,15 +8,13 @@ import com.fr.general.LogRecordTime;
import com.fr.general.LogUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.third.guava.base.Optional;
import com.fr.web.WebSocketConfig;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
import java.io.ByteArrayInputStream;
import java.net.URI;
public class DesignerSocketIO {
@ -61,8 +57,8 @@ public class DesignerSocketIO {
}
private static void updateSocket() {
Env env = FRContext.getCurrentEnv();
if (env.isLocalEnv()) {
if (WorkContext.getCurrent().isLocal()) {
return;
}
try {

3
designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -434,7 +434,8 @@ public abstract class ToolBarMenuDock {
}
private boolean shouldShowRemotePermission() {
return FRContext.getCurrentEnv() != null && !FRContext.getCurrentEnv().isLocalEnv() && FRContext.getCurrentEnv().isRoot();
return WorkContext.getCurrent() != null && !WorkContext.getCurrent().isLocal() && FRContext.getCurrentEnv().isRoot();
}
private boolean shouldShowPlugin() {

7
designer-base/src/com/fr/design/remote/ui/AuthorityEditorPane.java

@ -1,6 +1,5 @@
package com.fr.design.remote.ui;
import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -13,10 +12,10 @@ import com.fr.general.Inter;
import com.fr.report.DesignAuthority;
import com.fr.stable.CoreConstants;
import javax.swing.BorderFactory;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.tree.TreePath;
import java.awt.BorderLayout;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@ -40,7 +39,7 @@ public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> {
tree.setDigIn(true);
tree.setFileNodeFilter(filter);
this.add(new UIScrollPane(tree), BorderLayout.CENTER);
tree.refreshEnv(FRContext.getCurrentEnv());
tree.refreshEnv();
}

2
designer-base/src/com/fr/design/roleAuthority/RoleDataWrapper.java

@ -1 +1 @@
package com.fr.design.roleAuthority; import com.fr.base.FRContext; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.loader.ChildrenNodesLoader; import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * 将权限细粒度的角色数据包装一下,区分报表平台管理角色和数据决策系统角色 * <p/> * Author : daisy * Date: 13-8-30 * Time: 下午3:42 */ public class RoleDataWrapper implements ChildrenNodesLoader { private List<String> rolelist = new ArrayList<String>(); private String roleTypename = null; public RoleDataWrapper(String roleName) { roleTypename = roleName; } /** * 在此计算并获得与管理类型相对应的 */ private void calculateRoleList() { try { Collections.addAll(rolelist, FRContext.getCurrentEnv().getOrganizationOperator().getRoleGroup()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } //加载所有的角色列表 public ExpandMutableTreeNode[] load() { calculateRoleList(); return this.load(this.rolelist); } //从workbook中读取的角色列表 public ExpandMutableTreeNode[] load(List<String> rolelist) { this.rolelist = rolelist; ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[rolelist.size()]; for (int i = 0; i < res.length; i++) { res[i] = new ExpandMutableTreeNode(rolelist.get(i)); } return res; } public String getRoleTypename(){ return roleTypename; } }
package com.fr.design.roleAuthority; import com.fr.base.FRContext; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.loader.ChildrenNodesLoader; import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * 将权限细粒度的角色数据包装一下,区分报表平台管理角色和数据决策系统角色 * <p/> * Author : daisy * Date: 13-8-30 * Time: 下午3:42 */ public class RoleDataWrapper implements ChildrenNodesLoader { private List<String> rolelist = new ArrayList<String>(); private String roleTypename = null; public RoleDataWrapper(String roleName) { roleTypename = roleName; } /** * 在此计算并获得与管理类型相对应的 */ private void calculateRoleList() { try { Collections.addAll(rolelist, FRContext.getOrganizationOperator().getRoleGroup()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } //加载所有的角色列表 public ExpandMutableTreeNode[] load() { calculateRoleList(); return this.load(this.rolelist); } //从workbook中读取的角色列表 public ExpandMutableTreeNode[] load(List<String> rolelist) { this.rolelist = rolelist; ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[rolelist.size()]; for (int i = 0; i < res.length; i++) { res[i] = new ExpandMutableTreeNode(rolelist.get(i)); } return res; } public String getRoleTypename(){ return roleTypename; } }

8
designer-base/src/com/fr/design/widget/IconDefinePane.java

@ -1,15 +1,13 @@
package com.fr.design.widget;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.web.CustomIconPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter;

8
designer-base/src/com/fr/file/FILEChooserPane.java

@ -3,7 +3,6 @@ package com.fr.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicPane;
@ -26,6 +25,7 @@ import com.fr.file.filter.FILEFilter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.adaptor.WorkspaceAdaptor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem;
@ -545,7 +545,7 @@ public class FILEChooserPane extends BasicPane {
return;
}
if (editing == null || !editing.isChartBook()) {
String[] fileSuffix_local = LocalEnv.FILE_TYPE;
String[] fileSuffix_local = WorkspaceAdaptor.FILE_TYPE;
EnumSet<FileExtension> fileExtensions = EnumSet.of(FileExtension.CPT, FileExtension.CPTX, FileExtension.FRM, FileExtension.FRMX, FileExtension.CHT);
if (type == JFileChooser.OPEN_DIALOG) {
if (FRContext.getCurrentEnv().isSupportLocalFileOperate()) { //本地连接
@ -686,7 +686,7 @@ public class FILEChooserPane extends BasicPane {
boolean access = false;
try {
access = FRContext.getCurrentEnv().getOrganizationOperator().canAccess(selectedFile.getPath());
access = FRContext.getOrganizationOperator().canAccess(selectedFile.getPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -1404,7 +1404,7 @@ public class FILEChooserPane extends BasicPane {
boolean access = false;
try {
access = FRContext.getCurrentEnv().getOrganizationOperator().canAccess(currentDirectory.getPath());
access = FRContext.getOrganizationOperator().canAccess(currentDirectory.getPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

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

@ -181,7 +181,7 @@ public class FileNodeFILE implements FILE {
*/
private FileNode[] listFile(String rootFilePath) {
try {
return FRContext.getCurrentEnv().getFileOperator().list(rootFilePath);
return FRContext.getFileOperator().list(rootFilePath);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

6
designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java

@ -1,7 +1,5 @@
package com.fr.van.chart.map.server;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
@ -9,6 +7,7 @@ import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.start.ServerStarter;
import com.fr.workspace.WorkContext;
import java.awt.event.ActionEvent;
@ -26,8 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = ServerConfig.getInstance().getReportServletName();
Env env = FRContext.getCurrentEnv();
ServerStarter.browserURLWithLocalEnv(env.isLocalEnv() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : env.getPath() + "?op=map");
ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : WorkContext.getCurrent().getPath() + "?op=map");
}
}

2
designer-form/src/com/fr/design/parameter/FormParameterReader.java

@ -17,7 +17,7 @@ public class FormParameterReader extends AbstractParameterReader {
public Parameter[] readParameterFromPath(String tplPath) {
if (accept(tplPath, ".frm", ".form")) {
try {
Form form = FormIO.readForm(FRContext.getCurrentEnv(), tplPath);
Form form = FormIO.readForm(tplPath);
return form.getParameters();
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage(), e1);

7
designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader;
import com.fr.base.FRContext;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
@ -32,13 +31,13 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchMana
import com.fr.form.main.Form;
import com.fr.form.main.FormIO;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.general.Inter;
import com.fr.general.http.HttpClient;
import com.fr.io.TemplateWorkBookIO;
import com.fr.io.exporter.ImageExporter;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.main.impl.WorkBook;
import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
@ -507,7 +506,7 @@ public class AlphaFineDialog extends UIDialog {
protected BufferedImage doInBackground() {
Form form = null;
try {
form = FormIO.readForm(FRContext.getCurrentEnv(), fileName);
form = FormIO.readForm(fileName);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
@ -539,7 +538,7 @@ public class AlphaFineDialog extends UIDialog {
protected BufferedImage doInBackground() {
WorkBook workBook = null;
try {
workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(FRContext.getCurrentEnv(), fileName);
workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(fileName);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}

30
designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.alphafine.search.manager.impl;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
@ -81,13 +80,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates")));
return lessModelList;
}
Env env = FRContext.getCurrentEnv();
fileNodes = new ArrayList<>();
fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true);
fileNodes = listTpl(ProjectConstants.REPORTLETS_NAME, true);
AlphaFineHelper.checkCancel();
isContainCpt = true;
isContainFrm = true;
doSearch(this.searchText, true, env);
doSearch(this.searchText, true);
if (stopSearch) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE));
lessModelList.addAll(filterModelList.subList(0, AlphaFineConstants.SHOW_SIZE));
@ -109,21 +107,20 @@ public class FileSearchManager implements AlphaFineSearchProvider {
}
this.filterModelList = new SearchResult();
this.moreModelList = new SearchResult();
Env env = FRContext.getCurrentEnv();
AlphaFineHelper.checkCancel();
isContainCpt = true;
isContainFrm = true;
doSearch(this.searchText, false, env);
doSearch(this.searchText, false);
moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size()));
return moreModelList;
}
private void doSearch(String searchText, boolean needMore, Env env) {
private void doSearch(String searchText, boolean needMore) {
for (FileNode node : fileNodes) {
boolean isAlreadyContain = false;
isAlreadyContain = searchFile(searchText, node, isAlreadyContain, needMore);
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent() && node.getLock() == null) {
searchFileContent(env, searchText, node, isAlreadyContain, needMore);
searchFileContent(searchText, node, isAlreadyContain, needMore);
}
if (filterModelList.size() > AlphaFineConstants.SHOW_SIZE && stopSearch) {
return;
@ -150,7 +147,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
* @param node
* @param isAlreadyContain
*/
private void searchFileContent(Env env, String searchText, FileNode node, boolean isAlreadyContain, boolean needMore) {
private void searchFileContent(String searchText, FileNode node, boolean isAlreadyContain, boolean needMore) {
try {
InputStream inputStream = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, node.getEnvPath().substring(ProjectConstants.REPORTLETS_NAME.length() + 1))));
InputStreamReader isr = new InputStreamReader(inputStream, "UTF-8");
@ -210,15 +207,14 @@ public class FileSearchManager implements AlphaFineSearchProvider {
/**
* 获取工作目录下所有符合要求的模板
*
* @param env
* @param rootFilePath
* @param recurse
* @return
*/
private List<FileNode> listTpl(Env env, String rootFilePath, boolean recurse) {
private List<FileNode> listTpl(String rootFilePath, boolean recurse) {
List<FileNode> fileNodeList = new ArrayList<FileNode>();
try {
listAll(env, rootFilePath, fileNodeList, recurse);
listAll(rootFilePath, fileNodeList, recurse);
} catch (Exception e) {
FRContext.getLogger().error("file search error: " + e.getMessage(), e);
}
@ -228,19 +224,19 @@ public class FileSearchManager implements AlphaFineSearchProvider {
/**
* 获取当前工作目录下所有模板
*
* @param env
* @param rootFilePath
* @param nodeList
* @param recurse
* @throws Exception
*/
private void listAll(Env env, String rootFilePath, List<FileNode> nodeList, boolean recurse) throws Exception {
FileNode[] fns = env.getFileOperator().list(rootFilePath);
private void listAll(String rootFilePath, List<FileNode> nodeList, boolean recurse) throws Exception {
FileNode[] fns = FRContext.getFileOperator().list(rootFilePath);
for (int i = 0; i < fns.length; i++) {
FileNode fileNode = fns[i];
if (fileNode.isDirectory()) {
if (recurse) {
listAll(env, rootFilePath + File.separator + fns[i].getName(), nodeList, true);
listAll(rootFilePath + File.separator + fns[i].getName(), nodeList, true);
} else {
nodeList.add(fns[i]);
}

2
designer-realize/src/com/fr/design/parameter/WorkBookParameterReader.java

@ -17,7 +17,7 @@ public class WorkBookParameterReader extends AbstractParameterReader {
public Parameter[] readParameterFromPath(String tplPath) {
if (accept(tplPath, ".cpt")) {
try {
TemplateWorkBook template = TemplateWorkBookIO.readTemplateWorkBook(FRContext.getCurrentEnv(), tplPath);
TemplateWorkBook template = TemplateWorkBookIO.readTemplateWorkBook(tplPath);
return template.getParameters();
} catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage(), e1);

10
designer-realize/src/com/fr/start/Designer.java

@ -1,9 +1,7 @@
package com.fr.start;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.WebPreviewUtils;
@ -56,6 +54,7 @@ import com.fr.start.jni.SplashMac;
import com.fr.start.module.StartupArgs;
import com.fr.start.preload.ImagePreLoader;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -104,7 +103,7 @@ public class Designer extends BaseDesigner {
//传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));
designerRoot.start();
if (FRContext.getCurrentEnv() instanceof LocalEnv) {
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray
ServerTray.init();
}
@ -533,11 +532,6 @@ public class Designer extends BaseDesigner {
InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime();
collector.saveXMLFile();
Env currentEnv = FRContext.getCurrentEnv();
if (currentEnv == null) {
return;
}
currentEnv.doWhenServerShutDown();
}
}

Loading…
Cancel
Save