Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~zheng/C-design into release/10.0

master
zheng 6 years ago
parent
commit
459fa97fe4
  1. 13
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 30
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  3. 20
      designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java
  4. 30
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  5. 18
      designer-base/src/main/java/com/fr/design/actions/server/ProcedureListAction.java
  6. 27
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  7. 18
      designer-base/src/main/java/com/fr/design/formula/VariableResolverAdapter.java
  8. 11
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  9. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  10. 11
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java
  11. 1
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogAppender.java
  12. 82
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  13. 46
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogImpl.java
  14. 2
      designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java
  16. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java
  17. 10
      designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java
  18. 12
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java
  19. 10
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java
  20. 8
      designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java
  21. 16
      designer-realize/src/main/java/com/fr/design/actions/report/ReportWebAttrAction.java
  22. 20
      designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java
  23. 3
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  24. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java
  25. 2
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  26. 31
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  27. 17
      designer-realize/src/main/java/com/fr/start/Designer.java
  28. 5
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  29. 18
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  30. 19
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

13
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -22,7 +22,8 @@ import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Iterator;
@ -108,9 +109,8 @@ public class SwitchExistEnv extends MenuDef {
try {
workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return;
}
WorkContext.switchTo(workspace, new WorkContextCallback() {
@ -125,9 +125,8 @@ public class SwitchExistEnv extends MenuDef {
}
});
} catch (AuthException exception) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
}
}

30
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server;
import com.fr.config.Configuration;
import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
@ -16,10 +15,11 @@ import com.fr.file.ConnectionConfig;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
import java.util.Map;
@ -74,26 +74,27 @@ public class ConnectionListAction extends UpdateAction {
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
Configurations.update(new Worker() {
@Override
public void run() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
databaseManagerPane.update(datasourceManager);
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}.addCallBack(new CallBackAdaptor() {
@Override
public boolean beforeCommit() {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
});
}));
}
});
databaseListDialog.setVisible(true);
@ -109,7 +110,6 @@ public class ConnectionListAction extends UpdateAction {
* @return boolean 是否更新成功
*/
public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
connectionShowPane.update(datasourceManager);
boolean isFailed = false;
//存在请重命名则不能更新
int index = isConnectionMapContainsRename(datasourceManager);

20
designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.ParameterConfig;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
@ -16,10 +15,11 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.parameter.ParameterManagerPane;
import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@ -49,23 +49,21 @@ public class GlobalParameterAction extends UpdateAction {
parameterManagerPane.populate(ParameterConfig.getInstance().getGlobalParameters());
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override
public void run() {
//apply new parameter list.
parameterManagerPane.update();
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.parameterChanged();
}
parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerPreferenceConfig.class};
}
});
}));
}
});

30
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -21,10 +21,12 @@ import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Map;
@ -92,33 +94,35 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
globalTableDataDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
Configurations.update(new Worker() {
@Override
public void run() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
Configurations.modify(new WorkerFacade(TableDataConfig.class) {
@Override
public void run() {
globalTableDataPane.update(tableDataConfig);
if (!doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog)) {
}
}.addCallBack(new CallBackAdaptor() {
@Override
public boolean beforeCommit() {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
return doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog);
}
@Override
public void afterCommit() {
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{TableDataConfig.class};
}
});
}));
}
});
globalTableDataDialog.setVisible(true);

18
designer-base/src/main/java/com/fr/design/actions/server/ProcedureListAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
@ -13,8 +12,9 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.ProcedureConfig;
import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import java.awt.event.ActionEvent;
@ -44,20 +44,18 @@ public class ProcedureListAction extends UpdateAction {
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
Configurations.update(new Worker() {
DesignTableDataManager.clearGlobalDs();
Configurations.modify(new WorkerFacade(ProcedureConfig.class) {
@Override
public void run() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(procedureConfig);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
}.addCallBack(new CallBackAdaptor() {
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ProcedureConfig.class};
public void afterCommit() {
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
});
}));
}
});
databaseListDialog.setVisible(true);

27
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -1,7 +1,5 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
@ -13,11 +11,12 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.SwingUtilities;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
@ -100,22 +99,24 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false);
return;
}
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
if (!ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
connectionListPane.update(connectionConfig);
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}.addCallBack(new CallBackAdaptor() {
@Override
public boolean beforeCommit() {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane, connectionListDialog);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
});
}));
}
});

18
designer-base/src/main/java/com/fr/design/formula/VariableResolverAdapter.java

@ -3,10 +3,10 @@ package com.fr.design.formula;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.general.web.ParameterConstants;
import com.fr.plugin.ExtraClassManager;
import com.fr.script.ScriptConstants;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.fun.BuiltInParametersProvider;
import com.fr.stable.script.CalculatorProvider;
@ -24,11 +24,13 @@ public abstract class VariableResolverAdapter implements VariableResolver {
* @return 内置参数
*/
public String[] resolveCurReportVariables() {
String [] variables = new String[] { ScriptConstants.SUMMARY_TAG + "page_number",
String[] variables = new String[]{
ScriptConstants.SUMMARY_TAG + "page_number",
ScriptConstants.SUMMARY_TAG + "totalPage_number",
// 下面是权限相关的参数
ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_USERNAME, ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_AUTHORITY,
ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_DEPARTMETN_AND_POST,
ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_USERNAME,
ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_ROLE,
ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_POSITION,
// 空值参数
"NULL", "NOFILTER",
// request变量
@ -37,7 +39,7 @@ public abstract class VariableResolverAdapter implements VariableResolver {
};
Set<BuiltInParametersProvider> set = ExtraClassManager.getInstance().getArray(BuiltInParametersProvider.XML_TAG);
for (BuiltInParametersProvider provider : set) {
return (String[]) ArrayUtils.addAll(variables, new String []{
return (String[]) ArrayUtils.addAll(variables, new String[]{
ScriptConstants.DETAIL_TAG + provider.getParametersName()
});
}
@ -46,12 +48,12 @@ public abstract class VariableResolverAdapter implements VariableResolver {
private Parameter[] getCurrentModeParameters(int type) {
Parameter[] parameters = null;
if(DesignModelAdapter.getCurrentModelAdapter() == null) {
if (DesignModelAdapter.getCurrentModelAdapter() == null) {
parameters = new Parameter[0];
} else {
if(type == TABLE_DATA_PARA) {
if (type == TABLE_DATA_PARA) {
parameters = DesignModelAdapter.getCurrentModelAdapter().getTableDataParameters();
} else if(type == REPORT_DATA_PARA){
} else if (type == REPORT_DATA_PARA) {
parameters = DesignModelAdapter.getCurrentModelAdapter().getReportParameters();
}
}

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

@ -1009,16 +1009,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/
private void activeTemplate(FILE tplFile, JTemplate jt) {
// 如果该模板已经打开,则进行激活就可以了
String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()});
if (tplFile instanceof FileNodeFILE) {
fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath();
}
// 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行
if (tplFile instanceof FileFILE) {
fullName = tplFile.getPath();
}
fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/");
int index = HistoryTemplateListPane.getInstance().contains(fullName);
int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath());
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
if (index != -1) {
historyList.get(index).activeJTemplate(index, jt);

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

@ -36,6 +36,7 @@ import com.fr.io.utils.ResourceIOUtils;
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 javax.swing.event.DocumentEvent;
@ -149,7 +150,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(openReportAction, refreshTreeAction);
if (WorkContext.getCurrent().isLocal()) {
toolbarDef.addShortCut(openFolderAction, renameAction);
}
toolbarDef.addShortCut(delFileAction);
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts();
for (ShortCut shortCut : extraShortCuts) {
@ -158,6 +161,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
toolbarDef.updateToolBar(toolBar);
refreshActions();
refresh();
}

11
designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

@ -20,6 +20,7 @@ import com.fr.stable.EnvChangedListener;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException;
import javax.swing.*;
import java.awt.*;
@ -135,13 +136,11 @@ public class TemplatePane extends JPanel implements MouseListener {
try {
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}
WorkContext.switchTo(workspace, new WorkContextCallback() {
@Override
public void done() {
DesignerEnvManager.getEnvManager().setCurEnvName(selectedName);
@ -153,8 +152,8 @@ public class TemplatePane extends JPanel implements MouseListener {
template.refreshToolArea();
}
setJLabel(selectedName);
} catch (Exception e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}),
} catch (AuthException e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}

1
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogAppender.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.loghandler;
import com.fr.general.FRLogLevel;
import com.fr.third.apache.log4j.AppenderSkeleton;
import com.fr.third.apache.log4j.Level;
import com.fr.third.apache.log4j.spi.LoggingEvent;

82
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -1,17 +1,16 @@
package com.fr.design.mainframe.loghandler;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogLevel;
import com.fr.general.Inter;
import com.fr.general.LogRecordTime;
import com.fr.general.log.Log4jConfig;
import com.fr.stable.xml.LogRecordTimeProvider;
import com.fr.log.FineLoggerFactory;
import com.fr.third.apache.log4j.Level;
import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.third.apache.log4j.spi.ThrowableInformation;
import javax.swing.*;
import javax.swing.text.BadLocationException;
@ -29,11 +28,13 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.LogRecord;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DesignerLogHandler {
private static final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
protected static final int INFO_INT = Level.INFO.toInt();
protected static final int ERROR_INT = Level.ERROR.toInt();
protected static final int WARN_INT = Level.WARN.toInt();
@ -67,7 +68,6 @@ public class DesignerLogHandler {
public void actionPerformed(ActionEvent e) {
logHandlerArea.jTextArea.setText("");
caption.clearMessage();
DesignerLogImpl.getInstance().clear();
}
});
caption.addSelectedListener(new ActionListener() {
@ -84,10 +84,6 @@ public class DesignerLogHandler {
public void itemStateChanged(ItemEvent e) {
logHandlerArea.jTextArea.setText("");
caption.clearMessage();
LogRecordTimeProvider[] recorders = DesignerLogImpl.getInstance().getRecorders();
for (LogRecordTimeProvider logRecordTime : recorders) {
logHandlerArea.printStackTrace(logRecordTime);
}
}
};
showInfo = new JCheckBoxMenuItem(Inter.getLocText(new String[]{"Display", "Normal", "Info"}), true);
@ -193,55 +189,52 @@ public class DesignerLogHandler {
public void actionPerformed(ActionEvent evt) {
resultPane.setText("");
caption.clearMessage();
DesignerLogImpl.getInstance().clear();
}
});
return resultPane;
}
public void printStackTrace(LogRecordTimeProvider logRecordTime) {
LogRecord logRecord = logRecordTime.getLogRecord();
Date date = logRecordTime.getDate();
int logLevelvalue = logRecord.getLevel().intValue();
if (logLevelvalue == INFO_INT && showInfo.isSelected()) {
printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown());
} else if (logLevelvalue == ERROR_INT && showError.isSelected()) {
printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown());
} else if (logLevelvalue == WARN_INT && showServer.isSelected()) {
printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown());
public void printStackTrace(LoggingEvent event) {
int intLevel = event.getLevel().toInt();
Date date = new Date(event.getTimeStamp());
ThrowableInformation information = event.getThrowableInformation();
if (intLevel == INFO_INT && showInfo.isSelected()) {
printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable());
} else if (intLevel == ERROR_INT && showError.isSelected()) {
printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable());
} else if (intLevel == WARN_INT && showServer.isSelected()) {
printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable());
}
}
public void printStackTrace(String message, Level level, Date date) {
int logLevelvalue = level.toInt();
if (logLevelvalue == INFO_INT && showInfo.isSelected()) {
printMessage(message, logLevelvalue, date);
} else if (logLevelvalue == ERROR_INT && showError.isSelected()) {
printMessage(message, logLevelvalue, date);
} else if (logLevelvalue == WARN_INT && showServer.isSelected()) {
printMessage(message, logLevelvalue, date);
int intLevel = level.toInt();
if (intLevel == INFO_INT && showInfo.isSelected()) {
printMessage(message, intLevel, date);
} else if (intLevel == ERROR_INT && showError.isSelected()) {
printMessage(message, intLevel, date);
} else if (intLevel == WARN_INT && showServer.isSelected()) {
printMessage(message, intLevel, date);
}
}
private void printMessage(String message, int logLevelvalue, Date date) {
printMessage(message, logLevelvalue, date, null);
private void printMessage(String message, int intLevel, Date date) {
printMessage(message, intLevel, date, null);
}
private void printMessage(String messange, int logLevelvalue, Date date, Throwable e) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
this.log(simpleDateFormat.format(date) + "\n", 0);
String message = swithInter(messange, logLevelvalue);
this.log(message, logLevelvalue);
setMessage(message, logLevelvalue);
private void printMessage(String msg, int intLevel, Date date, Throwable e) {
this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0);
String message = appendLocaleMark(msg, intLevel);
this.log(message, intLevel);
setMessage(message, intLevel);
if (e == null) {
return;
}
StackTraceElement[] stacktraceelement = e.getStackTrace();
for (int i = 0; i < stacktraceelement.length; i++) {
this.log("\t" + "at " + stacktraceelement[i].toString() + "\n", 0);
StackTraceElement[] traceElements = e.getStackTrace();
for (int i = 0; i < traceElements.length; i++) {
this.log("\t" + "at " + traceElements[i].toString() + "\n", 0);
}
}
@ -264,11 +257,11 @@ public class DesignerLogHandler {
try {
doc.insertString(doc.getLength(), str, attrSet);
} catch (BadLocationException e) {
FRContext.getLogger().error(e.getMessage());
FineLoggerFactory.getLogger().error(e.getMessage());
}
}
private String swithInter(String str, int style) {
private String appendLocaleMark(String str, int style) {
if (style == ERROR_INT) {
str = Inter.getLocText("FR-Designer_Alert") + ":" + str + "\n";
} else if (style == WARN_INT) {
@ -318,14 +311,13 @@ public class DesignerLogHandler {
} else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.clear.getText())) {
LogHandlerArea.this.jTextArea.setText("");
caption.clearMessage();
DesignerLogImpl.getInstance().clear();
}
}
};
}
public void printRemoteLog(LogRecordTime logRecordTime) {
logHandlerArea.printStackTrace(logRecordTime);
public void printLoggingEvent(LoggingEvent event) {
logHandlerArea.printStackTrace(event);
}
}

46
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogImpl.java

@ -1,46 +0,0 @@
package com.fr.design.mainframe.loghandler;
import com.fr.stable.fun.impl.AbstractLogProvider;
import com.fr.stable.xml.LogRecordTimeProvider;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2016/1/11 0011.
*/
public class DesignerLogImpl extends AbstractLogProvider{
private static DesignerLogImpl instance = new DesignerLogImpl();
public static DesignerLogImpl getInstance(){
return instance;
}
private DesignerLogImpl(){
}
private List<LogRecordTimeProvider> records = new ArrayList<LogRecordTimeProvider>();
/**
* 清除内存中的日志记录
*/
public void clear(){
records.clear();
}
/**
* 获取所有日志信息
*
* @return 日志信息
*/
public LogRecordTimeProvider[] getRecorders(){
return records.toArray(new LogRecordTimeProvider[records.size()]);
}
@Override
public void record(LogRecordTimeProvider logRecordTime) {
records.add(logRecordTime);
}
}

2
designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java

@ -18,12 +18,12 @@ import com.fr.design.remote.RemoteDesignAuthorityCreator;
import com.fr.design.remote.ui.list.AuthorityList;
import com.fr.design.remote.ui.list.AuthorityListCellRenderer;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.workspace.server.authority.RemoteDesignMember;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.report.DesignAuthority;
import com.fr.stable.ArrayUtils;
import com.fr.workspace.server.authority.RemoteDesignMember;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;

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

@ -13,12 +13,12 @@ import com.fr.design.remote.ui.list.AddedMemberListCellRender;
import com.fr.design.remote.ui.list.AddingMemberList;
import com.fr.design.remote.ui.list.AddingMemberListCellRender;
import com.fr.design.remote.ui.list.MemberListSelectedChangeListener;
import com.fr.workspace.server.authority.RemoteDesignMember;
import com.fr.workspace.server.authority.decision.DecisionOperator;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.ImmutableList;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.authority.RemoteDesignMember;
import com.fr.workspace.server.authority.decision.DecisionOperator;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;

16
designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java

@ -3,12 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.designer.beans.actions.behavior.UpdateBehavior;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.*;
import java.awt.event.ActionEvent;
public abstract class FormWidgetEditAction extends TemplateComponentAction<FormDesigner> {
@ -32,17 +27,6 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction<FormD
@Override
public void actionPerformed(ActionEvent evt) {
super.actionPerformed(evt);
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
FunctionProcessor functionProcessor;
if (evt.getSource() instanceof JButton) {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_TOOLBAR;
} else {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_POPUPMENU;
}
processor.recordFunction(functionProcessor);
}
}
public void setUpdateBehavior(UpdateBehavior updateBehavior) {

10
designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java

@ -15,11 +15,8 @@ import com.fr.file.FILE;
import com.fr.form.main.Form;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
@ -67,11 +64,6 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark());
}
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_FRM);
}
// 设置移动端属性并刷新界面
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();

12
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java

@ -7,12 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.WatermarkRenderer;
import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper;
import com.fr.design.report.WatermarkPane;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2018/5/15.
@ -43,11 +40,6 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor {
public void doOk() {
setValue(watermarkPane.update());
fireStateChanged();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
}
});
watermarkPane.populate((WatermarkAttr) getValue());

10
designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -12,12 +12,9 @@ import com.fr.file.FILE;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
@ -67,11 +64,6 @@ public class ReportMobileAttrAction extends JWorkBookAction{
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark());
}
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_CPT);
}
// 设置移动端属性并刷新界面
wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后
jwb.fireTargetModified();

