ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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;
    }
 
}