Browse Source

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

master
zheng 7 years ago
parent
commit
439d9cd50d
  1. 49
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 43
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  3. 24
      designer-base/src/main/java/com/fr/file/FileFILE.java
  4. 2
      designer-form/src/main/java/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java
  5. 2
      designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
  6. 12
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  7. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  8. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java
  9. 2
      designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java
  10. 2
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

49
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;
@ -122,42 +121,25 @@ 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);
@ -168,19 +150,6 @@ public class LocalePane extends BasicPane {
} }
} }
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);

43
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -33,7 +33,8 @@ public class AboutPane extends JPanel {
private static final int DEFAULT_GAP = 12; private static final int DEFAULT_GAP = 12;
private static final String COPYRIGHT_LABEL = "\u00A9 "; private static final String COPYRIGHT_LABEL = "\u00A9 ";
private static final String BUILD_PREFIX = " "; private static final String BUILD_PREFIX = " ";
private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("company_telephone"); private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("help.compNo");
private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("help.PNo");
public AboutPane() { public AboutPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -79,6 +80,9 @@ public class AboutPane extends JPanel {
contentPane.add(urlActionPane); contentPane.add(urlActionPane);
contentPane.add(emailPane); contentPane.add(emailPane);
contentPane.add(getRemarkPane());
if (shouldShowThanks()) { if (shouldShowThanks()) {
addThankPane(contentPane); addThankPane(contentPane);
} }
@ -111,6 +115,43 @@ public class AboutPane extends JPanel {
return true; return true;
} }
private JPanel getRemarkPane(){
String remark = Inter.getLocText("Fine-Designer_About_Remark_Info",PRESIDENT_PHONE);
UILabel label = new UILabel();
label.setSize(new Dimension(580,30));
//用THML标签进行拼接,以实现自动换行
StringBuilder builder = new StringBuilder("<html>");
char[] chars = remark.toCharArray();
//获取字体计算大小
FontMetrics fontMetrics = label.getFontMetrics(label.getFont());
int start = 0;
int len = 0;
while (start + len < remark.length()) {
while (true) {
len++;
if (start + len > remark.length())
break;
if (fontMetrics.charsWidth(chars, start, len)
> label.getWidth()) {
break;
}
}
builder.append(chars, start, len-1).append("<br/>");
start = start + len - 1;
len = 0;
}
//拼接剩余部分
builder.append(chars, start, remark.length()-start);
builder.append("</html>");
JPanel jPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
label.setText(builder.toString());
jPanel.add(label);
return jPanel;
}
//添加鸣谢面板 //添加鸣谢面板
private void addThankPane(JPanel contentPane) { private void addThankPane(JPanel contentPane) {
BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class); BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class);

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;
} }

2
designer-form/src/main/java/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java

@ -137,7 +137,7 @@ public class EmbeddedFormExportExportAction extends JTemplateAction<JForm>{
FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("FR-Designer_Finish_Export") + "!"); FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("FR-Designer_Finish_Export") + "!");
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + filePath); Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + fileGetName);
} catch (Exception exp) { } catch (Exception exp) {
this.setProgress(100); this.setProgress(100);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); FineLoggerFactory.getLogger().error(exp.getMessage(), exp);

2
designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java

@ -130,7 +130,7 @@ public abstract class AbstractExportAction extends JWorkBookAction {
FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("FR-Designer_Finish_Export") + "!"); FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("FR-Designer_Finish_Export") + "!");
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + filePath); Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + fileGetName);
} catch (Exception exp) { } catch (Exception exp) {
this.setProgress(100); this.setProgress(100);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); FineLoggerFactory.getLogger().error(exp.getMessage(), exp);

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);
} }

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

@ -41,7 +41,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private DragToolBarPane dragToolbarPane; private DragToolBarPane dragToolbarPane;
private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":"); private UILabel sheetShowLocationLabel = new UILabel(Inter.getLocText("Fine-Designer_Sheet_Label_Page_Display_Position"));
private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT);

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

@ -56,7 +56,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//sheet标签页显示位置 //sheet标签页显示位置
topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":", UILabel.LEFT); sheetShowLocationLabel = new UILabel(Inter.getLocText("Fine-Designer_Sheet_Label_Page_Display_Position"), UILabel.LEFT);
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true); bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton); buttonGroup.add(topRadioButton);

Loading…
Cancel
Save