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;
|
}
|
|
|
}
|