|
|
@ -13,6 +13,7 @@ import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.LocalDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.LocalDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
|
|
|
|
import com.fr.design.style.color.ColorSelectConfigManager; |
|
|
|
import com.fr.file.FILEFactory; |
|
|
|
import com.fr.file.FILEFactory; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.FRLogFormatter; |
|
|
|
import com.fr.general.FRLogFormatter; |
|
|
@ -51,6 +52,7 @@ import java.io.StringReader; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.GregorianCalendar; |
|
|
|
import java.util.GregorianCalendar; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
@ -66,6 +68,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
private static final int MAX_SHOW_NUM = 10; |
|
|
|
private static final int MAX_SHOW_NUM = 10; |
|
|
|
private static final String VERSION_80 = "80"; |
|
|
|
private static final String VERSION_80 = "80"; |
|
|
|
private static final int CACHINGTEMPLATE_LIMIT = 5; |
|
|
|
private static final int CACHINGTEMPLATE_LIMIT = 5; |
|
|
|
|
|
|
|
private static final String WEB_NAME = "webapps"; |
|
|
|
|
|
|
|
|
|
|
|
private static DesignerEnvManager designerEnvManager; // gui.
|
|
|
|
private static DesignerEnvManager designerEnvManager; // gui.
|
|
|
|
private String activationKey = null; |
|
|
|
private String activationKey = null; |
|
|
@ -73,7 +76,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
private Rectangle windowBounds = null; // window bounds.
|
|
|
|
private Rectangle windowBounds = null; // window bounds.
|
|
|
|
private String DialogCurrentDirectory = null; |
|
|
|
private String DialogCurrentDirectory = null; |
|
|
|
private String CurrentDirectoryPrefix = null; |
|
|
|
private String CurrentDirectoryPrefix = null; |
|
|
|
private List<String> recentOpenedFilePathList = new ArrayList<String>(); |
|
|
|
private Map<String, List<String>> recentOpenedFileListMap = new HashMap<>(); |
|
|
|
|
|
|
|
private List<String> tempRecentOpenedFilePathList = new ArrayList<String>(); |
|
|
|
private boolean showPaintToolBar = true; |
|
|
|
private boolean showPaintToolBar = true; |
|
|
|
private int maxNumberOrPreviewRow = 200; |
|
|
|
private int maxNumberOrPreviewRow = 200; |
|
|
|
// name和Env的键值对
|
|
|
|
// name和Env的键值对
|
|
|
@ -129,7 +133,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
//记录当前激活码的在线激活状态.
|
|
|
|
//记录当前激活码的在线激活状态.
|
|
|
|
private int activeKeyStatus = -1; |
|
|
|
private int activeKeyStatus = -1; |
|
|
|
private boolean joinProductImprove = true; |
|
|
|
private boolean joinProductImprove = true; |
|
|
|
|
|
|
|
//最近使用的颜色
|
|
|
|
|
|
|
|
private ColorSelectConfigManager configManager = new ColorSelectConfigManager(); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* alphafine |
|
|
|
* alphafine |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -190,6 +195,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
return designerEnvManager; |
|
|
|
return designerEnvManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ColorSelectConfigManager getColorConfigManager() { |
|
|
|
|
|
|
|
return this.configManager; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void checkNameEnvMap() { |
|
|
|
public static void checkNameEnvMap() { |
|
|
|
if (designerEnvManager == null || designerEnvManager.nameEnvMap.size() > 0) { |
|
|
|
if (designerEnvManager == null || designerEnvManager.nameEnvMap.size() > 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -197,7 +206,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
if (installHome != null && !".".equals(installHome)) { |
|
|
|
if (installHome != null && !".".equals(installHome)) { |
|
|
|
String name = Inter.getLocText("FR-Engine_DEFAULT"); |
|
|
|
String name = Inter.getLocText("FR-Engine_DEFAULT"); |
|
|
|
String envPath = StableUtils.pathJoin(installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); |
|
|
|
String envPath = designerEnvManager.getDefaultenvPath(installHome); |
|
|
|
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); |
|
|
|
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); |
|
|
|
designerEnvManager.setCurEnvName(name); |
|
|
|
designerEnvManager.setCurEnvName(name); |
|
|
|
} |
|
|
|
} |
|
|
@ -332,7 +341,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
// 清空前一个版本中的工作目录和最近打开
|
|
|
|
// 清空前一个版本中的工作目录和最近打开
|
|
|
|
nameEnvMap = new ListMap<String, DesignerWorkspaceInfo>(); |
|
|
|
nameEnvMap = new ListMap<String, DesignerWorkspaceInfo>(); |
|
|
|
recentOpenedFilePathList = new ArrayList<String>(); |
|
|
|
|
|
|
|
curEnvName = null; |
|
|
|
curEnvName = null; |
|
|
|
designerEnvManager.saveXMLFile(); |
|
|
|
designerEnvManager.saveXMLFile(); |
|
|
|
} |
|
|
|
} |
|
|
@ -480,8 +488,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
public boolean isCurrentEnvDefault() { |
|
|
|
public boolean isCurrentEnvDefault() { |
|
|
|
|
|
|
|
|
|
|
|
DesignerWorkspaceInfo current = this.getWorkspaceInfo(curEnvName); |
|
|
|
DesignerWorkspaceInfo current = this.getWorkspaceInfo(curEnvName); |
|
|
|
String defaultEnvPath = StableUtils.pathJoin(new String[]{StableUtils.getInstallHome(), ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME}); |
|
|
|
String defaultEnvPath = getDefaultenvPath(StableUtils.getInstallHome()); |
|
|
|
return ComparatorUtils.equals(new File(defaultEnvPath).getPath(), current.getPath()); |
|
|
|
return ComparatorUtils.equals(defaultEnvPath, current.getPath()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -489,7 +497,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public DesignerWorkspaceInfo getDefaultConfig() { |
|
|
|
public DesignerWorkspaceInfo getDefaultConfig() { |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String defaultenvPath = StableUtils.pathJoin(installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); |
|
|
|
String defaultenvPath = getDefaultenvPath(installHome); |
|
|
|
defaultenvPath = new File(defaultenvPath).getPath(); |
|
|
|
defaultenvPath = new File(defaultenvPath).getPath(); |
|
|
|
Iterator<Entry<String, DesignerWorkspaceInfo>> entryIt = nameEnvMap.entrySet().iterator(); |
|
|
|
Iterator<Entry<String, DesignerWorkspaceInfo>> entryIt = nameEnvMap.entrySet().iterator(); |
|
|
|
while (entryIt.hasNext()) { |
|
|
|
while (entryIt.hasNext()) { |
|
|
@ -510,7 +518,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String getDefaultEnvName() { |
|
|
|
public String getDefaultEnvName() { |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String defaultenvPath = StableUtils.pathJoin(new String[]{installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME}); |
|
|
|
String defaultenvPath = getDefaultenvPath(installHome); |
|
|
|
defaultenvPath = new File(defaultenvPath).getPath(); |
|
|
|
defaultenvPath = new File(defaultenvPath).getPath(); |
|
|
|
if (nameEnvMap.size() >= 0) { |
|
|
|
if (nameEnvMap.size() >= 0) { |
|
|
|
Iterator<Entry<String, DesignerWorkspaceInfo>> entryIt = nameEnvMap.entrySet().iterator(); |
|
|
|
Iterator<Entry<String, DesignerWorkspaceInfo>> entryIt = nameEnvMap.entrySet().iterator(); |
|
|
@ -525,6 +533,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
return Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}); |
|
|
|
return Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getDefaultenvPath(String installHome) { |
|
|
|
|
|
|
|
//这里需要转成反斜杠和生成默认路径一致
|
|
|
|
|
|
|
|
return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置当前环境为默认 |
|
|
|
* 设置当前环境为默认 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -813,7 +827,17 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
* 返回最近打开的文件路径列表 |
|
|
|
* 返回最近打开的文件路径列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<String> getRecentOpenedFilePathList() { |
|
|
|
public List<String> getRecentOpenedFilePathList() { |
|
|
|
return this.recentOpenedFilePathList; |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(getCurEnvName())) { |
|
|
|
|
|
|
|
return tempRecentOpenedFilePathList; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (!recentOpenedFileListMap.containsKey(getCurEnvName())) { |
|
|
|
|
|
|
|
recentOpenedFileListMap.put(getCurEnvName(), tempRecentOpenedFilePathList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return recentOpenedFileListMap.get(getCurEnvName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -823,11 +847,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addRecentOpenedFilePath(String filePath) { |
|
|
|
public void addRecentOpenedFilePath(String filePath) { |
|
|
|
// 先删除.
|
|
|
|
// 先删除.
|
|
|
|
if (this.recentOpenedFilePathList.contains(filePath)) { |
|
|
|
if (getRecentOpenedFilePathList().contains(filePath)) { |
|
|
|
this.recentOpenedFilePathList.remove(filePath); |
|
|
|
getRecentOpenedFilePathList().remove(filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.recentOpenedFilePathList.add(0, filePath); |
|
|
|
getRecentOpenedFilePathList().add(0, filePath); |
|
|
|
checkRecentOpenedFileNum(); |
|
|
|
checkRecentOpenedFileNum(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -838,19 +862,21 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
* @param newPath 新的路径 |
|
|
|
* @param newPath 新的路径 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void replaceRecentOpenedFilePath(String oldPath, String newPath) { |
|
|
|
public void replaceRecentOpenedFilePath(String oldPath, String newPath) { |
|
|
|
if (this.recentOpenedFilePathList.contains(oldPath)) { |
|
|
|
List<String> list = getRecentOpenedFilePathList(); |
|
|
|
int index = recentOpenedFilePathList.indexOf(oldPath); |
|
|
|
if (list.contains(oldPath)) { |
|
|
|
this.recentOpenedFilePathList.remove(oldPath); |
|
|
|
int index = getRecentOpenedFilePathList().indexOf(oldPath); |
|
|
|
this.recentOpenedFilePathList.add(index, newPath); |
|
|
|
list.remove(oldPath); |
|
|
|
|
|
|
|
list.add(index, newPath); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkRecentOpenedFileNum() { |
|
|
|
private void checkRecentOpenedFileNum() { |
|
|
|
if (this.recentOpenedFilePathList == null) { |
|
|
|
List<String> list = getRecentOpenedFilePathList(); |
|
|
|
|
|
|
|
if (list == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
while (this.recentOpenedFilePathList.size() > MAX_SHOW_NUM) { |
|
|
|
while (list.size() > MAX_SHOW_NUM) { |
|
|
|
this.recentOpenedFilePathList.remove(this.recentOpenedFilePathList.size() - 1); |
|
|
|
list.remove(list.size() - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -860,8 +886,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
* @param filePath 文件路径 |
|
|
|
* @param filePath 文件路径 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeRecentOpenedFilePath(String filePath) { |
|
|
|
public void removeRecentOpenedFilePath(String filePath) { |
|
|
|
if (this.recentOpenedFilePathList.contains(filePath)) { |
|
|
|
if (getRecentOpenedFilePathList().contains(filePath)) { |
|
|
|
this.recentOpenedFilePathList.remove(filePath); |
|
|
|
getRecentOpenedFilePathList().remove(filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1299,6 +1325,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void readRecentColor(XMLableReader reader) { |
|
|
|
|
|
|
|
reader.readXMLObject(this.configManager); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Read XML.<br> |
|
|
|
* Read XML.<br> |
|
|
|
* The method will be invoked when read data from XML file.<br> |
|
|
|
* The method will be invoked when read data from XML file.<br> |
|
|
@ -1316,7 +1346,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
this.readAttributes(reader); |
|
|
|
this.readAttributes(reader); |
|
|
|
} else if (name.equals("ReportPaneAttributions")) { |
|
|
|
} else if (name.equals("ReportPaneAttributions")) { |
|
|
|
this.readReportPaneAttributions(reader); |
|
|
|
this.readReportPaneAttributions(reader); |
|
|
|
} else if ("RecentOpenedFilePathList".equals(name) || "ResentOpenedFilePathList".equals(name)) { |
|
|
|
} else if ("RecentOpenedFilePath".equals(name)) { |
|
|
|
this.readRecentOpenFileList(reader); |
|
|
|
this.readRecentOpenFileList(reader); |
|
|
|
} else if ("EnvConfigMap".equals(name)) { |
|
|
|
} else if ("EnvConfigMap".equals(name)) { |
|
|
|
this.readEnvConfigMap(reader); |
|
|
|
this.readEnvConfigMap(reader); |
|
|
@ -1350,6 +1380,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
readHttpsParas(reader); |
|
|
|
readHttpsParas(reader); |
|
|
|
} else if (name.equals("AlphaFineConfigManager")) { |
|
|
|
} else if (name.equals("AlphaFineConfigManager")) { |
|
|
|
readAlphaFineAttr(reader); |
|
|
|
readAlphaFineAttr(reader); |
|
|
|
|
|
|
|
} else if (name.equals("RecentColors")) { |
|
|
|
|
|
|
|
readRecentColor(reader); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
readLayout(reader, name); |
|
|
|
readLayout(reader, name); |
|
|
|
} |
|
|
|
} |
|
|
@ -1499,21 +1531,32 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
|
|
|
|
|
|
|
|
private void readRecentOpenFileList(XMLableReader reader) { |
|
|
|
private void readRecentOpenFileList(XMLableReader reader) { |
|
|
|
reader.readXMLObject(new XMLReadable() { |
|
|
|
reader.readXMLObject(new XMLReadable() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
if (reader.isAttr()) { |
|
|
|
if (reader.isAttr()) { |
|
|
|
DesignerEnvManager.this.recentOpenedFilePathList.clear(); |
|
|
|
DesignerEnvManager.this.recentOpenedFileListMap.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (reader.isChildNode()) { |
|
|
|
if (reader.isChildNode()) { |
|
|
|
String tmpVal; |
|
|
|
|
|
|
|
String name = reader.getTagName(); |
|
|
|
String name = reader.getTagName(); |
|
|
|
// alex:以前一直是写ResentOpenedFilePath
|
|
|
|
if ("Env".equals(name)) { |
|
|
|
if ("ResentOpenedFilePath".equals(name) || "Path".equals(name)) { // description.
|
|
|
|
final String envName = reader.getAttrAsString("name", StringUtils.EMPTY); |
|
|
|
if ((tmpVal = reader.getElementValue()) != null) { |
|
|
|
final List<String> recentOpenedFileList = new ArrayList<>(); |
|
|
|
DesignerEnvManager.this.recentOpenedFilePathList.add(tmpVal); |
|
|
|
reader.readXMLObject(new XMLReadable() { |
|
|
|
} |
|
|
|
@Override |
|
|
|
|
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
|
|
|
|
if (reader.isChildNode()) { |
|
|
|
|
|
|
|
String n = reader.getTagName(); |
|
|
|
|
|
|
|
if ("Path".equals(n)) { |
|
|
|
|
|
|
|
String path = reader.getElementValue(); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(path)) { |
|
|
|
|
|
|
|
recentOpenedFileList.add(path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
DesignerEnvManager.this.recentOpenedFileListMap.put(envName, recentOpenedFileList); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1542,6 +1585,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
writeActiveStatus(writer); |
|
|
|
writeActiveStatus(writer); |
|
|
|
writeHttpsParas(writer); |
|
|
|
writeHttpsParas(writer); |
|
|
|
writeAlphaFineAttr(writer); |
|
|
|
writeAlphaFineAttr(writer); |
|
|
|
|
|
|
|
writeRecentColor(writer); |
|
|
|
writer.end(); |
|
|
|
writer.end(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1551,6 +1595,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void writeRecentColor(XMLPrintWriter writer) { |
|
|
|
|
|
|
|
if (this.configManager != null) { |
|
|
|
|
|
|
|
this.configManager.writeXML(writer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getUUID() { |
|
|
|
public String getUUID() { |
|
|
|
return StringUtils.isEmpty(uuid) ? UUID.randomUUID().toString() : uuid; |
|
|
|
return StringUtils.isEmpty(uuid) ? UUID.randomUUID().toString() : uuid; |
|
|
|
} |
|
|
|
} |
|
|
@ -1597,10 +1647,15 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
|
|
|
|
|
|
|
|
private void writeRecentOpenFileAndEnvList(XMLPrintWriter writer) { |
|
|
|
private void writeRecentOpenFileAndEnvList(XMLPrintWriter writer) { |
|
|
|
checkRecentOpenedFileNum(); |
|
|
|
checkRecentOpenedFileNum(); |
|
|
|
writer.startTAG("RecentOpenedFilePathList"); |
|
|
|
writer.startTAG("RecentOpenedFilePath"); |
|
|
|
int resentOpenedFilePathCount = Math.min(12, this.recentOpenedFilePathList.size()); |
|
|
|
for (Entry<String, List<String>> entry : recentOpenedFileListMap.entrySet()) { |
|
|
|
for (int i = 0; i < resentOpenedFilePathCount; i++) { |
|
|
|
writer.startTAG("Env").attr("name", entry.getKey()); |
|
|
|
writer.startTAG("Path").textNode(recentOpenedFilePathList.get(i)).end(); |
|
|
|
List<String> paths = entry.getValue(); |
|
|
|
|
|
|
|
int count = Math.min(12, paths.size()); |
|
|
|
|
|
|
|
for (int i = 0; i < count; i++) { |
|
|
|
|
|
|
|
writer.startTAG("Path").textNode(paths.get(i)).end(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
writer.end(); |
|
|
|
} |
|
|
|
} |
|
|
|
writer.end(); |
|
|
|
writer.end(); |
|
|
|
|
|
|
|
|
|
|
|