Browse Source

无JIRA任务 ServerConfig进一步拆分

master
ju 7 years ago
parent
commit
858f9c6398
  1. 4
      designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  2. 6
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  3. 8
      designer/src/com/fr/design/actions/server/StyleListAction.java
  4. 6
      designer/src/com/fr/design/actions/server/StyleManagerPane.java
  5. 6
      designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java
  6. 5
      designer/src/com/fr/design/module/DesignerModule.java
  7. 6
      designer/src/com/fr/design/present/StyleArrayPane.java
  8. 6
      designer/src/com/fr/design/report/ReportStylePane.java
  9. 7
      designer/src/com/fr/design/report/WriteShortCutsPane.java
  10. 13
      designer/src/com/fr/design/webattr/EditReportServerParameterPane.java
  11. 6
      designer/src/com/fr/grid/selection/CellSelection.java
  12. 20
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  13. 4
      designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java
  14. 4
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  15. 16
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  16. 1
      designer_base/src/com/fr/design/parameter/ParameterArrayPane.java
  17. 2
      designer_base/src/com/fr/design/utils/DesignUtils.java
  18. 2
      designer_base/src/com/fr/start/StartServer.java
  19. 2
      designer_chart/src/com/fr/plugin/chart/map/server/ChartMapEditorAction.java

4
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -6,7 +6,7 @@ package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.base.NameStyle;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.SelectionListenerAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenu;
@ -72,7 +72,7 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() {
UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll();
Iterator iterator = ServerConfig.getInstance().getStyleNameIterator();
Iterator iterator = ServerPreferenceConfig.getInstance().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
NameStyle nameStyle = NameStyle.getInstance(name);

6
designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -4,7 +4,7 @@
package com.fr.design.actions.server;
import com.fr.config.Configuration;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -38,7 +38,7 @@ public class ServerConfigManagerAction extends UpdateAction {
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
final ServerConfig config = ServerConfig.getInstance();
final ServerPreferenceConfig config = ServerPreferenceConfig.getInstance();
final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() {
@Override
public void complete() {
@ -61,7 +61,7 @@ public class ServerConfigManagerAction extends UpdateAction {
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebAttr.class, ServerConfig.class};
return new Class[]{ReportWebAttr.class, ServerPreferenceConfig.class};
}
});

8
designer/src/com/fr/design/actions/server/StyleListAction.java

@ -1,7 +1,7 @@
package com.fr.design.actions.server;
import com.fr.config.Configuration;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -43,19 +43,19 @@ public class StyleListAction extends UpdateAction {
Configurations.update(new Worker() {
@Override
public void run() {
styleListPane.update(ServerConfig.getInstance());
styleListPane.update(ServerPreferenceConfig.getInstance());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
return new Class[]{ServerPreferenceConfig.class};
}
});
}
});
styleListPane.populate(ServerConfig.getInstance().mirror());
styleListPane.populate(ServerPreferenceConfig.getInstance().mirror());
styleListDialog.setVisible(true);
}

6
designer/src/com/fr/design/actions/server/StyleManagerPane.java

