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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
package com.vci.client.portal.NewNewUI.buttonmng;
 
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder;
 
import com.vci.corba.portal.*;
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionParam;
import com.vci.corba.portal.data.PLCommandParameter;
import com.vci.corba.portal.data.PLTabButton;
import com.vci.client.LogonApplication;
import com.vci.client.common.IconSelectDialog;
import com.vci.client.portal.NewNewUI.actionmng.ActionSelectDialog;
import com.vci.client.portal.utility.UITools;
import com.vci.client.ui.image.BundleImage;
import com.vci.client.ui.swing.VCISwingUtil;
import com.vci.client.ui.swing.components.VCIJButton;
import com.vci.client.ui.swing.components.VCIJIntegerTextField;
import com.vci.client.ui.swing.components.VCIJLabel;
import com.vci.client.ui.swing.components.VCIJOptionPane;
import com.vci.client.ui.swing.components.VCIJPanel;
import com.vci.client.ui.swing.components.VCIJRadioButton;
import com.vci.client.ui.swing.components.VCIJScrollPane;
import com.vci.client.ui.swing.components.VCIJTextArea;
import com.vci.client.ui.swing.components.VCIJTextField;
import com.vci.client.ui.swing.components.VCIJDialog.DialogResult;
import com.vci.corba.common.VCIError;
 
@SuppressWarnings("deprecation")
public class ButtonInfoPanel extends VCIJPanel {
 
    /**
     * 
     */
    private static final long serialVersionUID = 3981272454544575927L;
 
    
    private PLTabButton btn = null;
    
    private VCIJLabel lblSeq = new VCIJLabel("编号");
    private VCIJIntegerTextField txtSeq = new VCIJIntegerTextField("");
    
    private VCIJLabel lblName = new VCIJLabel("名称");
    private VCIJTextField txtName = new VCIJTextField(true);
    
    private VCIJLabel lblAction = new VCIJLabel("Action");
    private VCIJTextField txtAction = new VCIJTextField(true);
    private VCIJButton btnActionChoose = VCISwingUtil.createVCIJButton("btnActionChoose", "选择", "", "search.png");
    
    private VCIJLabel lblAuth = new VCIJLabel("是否授权");
    private VCIJRadioButton rbtnAuthYes = new VCIJRadioButton("是", true);
    private VCIJRadioButton rbtnAuthNo = new VCIJRadioButton("否", false);
    private ButtonGroup rbtnAuthGroup = new ButtonGroup();
    
    private VCIJLabel lblShow = new VCIJLabel("是否显示");
    private VCIJRadioButton rbtnShowYes = new VCIJRadioButton("是", true);
    private VCIJRadioButton rbtnShowNo = new VCIJRadioButton("否", false);
    private ButtonGroup rbtnShowGroup = new ButtonGroup();
    
    private VCIJLabel lblShowType = new VCIJLabel("显示方式");
    private VCIJRadioButton rbtnShowTypeText = new VCIJRadioButton("文字", false);
    private VCIJRadioButton rbtnShowTypeIcon = new VCIJRadioButton("图标", false);
    private VCIJRadioButton rbtnShowTypeTextAndIcon = new VCIJRadioButton("文字和图标", true);
    private ButtonGroup rbtnShowTypeGroup = new ButtonGroup();
    
    private VCIJLabel lblIcon = new VCIJLabel("图标");
    private VCIJTextField txtIcon = new VCIJTextField(false);
    private VCIJButton btnIconChoose = VCISwingUtil.createVCIJButton("btnIconChoose", "选择", "", "search.png");
    
    private VCIJLabel lblTipInfo = new VCIJLabel("提示信息");
    private VCIJTextArea txtTipInfo = new VCIJTextArea(false);
    
    private ButtonParamTableCompt paramTablePanel = null;
    
    private OptMode optMode = OptMode.View;
    
