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
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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
package com.vci.client.portal.UI.v3;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
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.Comparator;
import java.util.HashMap;
import java.util.List;
 
import javax.swing.JFrame;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
 
import com.vci.client.LogonApplication;
import com.vci.client.common.VCIBasePanel;
import com.vci.client.portal.UI.CloneDialog;
import com.vci.client.portal.UI.ExpDialog;
import com.vci.client.portal.UI.ImportExcel;
import com.vci.client.portal.UI.UIContextDialog;
import com.vci.client.portal.UI.dialog.VCIGrandUIDialog;
import com.vci.client.portal.utility.UIServiceLocaleDisplay;
import com.vci.client.portal.utility.UITools;
import com.vci.client.ui.process.QANProcessBar;
import com.vci.client.ui.process.QANProcessBarFrame;
import com.vci.client.ui.swing.VCISwingUtil;
import com.vci.client.ui.swing.components.VCIJButton;
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.VCIJScrollPane;
import com.vci.client.ui.swing.components.VCIJSplitPane;
import com.vci.client.ui.swing.components.VCIJTabbedPane;
import com.vci.client.ui.swing.components.VCIJTextField;
import com.vci.client.ui.swing.components.VCIJDialog.DialogResult;
import com.vci.client.ui.swing.components.table.AbstractVCIJTableDataProvider;
import com.vci.client.ui.swing.components.table.VCIJTableDataProvider;
import com.vci.client.ui.swing.components.table.VCIJTableNode;
import com.vci.client.ui.swing.components.table.VCIJTablePanel;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.btm.BtmItem;
import com.vci.corba.portal.PortalService.GetPLUILayoutsByRelatedTypeAndQueryInfoResult;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.mw.ClientContextVariable;
 
/**
 * 指定分类下的上下文
 * 
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company: VCI</p>
 * @author xiongchao
 * @time 2017-2-15
 * @version 1.0
 */
public class UIContextDataPanel extends VCIJPanel {
 
    /**
     * 
     */
    private static final long serialVersionUID = 3650977100724911396L;
    private BtmItem btmItem = null;
    private VCIBasePanel ownedModulePanel = null;
    public UIContextDataPanel(){
        
    }
    
    public void refreshUI(){
        clearAndRefresh(true);
    }
    protected void clearAndRefresh(boolean clearSearchText){
        if(clearSearchText){
            clearSearchText();
        }
        clearTableTable();
        clearRegionTable();
        tablePanel.setPageIndex(1);
        tablePanel.refreshTableData();
    }
    protected void clearSearchText(){
        txtName.setText("");
        txtCode.setText("");
    }
    protected void clearTableTable(){
        tablePanel.getTable().getSelectionModel().clearSelection();
        tablePanel.getTableModel().clear();
        tablePanel.getTableModel().fireTableDataChanged();
    }
    protected void clearRegionTable(){
        navRegionPanel.clearUI();
        ctlRegionPanel.clearUI();
        optRegionPanel.clearUI();
        
        navRegionPanel.setPageLayoutDefination(null);
        ctlRegionPanel.setPageLayoutDefination(null);
        optRegionPanel.setPageLayoutDefination(null);
    }
    public void buildUI(){
        init();
    }
 
    private VCIJSplitPane jspLeftToRight = null;
    private VCIJTabbedPane tab = new VCIJTabbedPane();
    private RegionDataPanel navRegionPanel = new RegionDataPanel();
    private RegionDataPanel ctlRegionPanel = new RegionDataPanel();
    private RegionDataPanel optRegionPanel = new RegionDataPanel();
    private void init(){
        setLayout(new BorderLayout());
        
        jspLeftToRight = new VCIJSplitPane(VCIJSplitPane.HORIZONTAL_SPLIT);
        jspLeftToRight.setDividerSize(6);
        jspLeftToRight.setContinuousLayout(true);
        jspLeftToRight.setOneTouchExpandable(true);
        jspLeftToRight.setDividerLocation(600);
 
        jspLeftToRight.setLeftComponent(getWestPanel());
        jspLeftToRight.setRightComponent(getEastTabPanel());
        
        add(jspLeftToRight, BorderLayout.CENTER);
    }
    
