forked from hugh/demo-connection-provider
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
package com.tptj.demo.hg.connection.conn; |
|
|
|
import com.fanruan.api.design.ui.component.UITextField; |
|
import com.fanruan.api.design.work.DatabaseConnectionPane; |
|
|
|
import javax.swing.*; |
|
import java.awt.*; |
|
|
|
/** |
|
* @author 秃破天际 |
|
* @version 10.0 |
|
* Created by 秃破天际 on 2021-03-31 |
|
**/ |
|
public class DemoConnectionPane extends DatabaseConnectionPane<DemoConnection> { |
|
//hugh:因为mainPanel是在父类的构造中先调用的,所以我们定义的控件一定不要在这里赋值!切记 |
|
private UITextField w_key; |
|
|
|
@Override |
|
protected JPanel mainPanel() { |
|
JPanel pane = new JPanel(); |
|
w_key = new UITextField(); |
|
pane.setLayout( new BorderLayout(4,4) ); |
|
pane.add(w_key,BorderLayout.NORTH); |
|
return pane; |
|
} |
|
|
|
@Override |
|
protected void populateSubDatabaseConnectionBean( DemoConnection conn ) { |
|
if( null != conn ){ |
|
w_key.setText(conn.getKey()); |
|
} |
|
} |
|
|
|
@Override |
|
protected DemoConnection updateSubDatabaseConnectionBean() { |
|
DemoConnection conn = new DemoConnection(); |
|
conn.setKey( w_key.getText() ); |
|
return conn; |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return "Demo Conn"; |
|
} |
|
}
|
|
|