|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
package com.fr.design.actions.file; |
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.RestartHelper; |
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
|
import com.fr.design.dialog.DialogActionListener; |
|
|
|
|
import com.fr.design.editor.editor.IntegerEditor; |
|
|
|
|
import com.fr.design.gui.frpane.UITabbedPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
@ -78,6 +81,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE), |
|
|
|
|
getLocaledLanguage("Korea_Language",Locale.KOREA), |
|
|
|
|
}; |
|
|
|
|
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
|
|
|
|
|
|
|
|
|
|
//设置是否支持undo
|
|
|
|
|
private UICheckBox supportUndoCheckBox; |
|
|
|
@ -527,6 +531,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); |
|
|
|
|
|
|
|
|
|
this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]); |
|
|
|
|
designerEnvLanguageIndex = designerEnvManager.getLanguage(); |
|
|
|
|
|
|
|
|
|
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); |
|
|
|
|
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); |
|
|
|
@ -621,4 +626,74 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
return l; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 显示窗口 |
|
|
|
|
* |
|
|
|
|
* @param window 窗口 |
|
|
|
|
* @param l 对话框监听器 |
|
|
|
|
* @return 对话框 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public BasicDialog showWindow(Window window, DialogActionListener l) { |
|
|
|
|
BasicDialog dg; |
|
|
|
|
if (window instanceof Frame) { |
|
|
|
|
dg = new DIALOG((Frame) window); |
|
|
|
|
} else { |
|
|
|
|
dg = new DIALOG((Dialog) window); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (l != null) { |
|
|
|
|
dg.addDialogActionListener(l); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dg.setBasicDialogSize(BasicDialog.DEFAULT); |
|
|
|
|
GUICoreUtils.centerWindow(dg); |
|
|
|
|
dg.setResizable(false); |
|
|
|
|
return dg; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class DIALOG extends BasicDialog { |
|
|
|
|
public DIALOG(Frame parent) { |
|
|
|
|
super(parent, PreferencePane.this); |
|
|
|
|
this.setTitle(PreferencePane.this.title4PopupWindow()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public DIALOG(Dialog parent) { |
|
|
|
|
super(parent, PreferencePane.this); |
|
|
|
|
this.setTitle(PreferencePane.this.title4PopupWindow()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 确定操作 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void doOK() { |
|
|
|
|
super.doOK(); |
|
|
|
|
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) { |
|
|
|
|
int rv = JOptionPane.showOptionDialog( |
|
|
|
|
null, |
|
|
|
|
Inter.getLocText("FR-Designer-Language_Change_Successful"), |
|
|
|
|
Inter.getLocText("FR-Designer-Plugin_Warning"), |
|
|
|
|
JOptionPane.YES_NO_OPTION, |
|
|
|
|
JOptionPane.INFORMATION_MESSAGE, |
|
|
|
|
null, |
|
|
|
|
new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, |
|
|
|
|
null |
|
|
|
|
); |
|
|
|
|
if (rv == JOptionPane.OK_OPTION) { |
|
|
|
|
RestartHelper.restart(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Check valid. |
|
|
|
|
*/ |
|
|
|
|
public void checkValid() throws Exception { |
|
|
|
|
PreferencePane.this.checkValid(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |