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 java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.util.Arrays;
|
|
import javax.swing.ButtonGroup;
|
|
import com.vci.client.portal.UI.v3.comptdesign.UIComptDesignDialog;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.BtmTypeChooseActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.BtmTypeEditActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.LinkTypeChooseActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.LinkTypeEditActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.PortalVIChooseActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.PortalVIEditActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.QTChooseActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.QTEditActionListener;
|
import com.vci.client.portal.UI.v3.comptdesign.compt.al.UILayoutChooseActionListener;
|
import com.vci.client.portal.utility.PLDefination;
|
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.VCIJPanel;
|
import com.vci.client.ui.swing.components.VCIJRadioButton;
|
import com.vci.client.ui.swing.components.VCIJScrollPane;
|
import com.vci.client.ui.swing.components.VCIJTextField;
|
import com.vci.common.portal.enums.PortalVIType;
|
import com.vci.common.portal.enums.PortalVITypeFlag;
|
|
/**
|
* 子UI组件面板
|
*
|
* <p>
|
* Title:
|
* </p>
|
* <p>
|
* Description:
|
* </p>
|
* <p>
|
* Copyright: Copyright (c) 2016
|
* </p>
|
* <p>
|
* Company: VCI
|
* </p>
|
*
|
* @author Jason
|
* @time 2022-12-27
|
* @version 1.0
|
*/
|
public class SubUIComptPanel extends BaseComptPanel {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = -4327897738306488347L;
|
|
// protected PortalVIType getPortalVIType() {
|
// return PortalVIType.UI;
|
// }
|
|
/************************ 关联对象 BtmType ********************************/
|
private VCIJPanel palBtmType = new VCIJPanel();
|
private VCIJLabel lblUIBtmType = new VCIJLabel("对象类型");
|
private VCIJTextField txtUIBtmType = new VCIJTextField(true);
|
private VCIJButton btnUIBtmType = VCISwingUtil.createVCIJButton("btmType", "", "", "search.png");
|
private VCIJButton btnUIBtmTypeEdit = VCISwingUtil.createVCIJButton("btmTypeEdit", "", "", "edit.png");
|
|
private VCIJLabel lblChooseUILayout = new VCIJLabel("UI定义");
|
private VCIJTextField txtChooseUILayout = new VCIJTextField(true);
|
private VCIJButton btnChooseUILayout = VCISwingUtil.createVCIJButton("chooseUILayout", "", "", "search.png");
|
private VCIJButton btnChooseUILayoutEdit = VCISwingUtil.createVCIJButton("chooseUILayoutEdit", "", "", "edit.png");
|
|
private VCIJLabel lblSearchType = new VCIJLabel("查询类型");
|
private ButtonGroup searchTypeGroup = new ButtonGroup();
|
private VCIJPanel palRadioBtn = new VCIJPanel();
|
private VCIJRadioButton rbtnBtmType = new VCIJRadioButton("业务类型");
|
private VCIJRadioButton rbtnLinkType = new VCIJRadioButton("链接类型");
|
|
private VCIJLabel lblQryType = new VCIJLabel("查询对象类型");
|
private VCIJTextField txtQryType = new VCIJTextField(false);
|
private VCIJButton btnQryType = VCISwingUtil.createVCIJButton("qryType", "", "", "search.png");
|
private VCIJButton btnQryTypeEdit = VCISwingUtil.createVCIJButton("qryTypeEdit", "", "", "edit.png");
|
|
private VCIJLabel lblQueryTemplateName = new VCIJLabel("查询模板");
|
private VCIJTextField txtQueryTemplateName = new VCIJTextField(false);
|
private VCIJButton btnChooseQT = VCISwingUtil.createVCIJButton("chooseUILayout", "", "", "search.png");
|
private VCIJButton btnChooseQTEdit = VCISwingUtil.createVCIJButton("chooseUILayoutEdit", "", "", "edit.png");
|
|
BtmTypeChooseActionListener qryBTypeChooseActionListener = new BtmTypeChooseActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtQryType, Arrays.asList(txtQueryTemplateName));
|
LinkTypeChooseActionListener qryLTypeChooseActionListener = new LinkTypeChooseActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtQryType, Arrays.asList(txtQueryTemplateName), null);
|
|
public SubUIComptPanel(UIComptDesignDialog ownedUIComptDesignDialog) {
|
super(ownedUIComptDesignDialog);
|
}
|
|
@Override
|
public boolean checkInputIsOk() {
|
boolean res = checkUILayoutInputIsOk();
|
// if(rbtnBtmType.isSelected()){
|
// res = checkBtmTypeInputIsOk();
|
// } else if(rbtnLinkType.isSelected()){
|
// res = checkLinkTypeInputIsOk();
|
// }
|
return res;
|
}
|
|
private boolean checkUILayoutInputIsOk() {
|
boolean res = false;
|
if (!(super.checkBtmTypeTxtIsOk(lblUIBtmType, txtUIBtmType))) {
|
res = false;
|
} else if (!(super.checkUILayoutTxtIsOk(lblChooseUILayout, txtChooseUILayout, txtUIBtmType))) {
|
res = false;
|
} else if (!(super.checkQTNameTxtIsOk(lblQueryTemplateName, txtQueryTemplateName, txtQryType))) {
|
res = false;
|
} else {
|
res = true;
|
}
|
return res;
|
}
|
|
@Override
|
public void buildPanel() {
|
initUI();
|
}
|
|
private void initUI() {
|
init();
|
}
|
|
private void init() {
|
setLayout(new BorderLayout());
|
add(initUILayoutPanel(), BorderLayout.CENTER);
|
}
|
|
|
private VCIJPanel initUILayoutPanel() {
|
VCIJPanel pal = new VCIJPanel();
|
pal.setLayout(new GridBagLayout());
|
|
pal.add(lblUIBtmType, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
|
pal.add(txtUIBtmType, new GridBagConstraints(2, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0));
|
pal.add(btnUIBtmType, new GridBagConstraints(3, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
|
pal.add(btnUIBtmTypeEdit, new GridBagConstraints(4, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0));
|
|
pal.add(lblChooseUILayout, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0));
|
pal.add(txtChooseUILayout, new GridBagConstraints(2, 1, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
|
pal.add(btnChooseUILayout, new GridBagConstraints(3, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0));
|
pal.add(btnChooseUILayoutEdit, new GridBagConstraints(4, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0));
|
|
searchTypeGroup.add(rbtnBtmType);
|
searchTypeGroup.add(rbtnLinkType);
|
|
palRadioBtn.setLayout(new GridBagLayout());
|
palRadioBtn.add(rbtnBtmType, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
|
palRadioBtn.add(rbtnLinkType, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
|
|
ActionListener al = new ActionListener() {
|
@Override
|
public void actionPerformed(ActionEvent e) {
|
rbtn_actionPerformed(e);
|
}
|
};
|
rbtnBtmType.setObj("btm");
|
rbtnLinkType.setObj("linktype");
|
|
rbtnBtmType.addActionListener(al);
|
rbtnLinkType.addActionListener(al);
|
|
pal.add(lblSearchType, new GridBagConstraints(1, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0));
|
pal.add(palRadioBtn, new GridBagConstraints(2, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
|
|
pal.add(lblQryType, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0));
|
pal.add(txtQryType, new GridBagConstraints(2, 3, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
|
pal.add(btnQryType, new GridBagConstraints(3, 3, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0));
|
pal.add(btnQryTypeEdit, new GridBagConstraints(4, 3, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 5), 0, 0));
|
|
pal.add(lblQueryTemplateName, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0));
|
pal.add(txtQueryTemplateName, new GridBagConstraints(2, 4, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0));
|
pal.add(btnChooseQT, new GridBagConstraints(3, 4, 2, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0));
|
pal.add(btnChooseQTEdit, new GridBagConstraints(4, 4, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0));
|
|
pal.add(new VCIJLabel(""), new GridBagConstraints(1, 15, 4, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 0, 0), 0, 0));
|
VCIJPanel palRes = new VCIJPanel(new BorderLayout());
|
palRes.add(new VCIJScrollPane(pal));
|
return palRes;
|
}
|
|
@Override
|
protected void initBtmTypeActionListener() {
|
BtmTypeChooseActionListener btmTypeChooseActionListener = new BtmTypeChooseActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtUIBtmType,
|
Arrays.asList(txtChooseUILayout));
|
btnUIBtmType.addActionListener(btmTypeChooseActionListener);
|
super.getActions().add(btmTypeChooseActionListener);
|
|
UILayoutChooseActionListener uiLayoutChooseActionListener = new UILayoutChooseActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtChooseUILayout, null, txtUIBtmType);
|
|
btnChooseUILayout.addActionListener(uiLayoutChooseActionListener);
|
super.getActions().add(uiLayoutChooseActionListener);
|
|
super.getActions().add(qryBTypeChooseActionListener);
|
super.getActions().add(qryLTypeChooseActionListener);
|
|
QTChooseActionListener qTChooseActionListener = new QTChooseActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtQueryTemplateName, null, txtUIBtmType);
|
|
btnChooseQT.addActionListener(qTChooseActionListener);
|
super.getActions().add(qTChooseActionListener);
|
|
// ------------------------------------------------------------------------------
|
BtmTypeEditActionListener btmTypeEditActionListener = new BtmTypeEditActionListener(this,
|
super.getOwnedUIComptDesignDialog(), txtUIBtmType, null);
|
btnUIBtmTypeEdit.addActionListener(btmTypeEditActionListener);
|
super.getActions().add(btmTypeEditActionListener);
|
|
// PortalVIEditActionListener portalVIEditActionListener = new PortalVIEditActionListener(this,
|
// super.getOwnedUIComptDesignDialog(), txtChooseUILayout, null, txtBtmType, getPortalVIType(),
|
// PortalVITypeFlag.BtmType);
|
// btnChooseUILayoutEdit.addActionListener(portalVIEditActionListener);
|
// super.getActions().add(portalVIEditActionListener);
|
|
QTEditActionListener qtEditAction = new QTEditActionListener(this, super.getOwnedUIComptDesignDialog(),
|
txtQueryTemplateName, null);
|
btnChooseQTEdit.addActionListener(qtEditAction);
|
super.getActions().add(qtEditAction);
|
}
|
|
@Override
|
protected void initLinkTypeActionListener() {
|
|
}
|
|
@Override
|
public void setDataToUISpec(PLDefination d) {
|
txtUIBtmType.setText(d.getSubUiObjType());
|
txtChooseUILayout.setText(d.getSubUILayout());
|
|
if (d.getSearchTarger().equals("2")) {
|
rbtnBtmType.setSelected(false);
|
rbtnLinkType.setSelected(true);
|
txtQryType.setText(d.getLinkType());
|
} else {
|
rbtnBtmType.setSelected(true);
|
rbtnLinkType.setSelected(false);
|
txtQryType.setText(d.getShowType());
|
}
|
txtQueryTemplateName.setText(d.getQueryTemplateName());
|
}
|
|
@Override
|
public PLDefination getNewPLDefination(PLDefination d) {
|
if (d == null) {
|
d = new PLDefination();
|
}
|
|
d.setSearchTarger("1");
|
d.setSubUiObjType(txtUIBtmType.getText().toString().trim());
|
d.setSubUILayout(txtChooseUILayout.getText().toString().trim());
|
|
if (rbtnBtmType.isSelected()) {
|
d.setSearchTarger("1");
|
d.setShowType(txtQryType.getText().toString().trim());
|
} else {
|
d.setSearchTarger("2");
|
d.setLinkType(txtQryType.getText().toString().trim());
|
}
|
d.setQueryTemplateName(txtQueryTemplateName.getText().toString().trim());
|
|
return d;
|
}
|
|
|
private void rbtn_actionPerformed(ActionEvent e){
|
VCIJRadioButton rbtn = (VCIJRadioButton)e.getSource();
|
String rbtnObj = (String)rbtn.getObj();
|
|
super.hidePopupDialog();
|
//changeDyanmicContentPanel(rbtnObj);
|
if (rbtnObj.equals("Btm")) {
|
btnQryType.removeActionListener(qryLTypeChooseActionListener);
|
btnQryType.addActionListener(qryBTypeChooseActionListener);
|
} else {
|
btnQryType.removeActionListener(qryBTypeChooseActionListener);
|
btnQryType.addActionListener(qryLTypeChooseActionListener);
|
}
|
}
|
|
}
|