package com.vci.client.portal.UI.v3.comptdesign.compt; import java.awt.BorderLayout; 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.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.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; /** * 树表组件面板 * *
Title:
*Description:
*Copyright: Copyright (c) 2016
*Company: VCI
* @author xiongchao * @time 2017-2-22 * @version 1.0 */ public class TreeTableComptPanel extends BaseComptPanel { /** * */ private static final long serialVersionUID = -3323413554655765212L; private VCIJLabel lblSearchType = new VCIJLabel("搜索类型"); private ButtonGroup searchTypeGroup = new ButtonGroup(); private VCIJRadioButton rbtnBtmType = new VCIJRadioButton("本对象属性"); private VCIJRadioButton rbtnLinkType = new VCIJRadioButton("关联对象属性"); protected PortalVIType getPortalVIType(){ return PortalVIType.Table; } /************************ 关联对象 BtmType ********************************/ private VCIJPanel palBtmType = new VCIJPanel(); private VCIJLabel lblBtmType = new VCIJLabel("顶级节点显示类型"); private VCIJTextField txtBtmType = new VCIJTextField(true); private VCIJButton btnBtmType = VCISwingUtil.createVCIJButton("btmType", "", "", "search.png"); private VCIJButton btnBtmTypeEdit = VCISwingUtil.createVCIJButton("btmTypeEdit", "", "", "edit.png"); private VCIJLabel lblChoosePortalVI = new VCIJLabel("选择模板"); private VCIJTextField txtChoosePortalVI = new VCIJTextField(true); private VCIJButton btnChoosePortalVI = VCISwingUtil.createVCIJButton("choosePortalVI", "", "", "search.png"); private VCIJButton btnChoosePortalVIEdit = VCISwingUtil.createVCIJButton("choosePortalVIEdit", "", "", "edit.png"); private VCIJLabel lblQueryTemplateName = new VCIJLabel("查询模板"); private VCIJTextField txtQueryTemplateName = new VCIJTextField(false); private VCIJButton btnChooseQT = VCISwingUtil.createVCIJButton("choosePortalVI", "", "", "search.png"); private VCIJButton btnChooseQTEdit = VCISwingUtil.createVCIJButton("choosePortalVIEdit", "", "", "edit.png"); private VCIJLabel lblExpandColumn = new VCIJLabel("树形结构展开列"); private VCIJTextField txtExpandColumn = new VCIJTextField(false); private VCIJLabel lblExpandMode = new VCIJLabel("展开方式"); private ButtonGroup expandModeGroup = new ButtonGroup(); private VCIJRadioButton rbtnExpandModeOne = new VCIJRadioButton("逐级展开", true); private VCIJRadioButton rbtnExpandModeAll = new VCIJRadioButton("全部展开"); /************************ 关联对象 LinkType ********************************/ private VCIJPanel palLinkType = new VCIJPanel(); private VCIJLabel lblBtmTypeTarget = new VCIJLabel("顶级节点显示类型"); private VCIJTextField txtBtmTypeTarget = new VCIJTextField(true); private VCIJButton btnBtmTypeTarget = VCISwingUtil.createVCIJButton("btmTypeTarget", "", "", "search.png"); private VCIJButton btnBtmTypeTargetEdit = VCISwingUtil.createVCIJButton("btmTypeTargetEdit", "", "", "edit.png"); private VCIJLabel lblLinkType = new VCIJLabel("链接类型"); private VCIJTextField txtLinkType = new VCIJTextField(true); private VCIJButton btnLinkType = VCISwingUtil.createVCIJButton("linkType", "", "", "search.png"); private VCIJButton btnLinkTypeEdit = VCISwingUtil.createVCIJButton("LinkTypeTargetEdit", "", "", "edit.png"); private VCIJLabel lblChoosePortalVILinkType = new VCIJLabel("选择模板"); private VCIJTextField txtChoosePortalVILinkType = new VCIJTextField(true); private VCIJButton btnChoosePortalVILinkType = VCISwingUtil.createVCIJButton("choosePortalVILinkType", "", "", "search.png"); private VCIJButton btnChoosePortalVIEditLinkType = VCISwingUtil.createVCIJButton("choosePortalVIEditLinkType", "", "", "edit.png"); private VCIJLabel lblQueryTemplateNameLinkType = new VCIJLabel("查询模板"); private VCIJTextField txtQueryTemplateNameLinkType = new VCIJTextField(true); private VCIJButton btnChooseQTLinkType = VCISwingUtil.createVCIJButton("chooseQTLinkType", "", "", "search.png"); private VCIJButton btnChooseQTEditLinkType = VCISwingUtil.createVCIJButton("chooseQTEditLinkType", "", "", "edit.png"); private VCIJLabel lblExpandColumnLinkType = new VCIJLabel("树形结构展开列"); private VCIJTextField txtExpandColumnLinkType = new VCIJTextField(false); private VCIJLabel lblExpandModeLinkType = new VCIJLabel("展开方式 "); private ButtonGroup expandModeGroupLinkType = new ButtonGroup(); private VCIJRadioButton rbtnExpandModeOneLinkType = new VCIJRadioButton("逐级展开", true); private VCIJRadioButton rbtnExpandModeAllLinkType = new VCIJRadioButton("全部展开"); private VCIJPanel dynamicContentPanel = new VCIJPanel(new BorderLayout()); public TreeTableComptPanel(UIComptDesignDialog ownedUIComptDesignDialog){ super(ownedUIComptDesignDialog); } @Override public boolean checkInputIsOk(){ boolean res = false; if(rbtnBtmType.isSelected()){ res = checkBtmTypeInputIsOk(); } else if(rbtnLinkType.isSelected()){ res = checkLinkTypeInputIsOk(); } return res; } private boolean checkBtmTypeInputIsOk(){ boolean res = false; if(!(super.checkBtmTypeTxtIsOk(lblBtmType, txtBtmType))){ res = false; } else if(!(super.checkPortalVITxtIsOk(lblChoosePortalVI, txtChoosePortalVI, txtBtmType))){ res = false; } else if(!(super.checkQTNameTxtIsOk(lblQueryTemplateName, txtQueryTemplateName, txtBtmType))){ res = false; } else { res = true; } return res; } private boolean checkLinkTypeInputIsOk(){ boolean res = false; if(!(super.checkBtmTypeTxtIsOk(lblBtmTypeTarget, txtBtmTypeTarget))){ res = false; } else if(!(super.checkPortalVITxtIsOk(lblChoosePortalVILinkType, txtChoosePortalVILinkType, txtLinkType))){ res = false; } else if(!(super.checkQTNameTxtIsOk(lblQueryTemplateNameLinkType, txtQueryTemplateNameLinkType, txtLinkType))){ res = false; } else { res = true; } return res; } @Override public void buildPanel(){ initUI(); } private void initUI(){ init(); } private void init(){ setLayout(new BorderLayout()); add(getNorthSearchTypePanel(), BorderLayout.NORTH); add(getCenterDynamicContentPanel(), BorderLayout.CENTER); } private VCIJPanel getNorthSearchTypePanel(){ VCIJPanel pal = new VCIJPanel(new GridBagLayout()); searchTypeGroup.add(rbtnBtmType); searchTypeGroup.add(rbtnLinkType); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 10, 0, 5); gbc.gridx = 1; gbc.gridy = 0; pal.add(lblSearchType, gbc); gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 8, 0, 5); gbc.gridx = 2; gbc.gridy = 0; pal.add(rbtnBtmType, gbc); gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 0, 0, 5); gbc.gridx = 3; gbc.gridy = 0; pal.add(rbtnLinkType, gbc); gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 0, 0, 5); gbc.gridx = 4; gbc.gridy = 0; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; pal.add(new VCIJLabel(), gbc); 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); return pal; } private String lastRbtnType = ""; private void rbtn_actionPerformed(ActionEvent e){ VCIJRadioButton rbtn = (VCIJRadioButton)e.getSource(); String rbtnObj = (String)rbtn.getObj(); if(!"".equals(lastRbtnType) && rbtnObj.equals(lastRbtnType)){ return; } changeDyanmicContentPanel(rbtnObj); } private void changeDyanmicContentPanel(String rbtnObj){ VCIJPanel pal = new VCIJPanel(); if(rbtnBtmType.isSelected()){ pal = palBtmType; } else { pal = palLinkType; } dynamicContentPanel.removeAll(); dynamicContentPanel.add(pal, BorderLayout.CENTER); dynamicContentPanel.updateUI(); } private VCIJPanel getCenterDynamicContentPanel(){ dynamicContentPanel = new VCIJPanel(new BorderLayout()); palBtmType = initBtmTypePanel(); palLinkType = initLinkTypePanel(); rbtnBtmType.setSelected(true); rbtnBtmType.doClick(); return dynamicContentPanel; } private VCIJPanel initBtmTypePanel(){ VCIJPanel pal = new VCIJPanel(); pal.setLayout(new GridBagLayout()); pal.add(lblBtmType, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtBtmType, new GridBagConstraints(2, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0)); pal.add(btnBtmType, new GridBagConstraints(3, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnBtmTypeEdit, new GridBagConstraints(4, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 5), 0, 0)); pal.add(lblChoosePortalVI, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtChoosePortalVI, new GridBagConstraints(2, 1, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0)); pal.add(btnChoosePortalVI, new GridBagConstraints(3, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnChoosePortalVIEdit, new GridBagConstraints(4, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(lblQueryTemplateName, new GridBagConstraints(1, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtQueryTemplateName, new GridBagConstraints(2, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0)); pal.add(btnChooseQT, new GridBagConstraints(3, 2, 2, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnChooseQTEdit, new GridBagConstraints(4, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(lblExpandColumn, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtExpandColumn, new GridBagConstraints(2, 3, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 5), 0, 0)); expandModeGroup.add(rbtnExpandModeOne); expandModeGroup.add(rbtnExpandModeAll); VCIJPanel palRbtnExpandMode = new VCIJPanel(new FlowLayout(FlowLayout.LEADING)); palRbtnExpandMode.add(rbtnExpandModeOne); palRbtnExpandMode.add(rbtnExpandModeAll); pal.add(lblExpandMode, new GridBagConstraints(1, 4, 1, 1, 0.0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(palRbtnExpandMode, new GridBagConstraints(2, 4, 3, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 1), 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, 5), 0, 0)); VCIJPanel palRes = new VCIJPanel(new BorderLayout()); palRes.add(new VCIJScrollPane(pal)); return palRes; } private VCIJPanel initLinkTypePanel(){ VCIJPanel pal = new VCIJPanel(); pal.setLayout(new GridBagLayout()); pal.add(lblBtmTypeTarget, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtBtmTypeTarget, new GridBagConstraints(2, 0, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 1), 0, 0)); pal.add(btnBtmTypeTarget, new GridBagConstraints(3, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnBtmTypeTargetEdit, new GridBagConstraints(4, 0, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 5), 0, 0)); pal.add(lblLinkType, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtLinkType, new GridBagConstraints(2, 1, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0)); pal.add(btnLinkType, new GridBagConstraints(3, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnLinkTypeEdit, new GridBagConstraints(4, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(lblChoosePortalVILinkType, new GridBagConstraints(1, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(1, 5, 0, 5), 0, 0)); pal.add(txtChoosePortalVILinkType, new GridBagConstraints(2, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0)); pal.add(btnChoosePortalVILinkType, new GridBagConstraints(3, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnChoosePortalVIEditLinkType, new GridBagConstraints(4, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(lblQueryTemplateNameLinkType, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtQueryTemplateNameLinkType, new GridBagConstraints(2, 3, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 1), 0, 0)); pal.add(btnChooseQTLinkType, new GridBagConstraints(3, 3, 2, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(btnChooseQTEditLinkType, new GridBagConstraints(4, 3, 1, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 0, 0, 0), 0, 0)); pal.add(lblExpandColumnLinkType, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(txtExpandColumnLinkType, new GridBagConstraints(2, 4, 3, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 5, 0, 5), 0, 0)); expandModeGroupLinkType.add(rbtnExpandModeOneLinkType); expandModeGroupLinkType.add(rbtnExpandModeAllLinkType); VCIJPanel palRbtnExpandModeLinkType = new VCIJPanel(new FlowLayout(FlowLayout.LEADING)); palRbtnExpandModeLinkType.add(rbtnExpandModeOneLinkType); palRbtnExpandModeLinkType.add(rbtnExpandModeAllLinkType); pal.add(lblExpandModeLinkType, new GridBagConstraints(1, 5, 1, 1, 0.0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); pal.add(palRbtnExpandModeLinkType, new GridBagConstraints(2, 5, 3, 1, 0.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 1), 0, 0)); pal.add(new VCIJLabel(""), new GridBagConstraints(1, 16, 4, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 0, 5), 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(), txtBtmType, Arrays.asList( txtChoosePortalVI, txtQueryTemplateName)); btnBtmType.addActionListener(btmTypeChooseActionListener); super.getActions().add(btmTypeChooseActionListener); PortalVIChooseActionListener portalVIChooseActionListener = new PortalVIChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtChoosePortalVI, null, txtBtmType, PortalVIType.Table); btnChoosePortalVI.addActionListener(portalVIChooseActionListener); super.getActions().add(portalVIChooseActionListener); QTChooseActionListener qTChooseActionListener = new QTChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtQueryTemplateName, null, txtBtmType); btnChooseQT.addActionListener(qTChooseActionListener); super.getActions().add(qTChooseActionListener); //------------------------------------------------------------------------------ BtmTypeEditActionListener btmTypeEditActionListener = new BtmTypeEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtBtmType, null); btnBtmTypeEdit.addActionListener(btmTypeEditActionListener); super.getActions().add(btmTypeEditActionListener); PortalVIEditActionListener portalVIEditActionListener = new PortalVIEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtChoosePortalVI, null, txtBtmType, getPortalVIType(), PortalVITypeFlag.BtmType); btnChoosePortalVIEdit.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(){ BtmTypeChooseActionListener btmTypeChooseActionListener = new BtmTypeChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtBtmTypeTarget, Arrays.asList(txtLinkType, txtChoosePortalVILinkType, txtQueryTemplateNameLinkType)); btnBtmTypeTarget.addActionListener(btmTypeChooseActionListener); super.getActions().add(btmTypeChooseActionListener); LinkTypeChooseActionListener linkTypeChooseActionListener = new LinkTypeChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtLinkType, Arrays.asList(txtChoosePortalVILinkType, txtQueryTemplateNameLinkType), txtBtmTypeTarget); btnLinkType.addActionListener(linkTypeChooseActionListener); super.getActions().add(linkTypeChooseActionListener); PortalVIChooseActionListener portalVIChooseActionListener = new PortalVIChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtChoosePortalVILinkType, null, txtLinkType, PortalVIType.Table); btnChoosePortalVILinkType.addActionListener(portalVIChooseActionListener); super.getActions().add(portalVIChooseActionListener); QTChooseActionListener qTChooseActionListener = new QTChooseActionListener( this, super.getOwnedUIComptDesignDialog(), txtQueryTemplateNameLinkType, null, txtLinkType); btnChooseQTLinkType.addActionListener(qTChooseActionListener); super.getActions().add(qTChooseActionListener); //----------------------------------------------------------------- BtmTypeEditActionListener btmTypeEditActionListener = new BtmTypeEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtBtmTypeTarget, null); btnBtmTypeTargetEdit.addActionListener(btmTypeEditActionListener); super.getActions().add(btmTypeEditActionListener); LinkTypeEditActionListener linkTypeEditActionListener = new LinkTypeEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtLinkType, null); btnLinkTypeEdit.addActionListener(linkTypeEditActionListener); super.getActions().add(linkTypeEditActionListener); PortalVIEditActionListener portalVIEditActionListener = new PortalVIEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtChoosePortalVILinkType, null, txtLinkType, getPortalVIType(), PortalVITypeFlag.LinkType); btnChoosePortalVIEditLinkType.addActionListener(portalVIEditActionListener); super.getActions().add(portalVIEditActionListener); QTEditActionListener qtEditAction = new QTEditActionListener( this, super.getOwnedUIComptDesignDialog(), txtQueryTemplateNameLinkType, null); btnChooseQTEditLinkType.addActionListener(qtEditAction); super.getActions().add(qtEditAction); } @Override public void setDataToUISpec(PLDefination d) { if("1".equals(d.getSearchTarger())){ rbtnBtmType.setSelected(true); rbtnBtmType.doClick(); txtBtmType.setText(d.getShowType()); txtChoosePortalVI.setText(d.getTemplateId()); txtQueryTemplateName.setText(d.getQueryTemplateName()); txtExpandColumn.setText(d.getExpandCols()); if("1".equals(d.getExpandMode())){ rbtnExpandModeOne.setSelected(true); } else if("0".equals(d.getExpandMode())){ rbtnExpandModeAll.setSelected(true); } } else if("2".equals(d.getSearchTarger())){ rbtnLinkType.setSelected(true); rbtnLinkType.doClick(); txtBtmTypeTarget.setText(d.getShowType()); txtLinkType.setText(d.getLinkType()); txtChoosePortalVILinkType.setText(d.getTemplateId()); txtQueryTemplateNameLinkType.setText(d.getQueryTemplateName()); txtExpandColumnLinkType.setText(d.getExpandCols()); if("1".equals(d.getExpandMode())){ rbtnExpandModeOneLinkType.setSelected(true); } else if("0".equals(d.getExpandMode())){ rbtnExpandModeAllLinkType.setSelected(true); } } } @Override public PLDefination getNewPLDefination(PLDefination d) { if(d == null){ d = new PLDefination(); } if(rbtnBtmType.isSelected()){ d.setSearchTarger("1"); d.setShowType(txtBtmType.getText().toString()); d.setTemplateId(txtChoosePortalVI.getText().toString()); d.setQueryTemplateName(txtQueryTemplateName.getText().toString()); d.setExpandCols(txtExpandColumn.getText().trim()); if(rbtnExpandModeOne.isSelected()){ d.setExpandMode("1"); } else if(rbtnExpandModeAll.isSelected()){ d.setExpandMode("0"); } } else if(rbtnLinkType.isSelected()){ d.setSearchTarger("2"); d.setShowType(txtBtmTypeTarget.getText().toString()); d.setLinkType(txtLinkType.getText().toString()); d.setTemplateId(txtChoosePortalVILinkType.getText().toString()); d.setQueryTemplateName(txtQueryTemplateNameLinkType.getText().toString()); d.setExpandCols(txtExpandColumnLinkType.getText().trim()); if(rbtnExpandModeOneLinkType.isSelected()){ d.setExpandMode("1"); } else if(rbtnExpandModeAllLinkType.isSelected()){ d.setExpandMode("0"); } } return d; } }