    private VCIJPanel getWestPanel(){
        VCIJPanel pal = new VCIJPanel(new BorderLayout());
        pal.add(getNorthPanel(), BorderLayout.NORTH);
        pal.add(getContextTablePanel(), BorderLayout.CENTER);
        return pal;
    }
 
    private VCIJTabbedPane getEastTabPanel(){
        navRegionPanel.setPageLayoutDefination(null);
        navRegionPanel.setAreaType((short)1);
        navRegionPanel.buildUI();
        
        ctlRegionPanel.setPageLayoutDefination(null);
        ctlRegionPanel.setAreaType((short)2);
        ctlRegionPanel.buildUI();
        
        optRegionPanel.setPageLayoutDefination(null);
        optRegionPanel.setAreaType((short)3);
        optRegionPanel.buildUI();
        
        tab.add("导航区", navRegionPanel);
        tab.add("控制区", ctlRegionPanel);
        tab.add("操作区", optRegionPanel);
        return tab;
    }
    private VCIJButton btnAdd = VCISwingUtil.createVCIJButton("add", "添加", "添加", "add.png", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            add_actionPerformed(e);
        }
    });
    private VCIJButton btnEdit = VCISwingUtil.createVCIJButton("edit", "修改", "修改", "edit.png", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            edit_actionPerformed(e);
        }
    });
    private VCIJButton btnDelete = VCISwingUtil.createVCIJButton("del", "删除", "删除", "delete.png", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            delete_actionPerformed(e);
        }
    });
 
    private List<PLUILayout> getMultiSelectedPLDs(){
        List<PLUILayout> list = new ArrayList<PLUILayout>();
        list = tablePanel.getSelectedRowObjectsList();
        return list;
    }
    private boolean isSelected(){
        return tablePanel.getTable().getSelectedRow() >= 0;
    }
    private void add_actionPerformed(ActionEvent e){
        try{
            UIContextDialog dialog = new UIContextDialog(getBtmItem(), false, null);
            if(dialog.getDialogResult() == DialogResult.OK){
                refreshUI();
                dialog.dispose();
            }
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void edit_actionPerformed(ActionEvent e){
        try{
            PLUILayout[] pageDefs = tablePanel.getSelectedRowObjectsList().toArray(new PLUILayout[0]);
            if(!isSelected() || pageDefs.length == 0){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.pleaseChooseData"));
                return;
            }
            if(pageDefs.length >= 2){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.onlyChooseOneDataToSomeOpt"));
                return;
            }
            UIContextDialog dialog = new UIContextDialog(getBtmItem(), true, pageDefs[0]);
            if(dialog.getDialogResult() == DialogResult.OK){
                refreshUI();
                dialog.dispose();
            }
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void delete_actionPerformed(ActionEvent e){
        try{
            PLUILayout[] pageLayouts = getMultiSelectedPLDs().toArray(new PLUILayout[0]);
            if(!isSelected() || pageLayouts.length == 0){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.pleaseChooseData"));
                return;
            }
            int optRes = VCIJOptionPane.showConfirm(ClientContextVariable.getFrame(),
                    UIServiceLocaleDisplay.getIl18n("common.msg.confirmDelete"));
            if(!(optRes == VCIJOptionPane.YES_OPTION)){    
                return;
            }
            //TODO
            String[] oids = new String[pageLayouts.length];
            for (int i = 0; i < oids.length; i++) {
                oids[i] = pageLayouts[i].plOId;
            }
            UITools.getService().deletePLUILayoutByOidsForCascade(oids);
            refreshUI();
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void clone_actionPerformed(ActionEvent e){
        try{
            PLUILayout[] contextsx = getMultiSelectedPLDs().toArray(new PLUILayout[0]);
            if(!isSelected() || contextsx.length == 0){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.pleaseChooseData"));
                return;
            }
            if(contextsx.length >= 2){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.onlyChooseOneDataToSomeOpt"));
                return;
            }
    
            CloneDialog dialog = new CloneDialog(null, contextsx[0]);
            dialog.setVisible(true);
            refreshUI();
    
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void export_actionPerformed(ActionEvent e){
        try{
            PLUILayout[] contextsx = getMultiSelectedPLDs().toArray(new PLUILayout[0]);
            if(!isSelected() || contextsx.length == 0){
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                        UIServiceLocaleDisplay.getIl18n("common.msg.pleaseChooseData"));
                return;
            }
            ExpDialog dialog = new ExpDialog(getBtmItem(), contextsx);
            dialog.setVisible(true);
    
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void import_actionPerformed(ActionEvent e){
        try{
            ImportExcel  imp = new ImportExcel(getBtmItem());
            if(imp.impExcel()){
                refreshUI();
                VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), "导入成功!");
            }
        }catch(Throwable ex){
            ex.printStackTrace();
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.executingHasError", 
                            getSourceButtonText(e), ex.toString()));
            return;
        }
    }
    private void grant_actionPerformed(ActionEvent e){
        final PLUILayout[] contextsx = getMultiSelectedPLDs().toArray(new PLUILayout[0]);
        if(!isSelected() || contextsx.length == 0){
            VCIJOptionPane.showMessage(ClientContextVariable.getFrame(), 
                    UIServiceLocaleDisplay.getIl18n("common.msg.pleaseChooseData"));
            return;
        }
        final QANProcessBarFrame frame = new QANProcessBarFrame();
        final QANProcessBar bar = new QANProcessBar(new Thread(new Runnable() {
            @Override
            public void run() {
                try{
                    frame.setContent("正在构建UI授权界面,请稍等...");
                    VCIGrandUIDialog dialog = new VCIGrandUIDialog(getBtmItem(), 
                            getOwnedModulePanel().getFuncObj(), contextsx, contextsx);
                    frame.setContent("");
                    frame.setProcessBarCancel(true);
                    dialog.setLocationAndSize();
                } finally{
                    frame.setProcessBarCancel(true);
                }
            }
        }){}, (JFrame) LogonApplication.frame, frame, "", false);
        String title = "UI授权";
        frame.setTitle(title);
        bar.setTitle(title);
        bar.setVisible(true);
    }
 
    private String getSourceButtonText(ActionEvent e){
        String res = "此操作";
        if(e.getSource() instanceof VCIJButton){
            res = ((VCIJButton)e.getSource()).getText();
        }
        return res;
    }
    
    private VCIJButton btnRefresh = VCISwingUtil.createVCIJButton("refresh", "刷新", "刷新", "sync.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            clearAndRefresh(false);
        }
    });
    private VCIJButton btnClone = VCISwingUtil.createVCIJButton("clone", "克隆", "克隆", "copy.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            clone_actionPerformed(e);
        }
    });
    private VCIJButton btnExport = VCISwingUtil.createVCIJButton("export", "导出", "导出", "export.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            export_actionPerformed(e);
        }
    });
    private VCIJButton btnImport = VCISwingUtil.createVCIJButton("import", "导入", "导入", "import.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            import_actionPerformed(e);
        }
    });
    private VCIJButton btnGrant = VCISwingUtil.createVCIJButton("grant", "授权", "授权", "group_key.png", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            grant_actionPerformed(e);
        }
    });
