hades
3 years ago
6 changed files with 136 additions and 148 deletions
@ -0,0 +1,48 @@ |
|||||||
|
package com.fr.design.data.datapane.connect; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicDialog; |
||||||
|
import com.fr.design.dialog.DialogActionAdapter; |
||||||
|
import com.fr.design.editlock.EditLockUtils; |
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.file.ConnectionConfig; |
||||||
|
import com.fr.report.LockItem; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hades |
||||||
|
* @version 11.0 |
||||||
|
* Created by hades on 2021/9/8 |
||||||
|
*/ |
||||||
|
public class ConnectionListDialogActionAdapter extends DialogActionAdapter { |
||||||
|
|
||||||
|
private final ConnectionManagerPane connectionManagerPane; |
||||||
|
private final BasicDialog connectionListDialog; |
||||||
|
private final ConnectionConfig connectionConfig; |
||||||
|
|
||||||
|
public ConnectionListDialogActionAdapter(ConnectionManagerPane connectionManagerPane, |
||||||
|
BasicDialog connectionListDialog, |
||||||
|
ConnectionConfig connectionConfig) { |
||||||
|
this.connectionManagerPane = connectionManagerPane; |
||||||
|
this.connectionListDialog = connectionListDialog; |
||||||
|
this.connectionConfig = connectionConfig; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void doOk() { |
||||||
|
if (!connectionManagerPane.isNamePermitted()) { |
||||||
|
connectionListDialog.setDoOKSucceed(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
connectionManagerPane.update(connectionConfig); |
||||||
|
DesignerContext.getDesignerBean("databasename").refreshBeanElement(); |
||||||
|
// 关闭定义数据连接页面,为其解锁
|
||||||
|
EditLockUtils.unlock(LockItem.CONNECTION); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void doCancel() { |
||||||
|
// 关闭定义数据连接页面,为其解锁
|
||||||
|
super.doCancel(); |
||||||
|
EditLockUtils.unlock(LockItem.CONNECTION); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue