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;
}
/**
* 显示窗口
*
* @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());
}
/**
* 确定操作
*
*/
public BasicDialog showWindow(Window window) {
return showWindow(window, new DialogActionAdapter() {
@Override
public void doOK() {
super.doOK();
public void doOk() {
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) {
int rv = JOptionPane.showOptionDialog(
null,
@ -683,13 +648,6 @@ public class PreferencePane extends BasicPane {
}
}
}
/**
* Check valid.
*/
public void checkValid() throws Exception {
PreferencePane.this.checkValid();
}
});
}
}
Loading…
Cancel
Save