//    private VCIJButton viewI18nButton = VCISwingUtil.createVCIJButton("viewI18nButton", "查看国际化字典", "查看国际化字典", "image.png", new ActionListener() {
//        @Override
//        public void actionPerformed(ActionEvent e) {
//            i18nTable();
//        }
//    });
    private VCIJPanel getNorthPanel(){
        VCIJPanel pal = new VCIJPanel(new BorderLayout());
        pal.add(new VCIJScrollPane(getWestNorthBtnPanel()), BorderLayout.SOUTH);
        pal.add(getWestNorthSearchPanel(), BorderLayout.NORTH);
        return pal;
    }
    private VCIJLabel lblName = new VCIJLabel("名称");
    private VCIJTextField txtName = new VCIJTextField("");
    private VCIJLabel lblCode = new VCIJLabel("UI上下文");
    private VCIJTextField txtCode = new VCIJTextField("");
    private VCIJButton btnSearch = VCISwingUtil.createVCIJButton("search", "查询", "查询", "search.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            tablePanel.refreshTableData();
        }
    });
    private VCIJButton btnClear = VCISwingUtil.createVCIJButton("clear", "清空", "清空查询条件", "clear.gif", new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            refreshUI();
        }
    });
    private VCIJPanel getWestNorthSearchPanel(){
        VCIJPanel pal = new VCIJPanel(new GridBagLayout());
        pal.add(lblName, getGBC(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, 1));
        pal.add(txtName, getGBC(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, 1));
        pal.add(lblCode, getGBC(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, 1));
        pal.add(txtCode, getGBC(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, 1));
        pal.add(btnSearch, getGBC(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, 1));
        pal.add(btnClear, getGBC(5, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, 1));
        return pal;
    }
    private VCIJPanel getWestNorthBtnPanel(){
//        VCIJPanel pal1 = new VCIJPanel();
//        pal1.add(btnAdd);
//        pal1.add(btnEdit);
//        pal1.add(btnDelete);
//        pal1.add(btnRefresh);
//        
//        VCIJPanel pal2 = new VCIJPanel();
//        pal2.add(btnClone);
//        pal2.add(btnExport);
//        pal2.add(btnImport);
//        pal2.add(btnGrant);
        //pal2.add(viewI18nButton);
        
//        VCIJPanel pal3 = new VCIJPanel(new BorderLayout(0,0));
//        pal3.add(pal1, BorderLayout.NORTH);
//        pal3.add(pal2, BorderLayout.SOUTH);
        
        VCIJPanel pal1 = new VCIJPanel();
        pal1.add(btnAdd);
        pal1.add(btnEdit);
        pal1.add(btnDelete);
        pal1.add(btnRefresh);
        
        VCIJPanel pal2 = new VCIJPanel();
        pal2.add(btnClone);
        pal2.add(btnExport);
        pal2.add(btnImport);
        pal2.add(btnGrant);
        //pal2.add(viewI18nButton);
        
        VCIJPanel panel = new VCIJPanel();
//        panel.setMinimumSize(new Dimension(100, 60));
//        panel.setMaximumSize(new Dimension(1500, 60));
        panel.setLayout(new GridBagLayout());
        GridBagConstraints g = new GridBagConstraints();
        g.anchor = GridBagConstraints.CENTER;
        g.gridx = 0;
        g.gridy = 0;
        g.weightx = 1.0;
        g.weighty = 1.0;
        g.fill = GridBagConstraints.NONE;
        panel.add(pal1, g);
        
        g.gridy = 1;
        panel.add(pal2, g);
        
        panel.setPreferredSize(new Dimension(0, 55));
        
        return panel;
    }
 
    private GridBagConstraints getGBC(int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, int padxy) {
        return new GridBagConstraints(gridx, gridy, gridwidth, gridheight, weightx, weighty, anchor, fill, new Insets(padxy, padxy, padxy, padxy), padxy, padxy);
    }
 
    private Comparator<PLUILayout> pageLayoutComparator = new Comparator<PLUILayout>() {
        @Override
        public int compare(PLUILayout o1, PLUILayout o2) {
            return o1.plCode.compareTo(o2.plCode);
        }
    };
    private VCIJTablePanel<PLUILayout> tablePanel = null;
    private VCIJTableDataProvider<PLUILayout> dataProvider = null;
    private VCIJTablePanel<PLUILayout> getContextTablePanel(){
        dataProvider = new AbstractVCIJTableDataProvider<PLUILayout>() {
            @Override
            public String[] getSpecialColumns() {
                return new String[]{"名称", "UI上下文","导航区","控制区","操作区"};
            }
            @Override
            public int getTotal() {
                return super.total;
            }
            @Override
            public VCIJTableNode<PLUILayout> getNewRowNode(PLUILayout dataObj) {
                VCIJTableNode<PLUILayout> nodeOjb = new VCIJTableNode<PLUILayout>(dataObj);
                int i = 0;
                String[] columns = getSpecialColumns();
                nodeOjb.setPropertyValue(columns[i++], dataObj.plName);
                nodeOjb.setPropertyValue(columns[i++], dataObj.plCode);
                nodeOjb.setPropertyValue(columns[i++], dataObj.plIsShowNavigator == 1 ? "显示":"不显示");
                nodeOjb.setPropertyValue(columns[i++], dataObj.plIsShowForm == 1 ? "显示":"不显示");
                nodeOjb.setPropertyValue(columns[i++], dataObj.plIsShowTab == 1 ? "显示":"不显示");
//                String navCtlOptShow = 
//                    (dataObj.plIsShowNavigator == 1 ? "  显示":"不显示") + " | " + 
//                    (dataObj.plIsShowForm == 1 ? " 显示":"不显示") + " | " + 
//                    (dataObj.plIsShowTab== 1 ? " 显示":"不显示") + "   " + 
//                    "";
//                nodeOjb.setPropertyValue(columns[i++], navCtlOptShow);
                return nodeOjb;
            }
            @Override
            public PLUILayout[] getDatas(int pageIndex, int pageSize) {
                PLUILayout[] res = new PLUILayout[0];
                if(getBtmItem() == null) return res;
                
                int total = 0;
                try {
                    GetPLUILayoutsByRelatedTypeAndQueryInfoResult result = UITools.getService().getPLUILayoutsByRelatedTypeAndQueryInfo(
                                    getBtmItem().name, txtName.getText().trim(), txtCode.getText().trim(), pageIndex, pageSize);
                    
                    total = (int)result.total;
                    res = result.returnValue;
                    res = getSearchFilterData(res);
                } catch (VCIError e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                super.total = total;
                Arrays.sort(res, pageLayoutComparator);
                return res;
            }
        };
        
        tablePanel = new VCIJTablePanel<PLUILayout>(dataProvider);
        tablePanel.setBorder(new EmptyBorder(0,0,0,0));
        tablePanel.setShowExport(false);
        tablePanel.setColumnDefaultWidth(new Integer(200));
 
        String[] cols = dataProvider.getColumns();
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i = 0; i < cols.length; i++){
            String col = cols[i];
            if (col.contains("区"))
                map.put(i, 60);
        }
        tablePanel.setColumnWidthMaps(map);
        tablePanel.buildTablePanel();
        tablePanel.refreshTableData();
        tablePanel.getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                if(!e.getValueIsAdjusting()) return;
                context_valueChange();
                int location = jspLeftToRight.getDividerLocation();
                jspLeftToRight.setDividerLocation(location);    
            }
        });
        return tablePanel;
    }
    private boolean hasSearchText(){
        return (txtName.getText().trim().length() != 0 || txtCode.getText().trim().length() != 0); 
    }
    private PLUILayout[] getSearchFilterData(PLUILayout[] plds){
        if(!hasSearchText()) return plds;
        List<PLUILayout> res = new ArrayList<PLUILayout>();
        for (PLUILayout pld : plds) {
            String name = txtName.getText().trim();
            String code = txtCode.getText().trim();
            if((!"".equals(name) && pld.plName.contains(name))
                    ||(!"".equals(code) && pld.plCode.contains(code))){
                res.add(pld);
            }
        }
        return res.toArray(new PLUILayout[]{});
    }
    /**
     * 
     * <p>国际化字典Dialog: </p>
     * @author yangyang
     * @time 2017-10-31
     */
