Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~kerry/design_10.0 into release/10.0

master
kerry 6 years ago
parent
commit
0e6f19007f
  1. 61
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 24
      designer-base/src/main/java/com/fr/file/FileFILE.java
  3. 3
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  4. 12
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  5. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  6. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

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

@ -12,10 +12,10 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResourceOutputStream; import com.fr.workspace.resource.WorkResourceOutputStream;
@ -37,7 +37,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
@ -121,43 +120,26 @@ public class LocalePane extends BasicPane {
} }
private void initPredefinedProperties() { private void initPredefinedProperties() {
Map<Locale, String> supportLocaleMap = Inter.getSupportLocaleMap(); Map<Locale, String> supportLocaleMap = InterProviderFactory.getProvider().getSupportLocaleMap();
String[] localeFiles = StableFactory.getLocaleFiles(); Map<String, String> map;
List<String> sortKeys = new ArrayList<String>(); List<String> sortKeys = new ArrayList<String>();
for (String path : localeFiles) { map = InterProviderFactory.getProvider().getLocalBundle(Locale.SIMPLIFIED_CHINESE).getMap();
ResourceBundle chineseBundle = loadResourceBundle(path, Locale.SIMPLIFIED_CHINESE); sortKeys.addAll(map.keySet());
sortKeys.addAll(chineseBundle.keySet());
}
Collections.sort(sortKeys); Collections.sort(sortKeys);
Map<Locale, List<ResourceBundle>> localeResourceBundleMap = new HashMap<Locale, List<ResourceBundle>>();
for (Map.Entry<Locale, String> entry : supportLocaleMap.entrySet()) {
Locale locale = entry.getKey();
List<ResourceBundle> list = new ArrayList<>();
for (String path : localeFiles) {
ResourceBundle chineseBundle = loadResourceBundle(path, locale);
list.add(chineseBundle);
}
localeResourceBundleMap.put(locale, list);
}
Map<Locale, Vector<String>> data = new HashMap<Locale, Vector<String>>(); Map<Locale, Vector<String>> data = new HashMap<Locale, Vector<String>>();
for (Map.Entry<Locale, List<ResourceBundle>> entry : localeResourceBundleMap.entrySet()) { for (Locale locale : supportLocaleMap.keySet()) {
Vector<String> column = new Vector<String>(); Vector<String> column = new Vector<String>();
List<ResourceBundle> rbs = entry.getValue();
for (String key : sortKeys) { for (String key : sortKeys) {
column.add(readText(rbs, key)); column.add(InterProviderFactory.getProvider().getLocText(key));
} }
data.put(entry.getKey(), column); data.put(locale, column);
} }
Vector<String> keyVector = new Vector<String>(); Vector<String> keyVector = new Vector<String>();
keyVector.addAll(sortKeys); keyVector.addAll(sortKeys);
@ -167,20 +149,7 @@ public class LocalePane extends BasicPane {
predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue()); predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue());
} }
} }
private String readText(List<ResourceBundle> rbs, String key) {
for (ResourceBundle rb : rbs) {
if (rb.containsKey(key)) {
return rb.getString(key);
}
}
return null;
}
private ResourceBundle loadResourceBundle(String dir, Locale locale) {
return ResourceBundle.getBundle(dir, locale, Inter.class.getClassLoader());
}
private void initCustomProperties() throws Exception { private void initCustomProperties() throws Exception {
FileNode[] fileNodes = FRContext.getFileNodes().list(ProjectConstants.LOCALE_NAME); FileNode[] fileNodes = FRContext.getFileNodes().list(ProjectConstants.LOCALE_NAME);

24
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -1,23 +1,22 @@
package com.fr.file; package com.fr.file;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import javax.swing.Icon;
import javax.swing.filechooser.FileSystemView;
import com.fr.base.io.XMLEncryptUtils; import com.fr.base.io.XMLEncryptUtils;
import com.fr.design.gui.itree.filetree.FileComparator; import com.fr.design.gui.itree.filetree.FileComparator;
import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogManager; import com.fr.general.SessionLocalManager;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
public class FileFILE implements FILE { public class FileFILE implements FILE {
private File file; private File file;
@ -199,12 +198,11 @@ public class FileFILE implements FILE {
if (file == null || !file.exists()) { if (file == null || !file.exists()) {
return null; return null;
} }
FRLogManager.declareResourceWriteStart(file.getAbsolutePath());
java.io.OutputStream out = null; java.io.OutputStream out = null;
try { try {
out = new FileOutputStream(file); out = new FileOutputStream(file);
} catch (Exception e) { } catch (Exception e) {
throw FRLogManager.createLogPackedException(e); throw SessionLocalManager.createLogPackedException(e);
} }
return out; return out;
} }

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

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

@ -4,19 +4,19 @@ import com.fr.base.io.IOFile;
import com.fr.base.io.XMLReadHelper; import com.fr.base.io.XMLReadHelper;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.general.FRLogManager; import com.fr.general.SessionLocalManager;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.LogDuration;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.third.apache.log4j.AppenderSkeleton; import com.fr.third.apache.log4j.AppenderSkeleton;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.web.core.SessionDealWith; import com.fr.web.core.SessionPoolManager;
import com.fr.web.core.SessionIDInfor; import com.fr.web.core.TemplateSessionIDInfo;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -96,13 +96,13 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
} }
private String readTemplateID() { private String readTemplateID() {
LogDuration logDuration = FRLogManager.getSession(); SessionProvider logDuration = SessionLocalManager.getSession();
if (logDuration == null) { if (logDuration == null) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
String sessionID = logDuration.getSessionID(); String sessionID = logDuration.getSessionID();
SessionIDInfor infor = SessionDealWith.getSessionIDInfor(sessionID); TemplateSessionIDInfo infor = SessionPoolManager.getSessionIDInfor(sessionID, TemplateSessionIDInfo.class);
if (infor == null) { if (infor == null) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }

2
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -85,7 +85,7 @@ public class WebCssPane extends BasicPane {
if (!"css".equalsIgnoreCase(fileType)) { if (!"css".equalsIgnoreCase(fileType)) {
return; return;
} }
localText.setText(file.getPath().substring(1)); localText.setText(file.getPath());
centerPane.setAddEnabled(true); centerPane.setAddEnabled(true);
} }

2
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -173,7 +173,7 @@ public class WebJsPane extends BasicPane {
if (!"js".equalsIgnoreCase(fileType)) { if (!"js".equalsIgnoreCase(fileType)) {
return; return;
} }
localText.setText(file.getPath().substring(1)); localText.setText(file.getPath());
editingPane.setAddEnabled(true); editingPane.setAddEnabled(true);
} }

Loading…
Cancel
Save