From 72337a2dbe322ee988223b32e5cd527ee6776b70 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 29 Nov 2016 11:52:28 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-875=20=E4=BF=AE=E6=94=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AF=B9=E8=AF=9D=E6=A1=86=E7=9A=84=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E6=8B=B7=E8=B4=9D=E8=BF=87=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 80 +++++-------------- 1 file changed, 19 insertions(+), 61 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index 0557eb587..4aadbf4d2 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -627,69 +627,27 @@ 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); - } - return showWindow(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(); + public BasicDialog showWindow(Window window) { + return showWindow(window, new DialogActionAdapter() { + @Override + public void 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(); - } - + }); } } \ No newline at end of file