@ -1,6 +1,6 @@
package com.fr.design.actions.server;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
@ -35,7 +35,7 @@ public class StyleManagerPane extends BasicPane {
return Inter.getLocText("ServerM-Predefined_Styles");
}
public void populate(ServerConfig configManager) {
public void populate(ServerPreferenceConfig configManager) {
//todo 原来界面上显示的xml路径
// this.StyleTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
@ -43,7 +43,7 @@ public class StyleManagerPane extends BasicPane {
this.styleArrayPane.populate(configManager);
}
public void update(ServerConfig configManager) {
public void update(ServerPreferenceConfig configManager) {
this.styleArrayPane.update(configManager);
}
}

6
designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java

@ -3,7 +3,7 @@ package com.fr.design.mainframe.cell.settingpane.style;
import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerBean;
@ -142,8 +142,8 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
*/
public void refreshBeanElement() {
defaultListModel.removeAllElements();
if (ServerConfig.getInstance().hasStyle()) {
Iterator iterato = ServerConfig.getInstance().getStyleNameIterator();
if (ServerPreferenceConfig.getInstance().hasStyle()) {
Iterator iterato = ServerPreferenceConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) {
String name = (String) iterato.next();
NameStyle nameStyle = NameStyle.getInstance(name);

5
designer/src/com/fr/design/module/DesignerModule.java

@ -10,7 +10,7 @@ import com.fr.base.TempNameStyle;
import com.fr.base.io.XMLEncryptUtils;
import com.fr.base.process.ProcessOperator;
import com.fr.base.remote.RemoteDeziConstants;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory;
@ -47,7 +47,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.ModuleContext;
import com.fr.general.xml.GeneralXMLTools;
@ -395,7 +394,7 @@ public class DesignerModule extends DesignModule {
public void actionPerformed(ActionEvent e) {
try {
for (int i = 0; i < namelist.size(); i++) {
ServerConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
ServerPreferenceConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
}
} catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage());

6
designer/src/com/fr/design/present/StyleArrayPane.java

@ -1,7 +1,7 @@
package com.fr.design.present;
import com.fr.base.Style;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.controlpane.AbstractNameableCreator;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
@ -64,7 +64,7 @@ public class StyleArrayPane extends JListControlPane {
/**
* Populate
*/
public void populate(ServerConfig configManager) {
public void populate(ServerPreferenceConfig configManager) {
if (configManager == null) {
return;
}
@ -90,7 +90,7 @@ public class StyleArrayPane extends JListControlPane {
/**
* Update.
*/
public void update(ServerConfig configManager) {
public void update(ServerPreferenceConfig configManager) {
configManager.clearAllStyle();
// Nameable[]居然不能强转成Parameter[],一定要这么写...

6
designer/src/com/fr/design/report/ReportStylePane.java

@ -1,6 +1,6 @@
package com.fr.design.report;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -35,8 +35,8 @@ public class ReportStylePane extends StylePane {
if (ComparatorUtils.equals(name, "")) {
return;
}
if (ServerConfig.getInstance().getStyle(name) == null) {
ServerConfig.getInstance().putStyle(name, ReportStylePane.this.updateBean());
if (ServerPreferenceConfig.getInstance().getStyle(name) == null) {
ServerPreferenceConfig.getInstance().putStyle(name, ReportStylePane.this.updateBean());
} else {
JOptionPane.showMessageDialog(getParent(), Inter.getLocText("FR-Designer_This_Name_Has_Exsit") + "!", Inter.getLocText("FR-Designer_Warning"), JOptionPane.WARNING_MESSAGE);
}

7
designer/src/com/fr/design/report/WriteShortCutsPane.java

@ -2,8 +2,7 @@ package com.fr.design.report;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -29,7 +28,7 @@ public class WriteShortCutsPane extends JPanel{
this.add(getFeatureNamePane());
this.add(getHintsPane());
if(!ServerConfig.getInstance().isWriteShortCuts()){
if(!ServerPreferenceConfig.getInstance().isWriteShortCuts()){
nextColString = "Enter";
nextRowString = "Tab";
switchColRow();
@ -105,7 +104,7 @@ public class WriteShortCutsPane extends JPanel{
nextRowString = temp;
switchColRow();
ServerConfig.getInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab"));
ServerPreferenceConfig.getInstance().setWriteShortCuts(ComparatorUtils.equals(nextColString, "Tab"));
}
};

13
designer/src/com/fr/design/webattr/EditReportServerParameterPane.java

@ -4,8 +4,7 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
@ -73,11 +72,11 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
return Inter.getLocText("ReportServerP-Report_server_parameter");
}
public void populate(ServerConfig reportServerConfig) {
public void populate(ServerPreferenceConfig reportServerPreferenceConfig) {
//todo 原来界面上显示的xml路径
// this.configFileTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator +
// ProjectConstants.RESOURCES_NAME +
// File.separator + reportServerConfig.fileName());
// File.separator + reportServerPreferenceConfig.fileName());
webAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (webAttr != null) {
@ -89,13 +88,13 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
jsPane.populate(webAttr);
}
this.errorTemplatePane.populateBean(reportServerConfig.getErrorTemplate());
this.errorTemplatePane.populateBean(reportServerPreferenceConfig.getErrorTemplate());
}
/**
* Update.
*/
public void update(ServerConfig reportServerConfig) {
public void update(ServerPreferenceConfig reportServerPreferenceConfig) {
ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
webAttr.setWebPage(pagePane.updateBean());
webAttr.setWebView(viewPane.updateBean());
@ -105,6 +104,6 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
jsPane.update(webAttr);
reportServerConfig.setErrorTemplate(this.errorTemplatePane.updateBean());
reportServerPreferenceConfig.setErrorTemplate(this.errorTemplatePane.updateBean());
}
}

6
designer/src/com/fr/grid/selection/CellSelection.java

@ -5,7 +5,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.NameStyle;
import com.fr.base.Utils;
import com.fr.cache.list.IntList;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
@ -456,10 +456,10 @@ public class CellSelection extends Selection {
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
// richer:add global style menu
popup.add(new CellExpandAttrAction().createMenuItem());
if (!ServerConfig.getInstance().hasStyle()) {
if (!ServerPreferenceConfig.getInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
Iterator iterato = ServerConfig.getInstance().getStyleNameIterator();
Iterator iterato = ServerPreferenceConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) {
String name = (String) iterato.next();
name = GlobalStyleMenuDef.judgeChina(name);

20
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -1,8 +1,7 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog;
@ -27,16 +26,8 @@ import com.fr.general.FRFont;
import com.fr.general.FRLevel;
import com.fr.general.Inter;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Window;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -371,6 +362,7 @@ public class PreferencePane extends BasicPane {
logLevelPane.add(logLevelComboBox);
logLevelComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
}
});
@ -550,7 +542,7 @@ public class PreferencePane extends BasicPane {
paginationLineColorTBButton.setColor(designerEnvManager.getPaginationLineColor());
this.logExportDirectoryField.setText(designerEnvManager.getLogLocation());
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ServerConfig.getInstance().getServerLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
@ -630,7 +622,7 @@ public class PreferencePane extends BasicPane {
if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);
}
ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel());
}

4
designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java

@ -6,7 +6,7 @@ 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.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -63,7 +63,7 @@ public class GlobalParameterAction extends UpdateAction {
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
return new Class[]{ServerPreferenceConfig.class};
}
});

4
designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -1,6 +1,6 @@
package com.fr.design.hyperlink;
import com.fr.config.ServerConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
@ -80,7 +80,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
protected void populateSubHyperlinkBean(WebHyperlink link) {
String url = link.getURL();
if (StringUtils.isBlank(url)) {
url = ServerConfig.getInstance().getHyperlinkAddress();
url = ServerPreferenceConfig.getInstance().getHyperlinkAddress();
}
this.urlTextField.setText(url);
if (itemNameTextField != null) {

16
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe.loghandler;
import com.fr.base.BaseUtils;
import com.fr.base.ServerConfig;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory;
@ -15,23 +15,13 @@ import com.fr.log.LogHandler;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.xml.LogRecordTimeProvider;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextPane;
import javax.swing.KeyStroke;
import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;

1
designer_base/src/com/fr/design/parameter/ParameterArrayPane.java

@ -2,7 +2,6 @@ package com.fr.design.parameter;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.config.ServerConfig;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.NameableSelfCreator;

2
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -1,13 +1,13 @@
package com.fr.design.utils;
import com.fr.base.BaseUtils;
import com.fr.base.ServerConfig;
import com.fr.base.Env;
import com.fr.base.EnvException;
import com.fr.base.FRContext;
import com.fr.base.FeedBackInfo;
import com.fr.base.Utils;
import com.fr.base.remote.RemoteDeziConstants;
import com.fr.config.ServerConfig;
import com.fr.dav.DavXMLUtils;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;

2
designer_base/src/com/fr/start/StartServer.java

@ -1,7 +1,7 @@
package com.fr.start;
import com.fr.base.ServerConfig;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.data.datapane.TableDataTreePane;

2
designer_chart/src/com/fr/plugin/chart/map/server/ChartMapEditorAction.java

@ -1,8 +1,8 @@
package com.fr.plugin.chart.map.server;
import com.fr.base.ServerConfig;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.general.GeneralContext;

Loading…
Cancel
Save