package com.vci.client.portal.UI; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import com.vci.client.LogonApplication; import com.vci.client.omd.provider.BtmProvider; import com.vci.client.portal.utility.PLDefination; import com.vci.client.portal.utility.UITools; import com.vci.client.ui.swing.VCIOptionPane; import com.vci.client.ui.table.VCIBaseTableNode; import com.vci.common.portal.constants.TemplateTypeConstants; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.VCIError; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.GridBagLayout; import javax.swing.JLabel; import java.awt.GridBagConstraints; import javax.swing.JRadioButton; import java.awt.Insets; import javax.swing.JComboBox; import com.vci.corba.omd.btm.BtmItem; import com.vci.corba.portal.data.PLPageDefination; import com.vci.corba.portal.data.PLUILayout; import com.vci.corba.portal.data.PLTabPage; import com.vci.corba.portal.data.PortalVI; public class FormDialog extends JDialog { private final JPanel contentPanel = new JPanel(); private JButton okButton; private JButton cancelButton; private JLabel label; private ButtonGroup bg = new ButtonGroup(); private ButtonGroup bg1 = new ButtonGroup(); private JRadioButton genralRdb; private JLabel label_1; private JRadioButton rootRdb; private JLabel label_2; private JComboBox rootObjCom; private JLabel label_3; private JComboBox rootObjSelectCom; private PLUILayout plpagelayoutdefination; private String plPageDefinationID; private PLDefination pldefination; private JButton delBtn; private JButton button; private String btmName; private static String buttonArea = "form"; public FormDialog(PLUILayout plpagelayoutdefination,String btmName) { super(LogonApplication.frame,true); setTitle("form设计窗口"); this.plpagelayoutdefination = plpagelayoutdefination; this.btmName = btmName; setBounds(100, 100, 450, 300); init(); actionListener(); initRootObjCom(); initData(); this.setLocationRelativeTo(null); this.setVisible(true); } private void init() { getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); GridBagLayout gbl_contentPanel = new GridBagLayout(); gbl_contentPanel.columnWidths = new int[]{0, 0, 0, 0, 0}; gbl_contentPanel.rowHeights = new int[]{0, 0, 0, 0, 0}; gbl_contentPanel.columnWeights = new double[]{0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE}; gbl_contentPanel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; contentPanel.setLayout(gbl_contentPanel); { label = new JLabel("模板类型"); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.insets = new Insets(0, 0, 5, 5); gbc_label.gridx = 1; gbc_label.gridy = 0; contentPanel.add(label, gbc_label); } { genralRdb = new JRadioButton("普通模板"); GridBagConstraints gbc_radioButton = new GridBagConstraints(); gbc_radioButton.insets = new Insets(0, 0, 5, 0); gbc_radioButton.gridx = 3; gbc_radioButton.gridy = 0; contentPanel.add(genralRdb, gbc_radioButton); } { label_1 = new JLabel("搜索类型"); GridBagConstraints gbc_label_1 = new GridBagConstraints(); gbc_label_1.insets = new Insets(0, 0, 5, 5); gbc_label_1.gridx = 1; gbc_label_1.gridy = 1; contentPanel.add(label_1, gbc_label_1); } { rootRdb = new JRadioButton("本对象属性"); GridBagConstraints gbc_radioButton_1 = new GridBagConstraints(); gbc_radioButton_1.insets = new Insets(0, 0, 5, 0); gbc_radioButton_1.gridx = 3; gbc_radioButton_1.gridy = 1; contentPanel.add(rootRdb, gbc_radioButton_1); } genralRdb.setSelected(true); rootRdb.setSelected(true); bg.add(genralRdb); bg1.add(rootRdb); { label_2 = new JLabel("源对象"); GridBagConstraints gbc_label_2 = new GridBagConstraints(); gbc_label_2.insets = new Insets(0, 0, 5, 5); gbc_label_2.gridx = 1; gbc_label_2.gridy = 2; contentPanel.add(label_2, gbc_label_2); } { rootObjCom = new JComboBox(); GridBagConstraints gbc_comboBox = new GridBagConstraints(); gbc_comboBox.insets = new Insets(0, 0, 5, 0); gbc_comboBox.fill = GridBagConstraints.HORIZONTAL; gbc_comboBox.gridx = 3; gbc_comboBox.gridy = 2; contentPanel.add(rootObjCom, gbc_comboBox); } { label_3 = new JLabel("选择模板"); GridBagConstraints gbc_label_3 = new GridBagConstraints(); gbc_label_3.insets = new Insets(0, 0, 0, 5); gbc_label_3.gridx = 1; gbc_label_3.gridy = 3; contentPanel.add(label_3, gbc_label_3); } { rootObjSelectCom = new JComboBox(); GridBagConstraints gbc_comboBox_1 = new GridBagConstraints(); gbc_comboBox_1.fill = GridBagConstraints.HORIZONTAL; gbc_comboBox_1.gridx = 3; gbc_comboBox_1.gridy = 3; contentPanel.add(rootObjSelectCom, gbc_comboBox_1); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { button = new JButton("按钮设计"); buttonPane.add(button); } { delBtn = new JButton("删除"); buttonPane.add(delBtn); } { okButton = new JButton("保存"); buttonPane.add(okButton); } { cancelButton = new JButton("关闭"); buttonPane.add(cancelButton); } } } private void actionListener(){ button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent paramActionEvent) { ButtonDialog dialog = new ButtonDialog(null,plpagelayoutdefination,buttonArea); } }); rootObjCom.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { rootObjSelectCom.removeAllItems(); String selectedItem = (String) rootObjCom.getSelectedItem(); PortalVI[] portalViInfos; try { portalViInfos = UITools.getService().getPortalVIArrayByTypeName(selectedItem); for(int i=0;i