Browse Source

REPORT-875 修改显示对话框的方式,去掉拷贝过来的重复代码

master
plough 8 years ago
parent
commit
72337a2dbe
  1. 50
      designer_base/src/com/fr/design/actions/file/PreferencePane.java

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

@ -627,46 +627,11 @@ public class PreferencePane extends BasicPane {
return l; return l;
} }
/**
* 显示窗口
*
* @param window 窗口
* @param l 对话框监听器
* @return 对话框
*/
@Override @Override
public BasicDialog showWindow(Window window, DialogActionListener l) { public BasicDialog showWindow(Window window) {
BasicDialog dg; return showWindow(window, new DialogActionAdapter() {
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 @Override
public void doOK() { public void doOk() {
super.doOK();
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) { if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) {
int rv = JOptionPane.showOptionDialog( int rv = JOptionPane.showOptionDialog(
null, null,
@ -683,13 +648,6 @@ public class PreferencePane extends BasicPane {
} }
} }
} }
});
/**
* Check valid.
*/
public void checkValid() throws Exception {
PreferencePane.this.checkValid();
}
} }
} }
Loading…
Cancel
Save