8
designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java

@ -9,10 +9,7 @@ import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.WatermarkPane;
import com.fr.main.impl.WorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.core.ReportUtils;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import java.awt.event.ActionEvent;
@ -45,11 +42,6 @@ public class ReportWatermarkAction extends JWorkBookAction {
public void doOk() {
wbTpl.addAttrMark(watermarkPane.update());
jwb.fireTargetModified();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
}
}).setVisible(true);
}

16
designer-realize/src/main/java/com/fr/design/actions/report/ReportWebAttrAction.java

@ -3,7 +3,6 @@
*/
package com.fr.design.actions.report;
import com.fr.config.Configuration;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -13,8 +12,9 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWebAttrPane;
import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import com.fr.web.attr.ReportWebAttr;
import java.awt.event.ActionEvent;
@ -56,19 +56,17 @@ public class ReportWebAttrAction extends JWorkBookAction {
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(ReportWebAttr.class) {
@Override
public void run() {
wbTpl.setReportWebAttr(reportWebAttrPane.update());
jwb.fireTargetModified();
}
}.addCallBack(new CallBackAdaptor() {
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebAttr.class};
public void afterCommit() {
jwb.fireTargetModified();
}
});
}));
}
});

20
designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -12,10 +11,11 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.WidgetManagerPane;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
public class WidgetManagerAction extends UpdateAction {
@ -45,22 +45,22 @@ public class WidgetManagerAction extends UpdateAction {
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame, new DialogActionAdapter() {
@Override
public void doOk() {
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(WidgetInfoConfig.class) {
@Override
public void run() {
widgetManagerPane.update(widgetManager);
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.widgetConfigChanged();
}
designerFrame.getSelectedJTemplate().refreshToolArea();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{WidgetInfoConfig.class};
}
});
}));
}
});