    private Dialog ownedDialog = null;
    public ButtonInfoPanel(Dialog  ownedDialog, PLTabButton btn){
        this.ownedDialog = ownedDialog;
        this.btn = btn;
    }
    
    public void buildPanel(){
        init();
    }
    private void init(){
        initUI();
    }
    private void initUI(){
        setLayout(new BorderLayout());
        
        add(getAttrInfoPanel(), BorderLayout.NORTH);
 
        TitledBorder border = BorderFactory.createTitledBorder("参数信息");
        border.setTitleColor(Color.BLUE);
        paramTablePanel = new ButtonParamTableCompt(Arrays.asList(new PLCommandParameter[0]));
        paramTablePanel.setBorder(border);
        add(paramTablePanel, BorderLayout.CENTER);
        
        setControlEnable(false);
    }
    
    private VCIJPanel getAttrInfoPanel(){
        VCIJPanel pal = new VCIJPanel(new GridBagLayout());
 
        TitledBorder border = BorderFactory.createTitledBorder("基础信息");
        border.setTitleColor(Color.BLUE);
        pal.setBorder(border);
        
        int gridy = -1;
        
        gridy += 1;
        pal.add(lblSeq,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        pal.add(txtSeq, new GridBagConstraints(2, gridy, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0));
        txtSeq.setRequired(true);
        
        gridy += 1;
        pal.add(lblName,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0));
        pal.add(txtName, new GridBagConstraints(2, gridy, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
        
        gridy += 1;
        pal.add(lblAction,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        pal.add(txtAction, new GridBagConstraints(2, gridy, 2, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
        pal.add(btnActionChoose, new GridBagConstraints(4, gridy, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(1, 1, 0, 1), 0, 0));
 
        txtAction.setEditable(false);
        txtAction.setEnabled(false);
        btnActionChoose.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                showActionChooseDialog();
            }
        });
        
        gridy += 1;
        pal.add(lblAuth,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        VCIJPanel palAuth = new VCIJPanel(new FlowLayout(FlowLayout.LEADING));
        palAuth.add(rbtnAuthYes); palAuth.add(rbtnAuthNo);
        rbtnAuthGroup.add(rbtnAuthYes); rbtnAuthGroup.add(rbtnAuthNo);
        pal.add(palAuth, new GridBagConstraints(2, gridy, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0));
        
        gridy += 1;
        pal.add(lblShow,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        VCIJPanel palShow = new VCIJPanel(new FlowLayout(FlowLayout.LEADING));
        palShow.add(rbtnShowYes); palShow.add(rbtnShowNo);
        rbtnShowGroup.add(rbtnShowYes); rbtnShowGroup.add(rbtnShowNo);
        pal.add(palShow, new GridBagConstraints(2, gridy, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0));
        
        ActionListener showChangeAL = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(rbtnShowNo.isSelected()){
                    rbtnShowTypeText.setEnabled(false);
                    rbtnShowTypeIcon.setEnabled(false);
                    rbtnShowTypeTextAndIcon.setEnabled(false);
                    setIconChooseEnable(false);
                } else {
                    rbtnShowTypeText.setEnabled(true);
                    rbtnShowTypeIcon.setEnabled(true);
                    rbtnShowTypeTextAndIcon.setEnabled(true);
                    rbtnShowTypeTextAndIcon.doClick();
                }
            }
        };
        rbtnShowYes.addActionListener(showChangeAL); rbtnShowNo.addActionListener(showChangeAL);
        
        gridy += 1;
        pal.add(lblShowType,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        VCIJPanel palShowType = new VCIJPanel(new FlowLayout(FlowLayout.LEADING));
        palShowType.add(rbtnShowTypeText); palShowType.add(rbtnShowTypeIcon);palShowType.add(rbtnShowTypeTextAndIcon);
        rbtnShowTypeGroup.add(rbtnShowTypeText); rbtnShowTypeGroup.add(rbtnShowTypeIcon);rbtnShowTypeGroup.add(rbtnShowTypeTextAndIcon);
        pal.add(palShowType, new GridBagConstraints(2, gridy, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0));
        
        ActionListener showTypeChangeAL = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                boolean enable = false;
                if(rbtnShowTypeIcon.isSelected() || rbtnShowTypeTextAndIcon.isSelected()){
                    enable = true;
                } else {
                    enable = false;
                }
                setIconChooseEnable(enable);
            }
        };
        rbtnShowTypeText.addActionListener(showTypeChangeAL); 
        rbtnShowTypeIcon.addActionListener(showTypeChangeAL);
        rbtnShowTypeTextAndIcon.addActionListener(showTypeChangeAL);
        
        gridy += 1;
        pal.add(lblIcon,  new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        pal.add(txtIcon, new GridBagConstraints(2, gridy, 2, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
        pal.add(btnIconChoose, new GridBagConstraints(4, gridy, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(1, 1, 0, 1), 0, 0));
        
        btnIconChoose.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                showPicChooseDialog();
            }
        });
        
        gridy += 1;
        pal.add(lblTipInfo, new GridBagConstraints(1, gridy, 1, 1, 0, 0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
        txtTipInfo.setRows(3);
        txtTipInfo.setColumns(10);
        txtTipInfo.setWrapStyleWord(true);
        txtTipInfo.setLineWrap(true);
        //VCIJScrollPane jspTipInfo = new VCIJScrollPane(txtTipInfo);
        pal.add(txtTipInfo, new GridBagConstraints(2, gridy, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
        return pal;
    }
    
    private PLAction choosedAction = null;
    private Comparator<PLCommandParameter> paramsComparator = new Comparator<PLCommandParameter>() {
        @Override
        public int compare(PLCommandParameter o1, PLCommandParameter o2) {
            return o1.plKey.compareTo(o2.plKey);
        }
    };
    private void showActionChooseDialog(){
        ActionSelectDialog dialog = new ActionSelectDialog((JDialog)this.ownedDialog);
        PLAction action = dialog.getSelectedAction();
        if(action == null) {
            this.choosedAction = null;
            return;
        }
        this.choosedAction = action;
        
        txtAction.setText(action.plName);
        this.actionMap.put(action.plOId, action);
 
        List<PLCommandParameter> list = new ArrayList<PLCommandParameter>();
        try{
 
            // 查出当前按钮已经存在的按钮参数
            PLCommandParameter[] btnParams = new PLCommandParameter[0];
            //获取到重新选择action之前的参数
            if (this.btn != null && this.btn.plOId != null && !"".equals(this.btn.plOId)) {
                btnParams = UITools.getService().getPLCommandParametersByCommandOId(this.btn.plOId);
            }
            
            // 新选择的Action上定义的参数 
            PLActionParam[] actionParams = UITools.getService().getPLActionParamArrayByActionId(action.plOId);
            // Action的参数作为按钮参数
            for (PLActionParam ap : actionParams) {
                PLCommandParameter bp = new PLCommandParameter();
                bp.plKey = ap.name;
                bp.plValue = ap.defaultValue;
                list.add(bp);
                
                for (PLCommandParameter commandParam : btnParams) {
                    // 用按钮是已经存在同名的参数值覆盖新选择Action的默认值
                    if(commandParam.plKey.equals(bp.plKey)){
                        bp.plValue = commandParam.plValue;
                        break;
                    }
                }
            }
            
//            for(int i = 0; i < commandParams.length; i++){
//                list.add(commandParams[i]);
//            }
//            
//            // 新选择的Action上定义的参数 
//            PLActionParam[] actionParams = Tool.getService().getPLActionParamArrayByActionId(action.plOId);
//            // 依次先循环新选择Action的参数,如果存在key相同,则用Action参数默值
//            for (PLActionParam ap : actionParams) {
//                
//                boolean apExist = false;
//                for (PLCommandParameter bp : commandParams) {
//                    if(ap.name.equals(bp.plKey)){
//                        apExist = true;
//                        bp.plValue = ap.defaultValue;
//                        break;
//                    }
//                }
//                if(!apExist){
//                    PLCommandParameter bpNew = new PLCommandParameter();
//                    bpNew.plKey = ap.name;
//                    bpNew.plValue = ap.defaultValue;
//                    list.add(bpNew);
//                }
//            }
//            
//            boolean isExist = false;
//            for(int i = 0;i < commandParams.length;i++){
//                isExist = false;
//                for(int j = 0;j<list.size();j++){
//                    if(commandParams[i].plKey.equals(list.get(j).plKey)){
//                        list.get(j).plValue = commandParams[i].plValue;
//                        isExist = true;
//                        break;
//                    }
//                }
//                if(!isExist){
//                    list.add(commandParams[i]);
//                }    
//            }
        }catch(VCIError e){
            e.printStackTrace();
        }
        reloadTablePanelData(list);
    }
    
    private void showPicChooseDialog(){
        //PicChooseDialog dialog = new PicChooseDialog(this.ownedDialog);
        IconSelectDialog dialog = new IconSelectDialog("选择图标", true , "", this.btnIconChoose);
        dialog.setVisible(true);
        
        if(dialog.getDialogResult()  == DialogResult.CANCEL){
            return;
        }
        
        final String imagePath = dialog.getSelectedIcon();
        //final String imagePath = dialog.getImageURL();
        txtIcon.setText(imagePath);
        setImageIcon(imagePath);
    }
    
    private void setImageIcon(final String imageIconPath){
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                if(imageIconPath == null || "".equals(imageIconPath)){
                    lblIcon.setIcon(null);
                } else {
                    BundleImage bimage = new BundleImage();
                    lblIcon.setIcon(bimage.createImageIconByPath(imageIconPath));
                    //lblIcon.setIcon(SFServiceClientUtil.getImageIcon(imageIconPath));
                }
            }
        });
    }
    public void setTabButton(PLTabButton btn){
        this.btn = btn;
        setValueToUI(btn);
    }
    
    private Map<String, PLAction> actionMap = new HashMap<String, PLAction>();
    private void setValueToUI(PLTabButton btn){
        if(btn == null){
            txtSeq.setText("");
            txtName.setText("");
            txtAction.setText("");
            
            rbtnAuthYes.setSelected(true);
            rbtnAuthNo.setSelected(false);
            
            rbtnShowYes.setSelected(true);
            rbtnAuthNo.setSelected(false);
            
            rbtnShowTypeText.setSelected(false);
            rbtnShowTypeIcon.setSelected(false);
            rbtnShowTypeTextAndIcon.setSelected(true);
            
            txtIcon.setText("");
            txtTipInfo.setText("");
            
            lblIcon.setIcon(null);
            
            paramTablePanel.setButtonParams(Arrays.asList(new PLCommandParameter[0]));
            paramTablePanel.getTablePanel().refreshTableData();
            return;
        }
        
        setImageIcon(btn.iconPath);
        txtSeq.setText(String.valueOf(btn.plSeq));
        txtName.setText(btn.plLabel);
        if(actionMap.containsKey(btn.plActionOId)){
            txtAction.setText(actionMap.get(btn.plActionOId).plName);
        } else {
            PLAction a;
            try {
                a = UITools.getService().getPLActionById(btn.plActionOId);
                actionMap.put(btn.plActionOId, a);
                txtAction.setText(a.plName);
            } catch (VCIError e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        if("0".equals(btn.authorization)){
            rbtnAuthYes.setSelected(true);
        } else {
            rbtnAuthNo.setSelected(true);
        }
        if("0".equals(btn.show)){
            rbtnShowYes.setSelected(true);
        } else {
            rbtnShowNo.setSelected(true);
        }
        if("text".equals(btn.displayMode)){
            rbtnShowTypeText.setSelected(true);
        }else if("image".equals(btn.displayMode)){
            rbtnShowTypeIcon.setSelected(true);
        }else{
            rbtnShowTypeTextAndIcon.setSelected(true);
        }
        
        txtIcon.setText(btn.iconPath);
        txtTipInfo.setText(btn.plDesc);
        
        try {
            PLCommandParameter[] params = UITools.getService().getPLCommandParametersByCommandOId(btn.plOId);
            List<PLCommandParameter> list = Arrays.asList(params);
            reloadTablePanelData(list);
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
    public PLTabButton getFillVaueButton(PLTabButton btn){
        if(btn == null){
            btn = new PLTabButton();
        }
        btn.plSeq = Short.valueOf(txtSeq.getText().trim());
        btn.plLabel = txtName.getText().trim();
        if(this.choosedAction != null){
            btn.plActionOId = this.choosedAction.plOId;
        }
        btn.authorization = rbtnAuthYes.isSelected() ? "0" : "1";
        btn.show = rbtnShowYes.isSelected() ? "0" : "1";
        if(rbtnShowTypeText.isSelected()){
            btn.displayMode = "text";
        } else if(rbtnShowTypeIcon.isSelected()){
            btn.displayMode = "image";
        } else if(rbtnShowTypeTextAndIcon.isSelected()){
            btn.displayMode = "textandimage";
        }
        btn.plDesc = txtTipInfo.getText().trim();
        btn.iconPath = txtIcon.getText().trim();
        return btn;
    }
    
    private void reloadTablePanelData(List<PLCommandParameter> list){
        Collections.sort(list, paramsComparator);
        paramTablePanel.setButtonParams(list);
        this.paramTablePanel.setButtonParams(list);
        this.paramTablePanel.getTablePanel().refreshTableData();
    }
 
    
    public boolean checkInputValueIsOk(){
        boolean res = false;
        if(!isNull(lblSeq, txtSeq)){
            return false;
        }else if(!isNull(lblName, txtName)){
            return false;
        }else if(!isNull(lblAction, txtAction)){
            return false;
        }else if(getOptMode() == OptMode.Add && this.choosedAction == null){
            VCIJOptionPane.showMessage(ownedDialog, "请选择有效的Action!");
            return false;
        }
        return res;
    }
    
    private boolean isNull(VCIJLabel lbl, VCIJTextField txt){
        if("".equals(txt.getText().trim())){
            txt.requestFocus();
            VCIJOptionPane.showMessage(ownedDialog, lbl.getText() + " 不能为空!");
            return false;
        }
        return true;
    }
    public OptMode getOptMode() {
        return optMode;
    }
 
    public void setOptMode(OptMode optMode) {
        this.optMode = optMode;
    }
 
    public void setControlEnable(boolean enable){
        btnActionChoose.setEnabled(enable);
        rbtnAuthYes.setEnabled(enable);
        rbtnAuthNo.setEnabled(enable);
        rbtnShowYes.setEnabled(enable);
        rbtnShowNo.setEnabled(enable);
        rbtnShowTypeText.setEnabled(enable);
        rbtnShowTypeIcon.setEnabled(enable);
        rbtnShowTypeTextAndIcon.setEnabled(enable);
        
        txtSeq.setEditable(enable);
        txtName.setEditable(enable);
        txtTipInfo.setEditable(enable);
        
        setIconChooseEnable(enable);
        
        paramTablePanel.getTablePanel().getTable().setEnabled(enable);
        paramTablePanel.getTablePanel().setEnabled(enable);
    }
    
    
    private void setIconChooseEnable(boolean enable){
        txtIcon.setEnabled(enable);
        txtIcon.setEditable(enable);
        btnIconChoose.setEnabled(enable);
    }
 
    public ButtonParamTableCompt getParamTablePanel() {
        return paramTablePanel;
    }
 
    public void setParamTablePanel(ButtonParamTableCompt paramTablePanel) {
        this.paramTablePanel = paramTablePanel;
    }
    
    
}