//    private void i18nTable(){
//        VciI18nTableDialog vi18n = new VciI18nTableDialog();
//        vi18n.setModal(true);
//        vi18n.init();
//        vi18n.setSize(900,600);
//        vi18n.setLocationRelativeTo(ClientContextVariable.getFrame());
//        vi18n.setVisible(true);
//    }
    private void context_valueChange(){
        int row = tablePanel.getTable().getSelectedRow();
        if(row < 0) return;
 
        PLUILayout pld = tablePanel.getSpecialObjectByRowIndex(row);
        tab.removeAll();
        if(pld.plIsShowNavigator == 1){
            refreshRegion(pld, navRegionPanel, "导航区");
        }
        if(pld.plIsShowForm == 1){
            refreshRegion(pld, ctlRegionPanel, "控制区");
        }
        if(pld.plIsShowTab == 1){
            refreshRegion(pld, optRegionPanel, "操作区");
        }
        tab.updateUI();
    }
 
    private void refreshRegion(PLUILayout pld, 
            RegionDataPanel regionPanel,
            String title){
        regionPanel.setBtmItem(getBtmItem());
        regionPanel.setPageLayoutDefination(pld);
        regionPanel.refreshUI();
        regionPanel.updateUI();
        tab.addTab(title, regionPanel);
    }
    
    public BtmItem getBtmItem() {
        return btmItem;
    }
 
    public void setBtmItem(BtmItem btmItem) {
        this.btmItem = btmItem;
    }
 
    public VCIBasePanel getOwnedModulePanel() {
        return ownedModulePanel;
    }
 
    public void setOwnedModulePanel(VCIBasePanel ownedModulePanel) {
        this.ownedModulePanel = ownedModulePanel;
    }
    
    
}