Browse Source

Merge pull request #589 in BA/design from ~NEIL/design:master to master

* commit '805fe40f14451f4d5d1b6ed7943cc55ce61bd098':
  无JIRA任务, 修复合并冲突
master
superman 8 years ago
parent
commit
99e0497e43
  1. 28
      designer_base/src/com/fr/design/actions/file/PreferencePane.java

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

@ -29,7 +29,9 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
/** /**
* 选项对话框 * 选项对话框
@ -72,17 +74,17 @@ public class PreferencePane extends BasicPane {
private static final String DISPLAY_MINUS = "-"; private static final String DISPLAY_MINUS = "-";
private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG};
private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"), private static java.util.List<String> LANGUAGE = new ArrayList<>();
getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE), static {
getLocaledLanguage("English_Language", Locale.ENGLISH), Map<Locale, String> map = Inter.getSupportLocaleMap();
getLocaledLanguage("Japanese_Language", Locale.JAPAN), LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default"));
getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE), for(Locale locale : map.keySet()){
getLocaledLanguage("Korea_Language",Locale.KOREA), LANGUAGE.add(getLocaledLanguage(map.get(locale), locale));
}
}; };
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private boolean languageChanged; // 是否修改了设计器语言设置 private boolean languageChanged; // 是否修改了设计器语言设置
//设置是否支持undo //设置是否支持undo
private UICheckBox supportUndoCheckBox; private UICheckBox supportUndoCheckBox;
//设置最大撤销次数 //设置最大撤销次数
@ -359,7 +361,7 @@ public class PreferencePane extends BasicPane {
JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language")); JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language"));
generalPane.add(languageAndDashBoard_pane); generalPane.add(languageAndDashBoard_pane);
languageAndDashBoard_pane.add(LanguagePane); languageAndDashBoard_pane.add(LanguagePane);
languageComboBox = new UIComboBox(LANGUAGE); languageComboBox = new UIComboBox(LANGUAGE.toArray());
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文 languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文
ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language")); ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language"));
languageLabel.addActionListener(new ActionListener() { languageLabel.addActionListener(new ActionListener() {
@ -530,9 +532,8 @@ public class PreferencePane extends BasicPane {
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]); this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
designerEnvLanguageIndex = designerEnvManager.getLanguage(); designerEnvLanguageIndex = designerEnvManager.getLanguage();
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
@ -618,8 +619,8 @@ public class PreferencePane extends BasicPane {
private int getLanguageInt() { private int getLanguageInt() {
int l = 0; int l = 0;
String lang = (String) this.languageComboBox.getSelectedItem(); String lang = (String) this.languageComboBox.getSelectedItem();
for (int i = 0; i < LANGUAGE.length; i++) { for (int i = 0; i < LANGUAGE.size(); i++) {
if (ComparatorUtils.equals(lang, LANGUAGE[i])) { if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) {
l = i; l = i;
break; break;
} }
@ -627,6 +628,7 @@ public class PreferencePane extends BasicPane {
return l; return l;
} }
// 如果语言设置改变了,则显示重启对话框 // 如果语言设置改变了,则显示重启对话框
public void showRestartDialog() { public void showRestartDialog() {
if (!languageChanged) { if (!languageChanged) {

Loading…
Cancel
Save