package com.vci.client.portal.UI.v3.comptdesign.compt;
|
|
import java.awt.BorderLayout;
|
import java.awt.GridBagConstraints;
|
import java.awt.GridBagLayout;
|
import java.awt.Insets;
|
|
import com.vci.client.portal.UI.v3.comptdesign.UIComptDesignDialog;
|
import com.vci.client.portal.utility.PLDefination;
|
import com.vci.client.ui.swing.components.VCIJLabel;
|
import com.vci.client.ui.swing.components.VCIJPanel;
|
import com.vci.client.ui.swing.components.VCIJScrollPane;
|
import com.vci.client.ui.swing.components.VCIJTextArea;
|
|
/**
|
* 自定义组件
|
*
|
* <p>Title: </p>
|
* <p>Description: </p>
|
* <p>Copyright: Copyright (c) 2016</p>
|
* <p>Company: VCI</p>
|
* @author xiongchao
|
* @time 2017-2-22
|
* @version 1.0
|
*/
|
public class CustomComptPanel extends BaseComptPanel {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 3552913619053051006L;
|
|
private VCIJLabel lblCtrlPaht = new VCIJLabel("控制路径");
|
private VCIJTextArea txtCtrlPaht = new VCIJTextArea(true);
|
|
public CustomComptPanel(UIComptDesignDialog ownedUIComptDesignDialog){
|
super(ownedUIComptDesignDialog);
|
}
|
|
@Override
|
public boolean checkInputIsOk(){
|
boolean res = true;
|
if(!checkRequiredIsOk(lblCtrlPaht, txtCtrlPaht)){
|
res = false;
|
}
|
return res;
|
}
|
|
@Override
|
public void buildPanel(){
|
initUI();
|
}
|
|
private void initUI(){
|
init();
|
}
|
|
private void init(){
|
setLayout(new BorderLayout());
|
add(getNorthSearchTypePanel(), BorderLayout.NORTH);
|
}
|
|
private VCIJPanel getNorthSearchTypePanel(){
|
VCIJPanel pal = new VCIJPanel(new GridBagLayout());
|
|
GridBagConstraints gbc = new GridBagConstraints();
|
gbc.insets = new Insets(5, 10, 0, 5);
|
gbc.anchor = GridBagConstraints.NORTHEAST;
|
gbc.gridx = 1;
|
gbc.gridy = 0;
|
pal.add(lblCtrlPaht, gbc);
|
|
gbc = new GridBagConstraints();
|
gbc.insets = new Insets(5, 8, 10, 5);
|
gbc.gridx = 2;
|
gbc.gridy = 0;
|
gbc.weightx = 1.0;
|
gbc.fill = GridBagConstraints.HORIZONTAL;
|
|
txtCtrlPaht.setRows(3);
|
txtCtrlPaht.setColumns(10);
|
txtCtrlPaht.setLineWrap(true);
|
txtCtrlPaht.setWrapStyleWord(true);
|
VCIJScrollPane jsp = new VCIJScrollPane();
|
jsp.setViewportView(txtCtrlPaht);
|
pal.add(jsp, gbc);
|
|
VCIJPanel palRes = new VCIJPanel(new BorderLayout());
|
palRes.add(new VCIJScrollPane(pal));
|
return palRes;
|
}
|
|
@Override
|
protected void initBtmTypeActionListener(){
|
|
}
|
|
@Override
|
protected void initLinkTypeActionListener(){
|
|
}
|
|
@Override
|
public void setDataToUISpec(PLDefination defination) {
|
if(defination == null) return;
|
txtCtrlPaht.setText(defination.getControlPath());
|
}
|
|
@Override
|
public PLDefination getNewPLDefination(PLDefination d) {
|
if(d == null){
|
d = new PLDefination();
|
}
|
d.setControlPath(txtCtrlPaht.getText().trim());
|
return d;
|
}
|
|
}
|