Browse Source

Merge pull request #9778 in DESIGN/design from release/11.0 to final/11.0

* commit '321f06299cd1d571de40a5c910ba22456c5a1d0e':
  REPORT-77337 表头排序-表头区域异常
  REPORT-74376 存储结构变化
  REPORT-74376 clone下map
  REPORT-74376 支持存储FVS设计器相关配置
new-design
superman 2 years ago
parent
commit
a0de9f07cc
  1. 18
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 83
      designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java
  3. 2
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

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

@ -20,6 +20,7 @@ import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.login.DesignerLoginType;
import com.fr.design.login.config.DesignerLoginConfigManager;
import com.fr.design.mainframe.ComponentReuseNotifyUtil;
import com.fr.design.mainframe.simple.SimpleDesignerConfig;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.notification.SnapChatConfig;
@ -226,6 +227,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private boolean propertiesUsable;
private SimpleDesignerConfig fvsDesignerConfig = SimpleDesignerConfig.getInstance("FvsDesignerConfig");
/**
* DesignerEnvManager.
*/
@ -1012,6 +1015,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.designerStartupConfig.setEnabled(enabled);
}
public SimpleDesignerConfig getFvsDesignerConfig() {
return fvsDesignerConfig;
}
/**
* 返回环境名称迭代器
*/
@ -1863,6 +1870,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
readSnapChatConfig(reader);
} else if (name.equals(DesignerLoginConfigManager.XML_TAG)) {
readDesignerLoginAttr(reader);
} else if (name.equals(fvsDesignerConfig.getName())) {
readFvsDesignerConfig(reader);
} else {
readLayout(reader, name);
}
@ -2113,6 +2122,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
writeSnapChatConfig(writer);
writeComponentReuseNotificationInfo(writer);
writeDesignerLoginAttr(writer);
writeFvsDesignerConfig(writer);
writer.end();
}
@ -2419,6 +2429,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.designerLoginConfigManager.writeXML(writer);
}
private void readFvsDesignerConfig(XMLableReader reader) {
reader.readXMLObject(fvsDesignerConfig);
}
private void writeFvsDesignerConfig(XMLPrintWriter writer) {
this.fvsDesignerConfig.writeXML(writer);
}
enum XmlHandler {
Self;

83
designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java

@ -0,0 +1,83 @@
package com.fr.design.mainframe.simple;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
import java.util.HashMap;
import java.util.Map;
/**
* @author Wei
* 一个简单属性字符串存储类用于自定义简单属性的存储
* getInstance("FVSDesignerConfig")可在FineReportEnv.xml中定义一个<FVSDesignerConfig></>存储FVS相关配置
*/
public class SimpleDesignerConfig implements XMLable {
private static final Map<String, SimpleDesignerConfig> configs = new HashMap<>();
private SimpleDesignerConfig(String name) {
this.name = name;
}
public static SimpleDesignerConfig getInstance(String name) {
SimpleDesignerConfig config = configs.get(name);
if (config == null) {
config = new SimpleDesignerConfig(name);
configs.put(name, config);
}
return config;
}
private String name = "";
private JSONObject content = new JSONObject();
public void addAttr(String key, String value) {
content.put(key, value);
}
public JSONObject getContent() {
return content;
}
public void setContent(JSONObject content) {
this.content = content;
}
@Override
public void readXML(XMLableReader reader) {
if (reader.isAttr()) {
String rawContent = reader.getAttrAsString("content", null);
if (StringUtils.isNotBlank(rawContent)) {
this.content = new JSONObject(rawContent);
}
}
}
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG(name);
if (this.content != null) {
writer.attr("content", this.content.toString());
}
writer.end();
}
@Override
public Object clone() throws CloneNotSupportedException {
SimpleDesignerConfig cloned = (SimpleDesignerConfig) super.clone();
if (this.content != null) {
cloned.content = new JSONObject(this.content.toString());
}
cloned.name = this.name;
return cloned;
}
public String getName() {
return name;
}
}

2
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -168,7 +168,9 @@ public class HeaderAreaPane extends JPanel {
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
cellSelectionManager.build(cellElement, columnRow);
if(showHeaderArea){
columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow);
}
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
setSortColumnRowPaneShow(showHeaderArea);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);

Loading…
Cancel
Save