3
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -88,6 +88,7 @@ public class SelectedDataColumnPane extends BasicPane {
private static final Pattern COLUMN_NAME_PATTERN = Pattern.compile("[^\\d]");
/**
* 数据集下拉框变动后修改数据列下拉框加载状态的监听器
*/
@ -236,6 +237,8 @@ public class SelectedDataColumnPane extends BasicPane {
ps = dsColumn.getParameters();
addListener();
//重新设置需要加载
columnNameComboBox.setLoaded(false);
}
/**

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java

@ -22,8 +22,8 @@ public class FileModel extends AlphaCellModel {
public FileModel(String name, String filePath) {
super(name, null, CellType.FILE);
this.filePath = filePath;
setDescription(AlphaFineHelper.findFolderName(filePath));
this.filePath = filePath.replaceAll("\\\\", "/");
setDescription(AlphaFineHelper.findFolderName(this.filePath));
}
public String getFilePath() {

2
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -107,7 +107,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
return StringUtils.EMPTY;
}
String bookPath = infor.getBookPath();
String bookPath = infor.getRelativePath();
// 这个iofile只读一个templateid, 其他以后有需要再读.
IOFile file = new IOFile() {
@Override

31
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -4,48 +4,55 @@ import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogHandler;
import com.fr.workspace.server.socket.SocketInfoOperator;
import com.fr.event.EventDispatcher;
import com.fr.general.Inter;
import com.fr.general.LogRecordTime;
import com.fr.general.LogUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.serialization.SerializerHelper;
import com.fr.stable.ArrayUtils;
import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.third.guava.base.Optional;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.engine.server.rpc.netty.RemoteCallClient;
import com.fr.workspace.server.socket.SocketInfoOperator;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import java.io.ByteArrayInputStream;
import javax.swing.*;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
public class DesignerSocketIO {
enum Status {
Connected,
Disconnected,
Disconnecting
}
private static Optional<Socket> socketIO = Optional.absent();
public static Status status = Status.Disconnected;
private static final Emitter.Listener printLog = new Emitter.Listener() {
@Override
public void call(Object... objects) {
if (ArrayUtils.isNotEmpty(objects)) {
try {
LogRecordTime[] logRecordTimes = LogUtils.readXMLLogRecords(new ByteArrayInputStream((byte[]) objects[0]));
for (LogRecordTime logRecordTime : logRecordTimes) {
DesignerLogHandler.getInstance().printRemoteLog(logRecordTime);
}
LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]);
DesignerLogHandler.getInstance().printLoggingEvent(event);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
};
public static void close() {
if (socketIO.isPresent()) {
status = Status.Disconnecting;
socketIO.get().close();
socketIO = Optional.absent();
}
@ -71,11 +78,15 @@ public class DesignerSocketIO {
socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
@Override
public void call(Object... objects) {
if (status != Status.Disconnecting) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
status = Status.Disconnected;
}
});
socketIO.get().connect();
status = Status.Connected;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

17
designer-realize/src/main/java/com/fr/start/Designer.java

@ -42,12 +42,12 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.module.Module;
import com.fr.module.ModuleContext;
import com.fr.record.analyzer.FineAnalyzer;
import com.fr.stable.BuildContext;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.lifecycle.LifecycleFatalError;
import com.fr.stable.xml.XMLTools;
import com.fr.start.fx.SplashFx;
import com.fr.start.jni.SplashMac;
@ -56,14 +56,9 @@ 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;
import javax.swing.*;
import javax.swing.border.MatteBorder;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@ -96,8 +91,6 @@ public class Designer extends BaseDesigner {
*/
public static void main(String[] args) {
FineAnalyzer.init();
BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
@ -115,7 +108,11 @@ public class Designer extends BaseDesigner {
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
//传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));
try {
designerRoot.start();
} catch (LifecycleFatalError fatal) {
System.exit(0);
}
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray

5
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -48,7 +48,6 @@ import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.form.FormElementCaseDesigner;
import com.fr.design.mainframe.form.FormReportComponentComposite;
import com.fr.design.mainframe.loghandler.DesignerLogAppender;
import com.fr.design.mainframe.loghandler.DesignerLogImpl;
import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.socketio.DesignerSocketIO;
import com.fr.design.module.DesignModuleFactory;
@ -91,7 +90,6 @@ import com.fr.report.cell.painter.CellImagePainter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.fun.LogProvider;
import com.fr.stable.plugin.ExtraDesignClassManagerProvider;
import com.fr.stable.script.CalculatorProviderContext;
import com.fr.stable.script.ValueConverter;
@ -100,7 +98,7 @@ import com.fr.stable.xml.ObjectXMLWriterFinder;
import com.fr.start.BBSGuestPaneProvider;
import com.fr.xml.ReportXMLUtils;
import java.awt.Image;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
@ -165,7 +163,6 @@ public class DesignerActivator extends Activator implements Prepare {
InformationCollector.getInstance().collectStartTime();
ExtraDesignClassManager.getInstance().getFeedback().didFeedback();
StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance());
}
private static void preLoadPane() {

18
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -1,14 +1,16 @@
package com.fr.start.module;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.general.ComparatorUtils;
import com.fr.module.Activator;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics;
import com.fr.start.Designer;
import com.fr.start.EnvSwitcher;
import com.fr.start.ServerStarter;
import com.fr.start.SplashContext;
import com.fr.startup.activators.BasicActivator;
import com.fr.workspace.Workspace;
@ -31,10 +33,20 @@ public class DesignerStartup extends Activator {
startSub(BasicActivator.class);
final String[] args = getModule().upFindSingleton(StartupArgs.class).get();
final Designer designer = new Designer(args);
//启动env
startSub(DesignerWorkspaceProvider.class);
//启动env
startSub(EnvBasedModule.class);
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
if (args != null) {
for (String arg : args) {
if (ComparatorUtils.equals(arg, "demo")) {
DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
ServerStarter.browserDemoURL();
break;
}
}
}
ExecutorService service = Executors.newSingleThreadExecutor();
registerEnvListener();
service.submit(new Runnable() {

19
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -1,10 +1,9 @@
package com.fr.start.module;
import com.fr.design.DesignerEnvManager;
import com.fr.general.ComparatorUtils;
import com.fr.module.Activator;
import com.fr.start.EnvSwitcher;
import com.fr.start.ServerStarter;
/**
* Created by juhaoyu on 2018/1/8.
@ -17,20 +16,10 @@ public class DesignerWorkspaceProvider extends Activator {
//检查环境
DesignerEnvManager.checkNameEnvMap();
String[] args = getModule().upFindSingleton(StartupArgs.class).get();
if (args != null) {
for (String arg : args) {
if (ComparatorUtils.equals(arg, "demo")) {
DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
ServerStarter.browserDemoURL();
break;
}
}
}
getRoot().setSingleton(EnvSwitcher.class, new EnvSwitcher());
EnvSwitcher switcher = new EnvSwitcher();
//设置好环境即可,具体跟环境有关的模块会自动调用
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
switcher.switch2LastEnv();
getRoot().setSingleton(EnvSwitcher.class, switcher);
}

Loading…
Cancel
Save