package com.vci.client.portal.platformPortal;
|
|
import java.awt.BorderLayout;
|
import java.awt.FlowLayout;
|
|
import javax.swing.ButtonGroup;
|
import javax.swing.DefaultListModel;
|
import javax.swing.JButton;
|
import javax.swing.JDialog;
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
import javax.swing.ListModel;
|
import javax.swing.border.EmptyBorder;
|
import java.awt.GridBagLayout;
|
import javax.swing.JLabel;
|
import java.awt.GridBagConstraints;
|
import javax.swing.JTextField;
|
import java.awt.Insets;
|
import javax.swing.JComboBox;
|
import javax.swing.JRadioButton;
|
import javax.swing.JList;
|
import javax.swing.JTextArea;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.portal.utility.PRM;
|
import com.vci.client.portal.utility.PRMItem;
|
import com.vci.client.portal.utility.UITools;
|
import com.vci.corba.portal.data.PortalVI;
|
|
import java.awt.Dimension;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemListener;
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.Iterator;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.Set;
|
import javax.swing.JCheckBox;
|
import java.awt.Component;
|
|
public class WidgetDialog extends JDialog {
|
|
private final JPanel contentPanel = new JPanel();
|
private JTextField jdFieldTxt;
|
private JTextField jdNameTxt;
|
private JTextField jdVlueTxt;
|
private ButtonGroup bg;
|
private JRadioButton fullDisRadio;
|
private JRadioButton halfDisRadio;
|
private JRadioButton noDisRadio;
|
private JButton okButton;
|
private JButton cancelButton;
|
private JTextField jdValueListName;
|
private JTextField jdValueListVal;
|
private JTextArea jdScriptTxt;
|
private JTextArea jdTipsTxt;
|
private JButton addJdvalueListBtn;
|
private JComboBox jdTypeComBox;
|
// private JComboBox jdListTable;
|
// private JComboBox jdListTxt;
|
// private JComboBox jdListVal;
|
private JTextField jdListTableTxt;
|
private JTextField jdListTxtTxt;
|
private JTextField jdListValTxt;
|
private JPanel panel;
|
private JPanel dynamicPanel;
|
private JPanel sourthPanel ;
|
private String disPlayType = "";
|
private Map<String,String> jdTypeComBoxListMap ;
|
private JButton delbutton;
|
private PortalVI pvi;
|
private PRMItem prmItem;
|
private PRM prm;
|
private String prmText = "";
|
private JPanel dynamicMainPal;
|
private JPanel dynamicSourthPal;
|
private JLabel label_1;
|
private JScrollPane scrollPane_1;
|
private JTextArea jdStyleTxt;
|
private JList jdValuelist;
|
private DefaultListModel jdValuelistModel;
|
private int itemListIndex;
|
private Object selectNodeObject;
|
private JLabel label_2;
|
private JTextArea jdaddfilter;
|
private JCheckBox jdiseditable;
|
private JCheckBox jdisrequired;
|
private JLabel label_3;
|
private JTextField jdctrldisplycond;
|
private JLabel label_4;
|
private JTextField jdctrldisplycol;
|
private JLabel label_5;
|
private JTextField jdcustomclass;
|
private JLabel lblCombobox;
|
private JTextField jdqueryrefields;
|
private JCheckBox jdishttpsave;
|
private JLabel label_6;
|
private JTextField jdhttpvolumnpath;
|
private JLabel label_7;
|
private JTextField jdhttppathfield;
|
public String getPrmText() {
|
return prmText;
|
}
|
public void setPrmText(String prmText) {
|
this.prmText = prmText;
|
}
|
/**
|
* Create the dialog.
|
*/
|
public WidgetDialog(PortalVI pvi,PRMItem prmItem,int index,Object object) {
|
super(LogonApplication.frame, true);
|
this.pvi = pvi;
|
this.prmItem = prmItem;
|
this.itemListIndex = index;
|
this.selectNodeObject = object;
|
setBounds(100, 100, 624, 617);
|
init();
|
initJdTypeComBoxList();
|
actionListener();
|
initData();
|
initDisControl();
|
this.setLocationRelativeTo(null);
|
}
|
private void init() {
|
getContentPane().setLayout(new BorderLayout());
|
{
|
JPanel buttonPane = new JPanel();
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
{
|
okButton = new JButton("保存");
|
buttonPane.add(okButton);
|
}
|
{
|
cancelButton = new JButton("关闭");
|
buttonPane.add(cancelButton);
|
}
|
}
|
{
|
panel = new JPanel();
|
getContentPane().add(panel, BorderLayout.CENTER);
|
panel.setLayout(new BorderLayout(0, 0));
|
panel.add(contentPanel, BorderLayout.NORTH);
|
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
GridBagLayout gbl_contentPanel = new GridBagLayout();
|
gbl_contentPanel.columnWidths = new int[]{76, 0, 0, 0, 0};
|
gbl_contentPanel.rowHeights = new int[]{0, 0, 0, 0, 0, 0};
|
gbl_contentPanel.columnWeights = new double[]{0.0, 1.0, 1.0, 1.0, Double.MIN_VALUE};
|
gbl_contentPanel.rowWeights = new double[]{1.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
|
contentPanel.setLayout(gbl_contentPanel);
|
{
|
JLabel jdField = new JLabel("使用字段");
|
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
|
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
|
gbc_lblNewLabel.gridx = 0;
|
gbc_lblNewLabel.gridy = 0;
|
contentPanel.add(jdField, gbc_lblNewLabel);
|
}
|
{
|
jdFieldTxt = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.insets = new Insets(0, 0, 5, 5);
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 1;
|
gbc_textField.gridy = 0;
|
contentPanel.add(jdFieldTxt, gbc_textField);
|
jdFieldTxt.setColumns(10);
|
}
|
{
|
jdiseditable = new JCheckBox("只读");
|
GridBagConstraints gbc_checkBox = new GridBagConstraints();
|
gbc_checkBox.insets = new Insets(0, 0, 5, 5);
|
gbc_checkBox.gridx = 2;
|
gbc_checkBox.gridy = 0;
|
contentPanel.add(jdiseditable, gbc_checkBox);
|
}
|
{
|
jdisrequired = new JCheckBox("必填");
|
GridBagConstraints gbc_checkBox_1 = new GridBagConstraints();
|
gbc_checkBox_1.anchor = GridBagConstraints.WEST;
|
gbc_checkBox_1.insets = new Insets(0, 0, 5, 0);
|
gbc_checkBox_1.gridx = 3;
|
gbc_checkBox_1.gridy = 0;
|
contentPanel.add(jdisrequired, gbc_checkBox_1);
|
}
|
{
|
JLabel jdName = new JLabel("显示名称");
|
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
|
gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
|
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel.gridx = 0;
|
gbc_lblNewLabel.gridy = 1;
|
contentPanel.add(jdName, gbc_lblNewLabel);
|
}
|
{
|
jdNameTxt = new JTextField();
|
GridBagConstraints gbc_textField_1 = new GridBagConstraints();
|
gbc_textField_1.insets = new Insets(0, 0, 5, 5);
|
gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField_1.gridx = 1;
|
gbc_textField_1.gridy = 1;
|
contentPanel.add(jdNameTxt, gbc_textField_1);
|
jdNameTxt.setColumns(10);
|
}
|
{
|
JLabel jdType = new JLabel("显示类型");
|
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
|
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel.gridx = 2;
|
gbc_lblNewLabel.gridy = 1;
|
contentPanel.add(jdType, gbc_lblNewLabel);
|
}
|
{
|
jdTypeComBox = 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 = 1;
|
contentPanel.add(jdTypeComBox, gbc_comboBox);
|
}
|
{
|
JLabel jdVlue = new JLabel("默认值");
|
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
|
gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
|
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel.gridx = 0;
|
gbc_lblNewLabel.gridy = 2;
|
contentPanel.add(jdVlue, gbc_lblNewLabel);
|
}
|
{
|
jdVlueTxt = new JTextField();
|
GridBagConstraints gbc_textField_2 = new GridBagConstraints();
|
gbc_textField_2.insets = new Insets(0, 0, 5, 5);
|
gbc_textField_2.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField_2.gridx = 1;
|
gbc_textField_2.gridy = 2;
|
contentPanel.add(jdVlueTxt, gbc_textField_2);
|
jdVlueTxt.setToolTipText("默认值表达式支持\"源对象属性\"、\"内置系统变量\"、\"内置系统函数\"与\"自定义类\",格式如:\"${description}_#CURRENTUSER.NAME#_#CURRENTDATETIME#_!com.vci.ui.form.defaultvalue.InitRevVer!\"");
|
jdVlueTxt.setColumns(10);
|
}
|
{
|
JLabel jdCols = new JLabel("占位方式");
|
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
|
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel.gridx = 2;
|
gbc_lblNewLabel.gridy = 2;
|
contentPanel.add(jdCols, gbc_lblNewLabel);
|
}
|
{
|
JPanel panel_1 = new JPanel();
|
FlowLayout fl_panel_1 = (FlowLayout) panel_1.getLayout();
|
fl_panel_1.setAlignment(FlowLayout.LEFT);
|
GridBagConstraints gbc_panel_1 = new GridBagConstraints();
|
gbc_panel_1.insets = new Insets(0, 0, 5, 0);
|
gbc_panel_1.fill = GridBagConstraints.BOTH;
|
gbc_panel_1.gridx = 3;
|
gbc_panel_1.gridy = 2;
|
contentPanel.add(panel_1, gbc_panel_1);
|
{
|
bg = new ButtonGroup();
|
fullDisRadio = new JRadioButton("整行显示");
|
panel_1.add(fullDisRadio);
|
halfDisRadio = new JRadioButton("半行显示");
|
panel_1.add(halfDisRadio);
|
noDisRadio = new JRadioButton("不显示");
|
panel_1.add(noDisRadio);
|
bg.add(fullDisRadio);
|
bg.add(halfDisRadio);
|
bg.add(noDisRadio);
|
}
|
}
|
{
|
label_2 = new JLabel("字段表达式");
|
GridBagConstraints gbc_label_2 = new GridBagConstraints();
|
gbc_label_2.anchor = GridBagConstraints.EAST;
|
gbc_label_2.insets = new Insets(0, 0, 5, 5);
|
gbc_label_2.gridx = 0;
|
gbc_label_2.gridy = 3;
|
contentPanel.add(label_2, gbc_label_2);
|
}
|
{
|
JScrollPane scrollPane = new JScrollPane();
|
jdaddfilter = new JTextArea();
|
scrollPane.getViewport().add(jdaddfilter);
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.insets = new Insets(0, 0, 5, 0);
|
gbc_textField.gridwidth = 3;
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 1;
|
gbc_textField.gridy = 3;
|
contentPanel.add(scrollPane, gbc_textField);
|
jdaddfilter.setColumns(10);
|
}
|
{
|
label_4 = new JLabel("控制列");
|
GridBagConstraints gbc_label_4 = new GridBagConstraints();
|
gbc_label_4.insets = new Insets(0, 0, 0, 5);
|
gbc_label_4.gridx = 0;
|
gbc_label_4.gridy = 4;
|
contentPanel.add(label_4, gbc_label_4);
|
}
|
{
|
jdctrldisplycol = new JTextField();
|
GridBagConstraints gbc_textField_1 = new GridBagConstraints();
|
gbc_textField_1.insets = new Insets(0, 0, 0, 5);
|
gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField_1.gridx = 1;
|
gbc_textField_1.gridy = 4;
|
contentPanel.add(jdctrldisplycol, gbc_textField_1);
|
jdctrldisplycol.setColumns(10);
|
}
|
{
|
label_3 = new JLabel("显示列条件");
|
GridBagConstraints gbc_label_3 = new GridBagConstraints();
|
gbc_label_3.insets = new Insets(0, 0, 0, 5);
|
gbc_label_3.gridx = 2;
|
gbc_label_3.gridy = 4;
|
contentPanel.add(label_3, gbc_label_3);
|
}
|
{
|
jdctrldisplycond = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 3;
|
gbc_textField.gridy = 4;
|
contentPanel.add(jdctrldisplycond, gbc_textField);
|
jdctrldisplycond.setColumns(10);
|
}
|
{
|
sourthPanel = new JPanel();
|
panel.add(sourthPanel, BorderLayout.CENTER);
|
GridBagLayout gbl_panel_1 = new GridBagLayout();
|
gbl_panel_1.columnWidths = new int[]{76, 0, 0, 0, 0, 0};
|
gbl_panel_1.rowHeights = new int[]{42, 26, 0, 0, 0, 0};
|
gbl_panel_1.columnWeights = new double[]{0.0, 1.0, 1.0, 1.0, 1.0, Double.MIN_VALUE};
|
gbl_panel_1.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
sourthPanel.setLayout(gbl_panel_1);
|
{
|
JLabel jdScript = new JLabel("脚本验证");
|
GridBagConstraints gbc_lblNewLabel_5 = new GridBagConstraints();
|
gbc_lblNewLabel_5.fill = GridBagConstraints.VERTICAL;
|
gbc_lblNewLabel_5.insets = new Insets(0, 0, 5, 5);
|
gbc_lblNewLabel_5.gridx = 0;
|
gbc_lblNewLabel_5.gridy = 0;
|
sourthPanel.add(jdScript, gbc_lblNewLabel_5);
|
}
|
{
|
JScrollPane scrollPane = new JScrollPane();
|
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
gbc_scrollPane.gridwidth = 4;
|
gbc_scrollPane.insets = new Insets(0, 0, 5, 0);
|
gbc_scrollPane.fill = GridBagConstraints.BOTH;
|
gbc_scrollPane.gridx = 1;
|
gbc_scrollPane.gridy = 0;
|
sourthPanel.add(scrollPane, gbc_scrollPane);
|
{
|
jdScriptTxt = new JTextArea();
|
scrollPane.setViewportView(jdScriptTxt);
|
}
|
}
|
{
|
JLabel jdTips = new JLabel("提示文字");
|
GridBagConstraints gbc_lblF = new GridBagConstraints();
|
gbc_lblF.insets = new Insets(0, 0, 5, 5);
|
gbc_lblF.gridx = 0;
|
gbc_lblF.gridy = 1;
|
sourthPanel.add(jdTips, gbc_lblF);
|
}
|
{
|
JScrollPane scrollPane = new JScrollPane();
|
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
gbc_scrollPane.insets = new Insets(0, 0, 5, 0);
|
gbc_scrollPane.gridwidth = 4;
|
gbc_scrollPane.fill = GridBagConstraints.HORIZONTAL;
|
gbc_scrollPane.gridx = 1;
|
gbc_scrollPane.gridy = 1;
|
sourthPanel.add(scrollPane, gbc_scrollPane);
|
{
|
jdTipsTxt = new JTextArea();
|
scrollPane.setViewportView(jdTipsTxt);
|
}
|
}
|
{
|
lblCombobox = new JLabel("查询关联列");
|
GridBagConstraints gbc_lblCombobox = new GridBagConstraints();
|
gbc_lblCombobox.insets = new Insets(0, 0, 5, 5);
|
gbc_lblCombobox.gridx = 0;
|
gbc_lblCombobox.gridy = 2;
|
sourthPanel.add(lblCombobox, gbc_lblCombobox);
|
}
|
{
|
jdqueryrefields = new JTextField();
|
GridBagConstraints gbc_textField_1 = new GridBagConstraints();
|
gbc_textField_1.gridwidth = 4;
|
gbc_textField_1.insets = new Insets(0, 0, 5, 0);
|
gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField_1.gridx = 1;
|
gbc_textField_1.gridy = 2;
|
sourthPanel.add(jdqueryrefields, gbc_textField_1);
|
jdqueryrefields.setColumns(10);
|
}
|
{
|
label_5 = new JLabel("自定义类");
|
GridBagConstraints gbc_label_5 = new GridBagConstraints();
|
gbc_label_5.insets = new Insets(0, 0, 5, 5);
|
gbc_label_5.gridx = 0;
|
gbc_label_5.gridy = 3;
|
sourthPanel.add(label_5, gbc_label_5);
|
}
|
{
|
jdcustomclass = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.insets = new Insets(0, 0, 5, 0);
|
gbc_textField.gridwidth = 4;
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 1;
|
gbc_textField.gridy = 3;
|
sourthPanel.add(jdcustomclass, gbc_textField);
|
jdcustomclass.setColumns(10);
|
}
|
{
|
jdishttpsave = new JCheckBox("http存储");
|
GridBagConstraints gbc_chckbxHttp = new GridBagConstraints();
|
gbc_chckbxHttp.insets = new Insets(0, 0, 0, 5);
|
gbc_chckbxHttp.gridx = 0;
|
gbc_chckbxHttp.gridy = 4;
|
sourthPanel.add(jdishttpsave, gbc_chckbxHttp);
|
}
|
{
|
label_6 = new JLabel("存储路径");
|
GridBagConstraints gbc_label_6 = new GridBagConstraints();
|
gbc_label_6.insets = new Insets(0, 0, 0, 5);
|
gbc_label_6.gridx = 1;
|
gbc_label_6.gridy = 4;
|
sourthPanel.add(label_6, gbc_label_6);
|
}
|
{
|
jdhttpvolumnpath = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.insets = new Insets(0, 0, 0, 5);
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 2;
|
gbc_textField.gridy = 4;
|
sourthPanel.add(jdhttpvolumnpath, gbc_textField);
|
jdhttpvolumnpath.setColumns(10);
|
}
|
{
|
label_7 = new JLabel("存储路径字段");
|
GridBagConstraints gbc_label_7 = new GridBagConstraints();
|
gbc_label_7.insets = new Insets(0, 0, 0, 5);
|
gbc_label_7.gridx = 3;
|
gbc_label_7.gridy = 4;
|
sourthPanel.add(label_7, gbc_label_7);
|
}
|
{
|
jdhttppathfield = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 4;
|
gbc_textField.gridy = 4;
|
sourthPanel.add(jdhttppathfield, gbc_textField);
|
jdhttppathfield.setColumns(10);
|
}
|
}
|
{
|
dynamicMainPal = new JPanel();
|
dynamicMainPal.setPreferredSize(new Dimension(10, 200));
|
panel.add(dynamicMainPal, BorderLayout.SOUTH);
|
dynamicMainPal.setLayout(new BorderLayout(0, 0));
|
{
|
dynamicPanel = new JPanel();
|
dynamicMainPal.add(dynamicPanel, BorderLayout.CENTER);
|
GridBagLayout gbl_dynamicPanel = new GridBagLayout();
|
gbl_dynamicPanel.columnWidths = new int[]{76, 64, 0, 68, 37, 76, 0, 0, 0, 0, 0, 0, 0};
|
gbl_dynamicPanel.rowHeights = new int[]{0, 34, 34, 0};
|
gbl_dynamicPanel.columnWeights = new double[]{0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
|
gbl_dynamicPanel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
|
dynamicPanel.setLayout(gbl_dynamicPanel);
|
{
|
JLabel 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;
|
dynamicPanel.add(label, gbc_label);
|
}
|
{
|
jdValueListName = new JTextField();
|
GridBagConstraints gbc_textField = new GridBagConstraints();
|
gbc_textField.gridwidth = 2;
|
gbc_textField.insets = new Insets(0, 0, 5, 5);
|
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField.gridx = 2;
|
gbc_textField.gridy = 0;
|
dynamicPanel.add(jdValueListName, gbc_textField);
|
jdValueListName.setColumns(10);
|
}
|
{
|
JLabel label = new JLabel("值");
|
GridBagConstraints gbc_label = new GridBagConstraints();
|
gbc_label.insets = new Insets(0, 0, 5, 5);
|
gbc_label.gridx = 4;
|
gbc_label.gridy = 0;
|
dynamicPanel.add(label, gbc_label);
|
}
|
{
|
jdValueListVal = new JTextField();
|
GridBagConstraints gbc_textField_1 = new GridBagConstraints();
|
gbc_textField_1.insets = new Insets(0, 0, 5, 5);
|
gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
|
gbc_textField_1.gridx = 5;
|
gbc_textField_1.gridy = 0;
|
dynamicPanel.add(jdValueListVal, gbc_textField_1);
|
jdValueListVal.setColumns(10);
|
}
|
{
|
addJdvalueListBtn = new JButton("添加");
|
GridBagConstraints gbc_button = new GridBagConstraints();
|
gbc_button.insets = new Insets(0, 0, 5, 5);
|
gbc_button.gridx = 6;
|
gbc_button.gridy = 0;
|
dynamicPanel.add(addJdvalueListBtn, gbc_button);
|
}
|
{
|
JLabel label = new JLabel("一级参照");
|
GridBagConstraints gbc_label = new GridBagConstraints();
|
gbc_label.insets = new Insets(0, 0, 5, 5);
|
gbc_label.gridx = 7;
|
gbc_label.gridy = 0;
|
dynamicPanel.add(label, gbc_label);
|
}
|
{
|
// jdListTable = new JComboBox();
|
jdListTableTxt = new JTextField();
|
GridBagConstraints gbc_comboBox = new GridBagConstraints();
|
gbc_comboBox.gridwidth = 4;
|
gbc_comboBox.insets = new Insets(0, 0, 5, 0);
|
gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
|
gbc_comboBox.gridx = 8;
|
gbc_comboBox.gridy = 0;
|
// dynamicPanel.add(jdListTable, gbc_comboBox);
|
dynamicPanel.add(jdListTableTxt, gbc_comboBox);
|
}
|
{
|
JLabel label = new JLabel("选项列表");
|
GridBagConstraints gbc_label = new GridBagConstraints();
|
gbc_label.insets = new Insets(0, 0, 5, 5);
|
gbc_label.gridx = 0;
|
gbc_label.gridy = 1;
|
dynamicPanel.add(label, gbc_label);
|
}
|
JScrollPane scrollPane = new JScrollPane();
|
scrollPane.setPreferredSize(new Dimension(2, 14));
|
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
gbc_scrollPane.gridheight = 2;
|
gbc_scrollPane.gridwidth = 5;
|
gbc_scrollPane.insets = new Insets(0, 0, 0, 5);
|
gbc_scrollPane.fill = GridBagConstraints.BOTH;
|
gbc_scrollPane.gridx = 1;
|
gbc_scrollPane.gridy = 1;
|
dynamicPanel.add(scrollPane, gbc_scrollPane);
|
jdValuelistModel= new DefaultListModel();
|
jdValuelist = new JList(jdValuelistModel);
|
scrollPane.setViewportView(jdValuelist);
|
{
|
delbutton = new JButton("删除");
|
GridBagConstraints gbc_button = new GridBagConstraints();
|
gbc_button.insets = new Insets(0, 0, 5, 5);
|
gbc_button.gridx = 6;
|
gbc_button.gridy = 1;
|
dynamicPanel.add(delbutton, gbc_button);
|
}
|
{
|
JLabel label = new JLabel("二级参照");
|
GridBagConstraints gbc_label = new GridBagConstraints();
|
gbc_label.insets = new Insets(0, 0, 5, 5);
|
gbc_label.gridx = 7;
|
gbc_label.gridy = 1;
|
dynamicPanel.add(label, gbc_label);
|
}
|
{
|
// jdListTxt = new JComboBox();
|
jdListTxtTxt = new JTextField();
|
GridBagConstraints gbc_comboBox = new GridBagConstraints();
|
gbc_comboBox.gridwidth = 4;
|
gbc_comboBox.insets = new Insets(0, 0, 5, 0);
|
gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
|
gbc_comboBox.gridx = 8;
|
gbc_comboBox.gridy = 1;
|
// dynamicPanel.add(jdListTxt, gbc_comboBox);
|
dynamicPanel.add(jdListTxtTxt, gbc_comboBox);
|
}
|
{
|
JLabel label = new JLabel("参照值");
|
GridBagConstraints gbc_label = new GridBagConstraints();
|
gbc_label.insets = new Insets(0, 0, 0, 5);
|
gbc_label.gridx = 7;
|
gbc_label.gridy = 2;
|
dynamicPanel.add(label, gbc_label);
|
}
|
{
|
// jdListVal = new JComboBox();
|
jdListValTxt = new JTextField();
|
GridBagConstraints gbc_comboBox = new GridBagConstraints();
|
gbc_comboBox.gridwidth = 4;
|
gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
|
gbc_comboBox.gridx = 8;
|
gbc_comboBox.gridy = 2;
|
// dynamicPanel.add(jdListVal, gbc_comboBox);
|
dynamicPanel.add(jdListValTxt, gbc_comboBox);
|
}
|
}
|
{
|
dynamicSourthPal = new JPanel();
|
dynamicSourthPal.setPreferredSize(new Dimension(10, 90));
|
dynamicMainPal.add(dynamicSourthPal, BorderLayout.SOUTH);
|
GridBagLayout gbl_dynamicSourthPal = new GridBagLayout();
|
gbl_dynamicSourthPal.columnWidths = new int[]{84, 538, 0};
|
gbl_dynamicSourthPal.rowHeights = new int[]{25, 0};
|
gbl_dynamicSourthPal.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
|
gbl_dynamicSourthPal.rowWeights = new double[]{1.0, Double.MIN_VALUE};
|
dynamicSourthPal.setLayout(gbl_dynamicSourthPal);
|
{
|
label_1 = new JLabel("附加属性");
|
label_1.setPreferredSize(new Dimension(70, 15));
|
label_1.setAlignmentX(Component.CENTER_ALIGNMENT);
|
GridBagConstraints gbc_label_1 = new GridBagConstraints();
|
gbc_label_1.fill = GridBagConstraints.VERTICAL;
|
gbc_label_1.insets = new Insets(0, 0, 0, 5);
|
gbc_label_1.gridx = 0;
|
gbc_label_1.gridy = 0;
|
dynamicSourthPal.add(label_1, gbc_label_1);
|
}
|
{
|
scrollPane_1 = new JScrollPane();
|
scrollPane_1.setPreferredSize(new Dimension(2, 25));
|
scrollPane_1.setSize(new Dimension(35, 20));
|
GridBagConstraints gbc_scrollPane_1 = new GridBagConstraints();
|
gbc_scrollPane_1.fill = GridBagConstraints.BOTH;
|
gbc_scrollPane_1.gridx = 1;
|
gbc_scrollPane_1.gridy = 0;
|
dynamicSourthPal.add(scrollPane_1, gbc_scrollPane_1);
|
{
|
jdStyleTxt = new JTextArea();
|
scrollPane_1.setViewportView(jdStyleTxt);
|
}
|
}
|
}
|
}
|
}
|
}
|
|
private void actionListener(){
|
jdishttpsave.addActionListener(new ActionListener() {
|
|
@Override
|
public void actionPerformed(ActionEvent arg0) {
|
initDisControl();
|
}
|
});
|
addJdvalueListBtn.addActionListener(new ActionListener() {
|
|
@Override
|
public void actionPerformed(ActionEvent arg0) {
|
String result = jdValueListName.getText().trim()+"{"+jdValueListVal.getText().trim()+"}";
|
jdValuelistModel.addElement(result);
|
}
|
});
|
delbutton.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent arg0) {
|
String selectedValue = (String) jdValuelist.getSelectedValue();
|
jdValuelistModel.removeElement(selectedValue);
|
}
|
});
|
|
jdTypeComBox.addItemListener(new ItemListener() {
|
|
@Override
|
public void itemStateChanged(ItemEvent arg0) {
|
jdValuelistModel.removeAllElements();
|
jdValueListName.setText("");
|
jdValueListVal.setText("");
|
jdStyleTxt.setText("");
|
jdListTableTxt.setText("");
|
jdListTxtTxt.setText("");
|
jdListValTxt.setText("");
|
|
String value = getTypeCobValue();
|
dynamicMainPal.remove(dynamicPanel);
|
dynamicMainPal.remove(dynamicSourthPal);
|
panel.remove(sourthPanel);
|
if(value.equals("radio")||value.equals("checkbox")){
|
panel.add(dynamicMainPal,BorderLayout.SOUTH);
|
dynamicMainPal.add(dynamicPanel,BorderLayout.CENTER);
|
panel.add(sourthPanel,BorderLayout.CENTER);
|
}else if(value.equals("select")){
|
panel.add(dynamicMainPal,BorderLayout.SOUTH);
|
dynamicMainPal.add(dynamicPanel,BorderLayout.CENTER);
|
dynamicMainPal.add(dynamicSourthPal,BorderLayout.SOUTH);
|
panel.add(sourthPanel,BorderLayout.CENTER);
|
}else if(value.equals("webeditor")||value.equals("hidden")){
|
panel.remove(dynamicMainPal);
|
panel.add(sourthPanel,BorderLayout.CENTER);
|
}else{
|
panel.add(dynamicMainPal,BorderLayout.SOUTH);
|
dynamicMainPal.add(dynamicSourthPal,BorderLayout.CENTER);
|
panel.add(sourthPanel,BorderLayout.CENTER);
|
}
|
panel.updateUI();
|
}
|
|
});
|
okButton.addActionListener(new ActionListener() {
|
|
@Override
|
public void actionPerformed(ActionEvent arg0) {
|
if(prmItem == null){
|
prmItem = new PRMItem();
|
}
|
prm = UITools.getPRM(pvi.prm);
|
prmItem.setItemField(jdFieldTxt.getText().trim());
|
prmItem.setItemName(jdNameTxt.getText().trim());
|
prmItem.setItemType(getTypeCobValue());
|
prmItem.setItemValue(jdVlueTxt.getText().trim());
|
if(fullDisRadio.isSelected()){
|
prmItem.setItemCols("1");
|
}else if(halfDisRadio.isSelected()){
|
prmItem.setItemCols("2");
|
}else if(noDisRadio.isSelected()){
|
prmItem.setItemCols("0");
|
}
|
|
List<String> list = getValueList();
|
prmItem.setItemValueList(list);
|
|
prmItem.setItemStyle(jdStyleTxt.getText().trim());
|
prmItem.setItemScript(jdScriptTxt.getText().trim());
|
prmItem.setItemTips(jdTipsTxt.getText().trim());
|
|
if(jdiseditable.isSelected()){
|
prmItem.setItemIsEditable("1");
|
}else{
|
prmItem.setItemIsEditable("0");
|
}
|
if(jdisrequired.isSelected()){
|
prmItem.setItemIsRequired("1");
|
}else{
|
prmItem.setItemIsRequired("0");
|
}
|
prmItem.setItemCtrlDisplyCol(jdctrldisplycol.getText().trim());
|
prmItem.setItemCtrlDisplyCondition(jdctrldisplycond.getText().trim());
|
prmItem.setItemQueryRefFields(jdqueryrefields.getText().trim());
|
prmItem.setItemCustomClass(jdcustomclass.getText().trim());
|
prmItem.setItemListTable(jdListTableTxt.getText().trim());
|
prmItem.setItemListTxt(jdListTxtTxt.getText().trim());
|
prmItem.setItemListVal(jdListValTxt.getText().trim());
|
|
if(jdishttpsave.isSelected()){
|
prmItem.setItemIsHttpSave("1");
|
prmItem.setItemHttpVolumnPath(jdhttpvolumnpath.getText().trim());
|
prmItem.setItemHttpPathField(jdhttppathfield.getText().trim());
|
}else{
|
prmItem.setItemIsHttpSave("0");
|
prmItem.setItemHttpVolumnPath("");
|
prmItem.setItemHttpPathField("");
|
}
|
|
|
prmItem.setItemAddFilter(jdaddfilter.getText());
|
List<PRMItem> prmItemList = new ArrayList<PRMItem>();
|
if(prm!=null){
|
prmItemList = prm.getPrmItemList();
|
}else{
|
prm = new PRM();
|
}
|
List<PRMItem> res = new ArrayList<PRMItem>();
|
if(itemListIndex!=-1){
|
// prmItemList.remove(itemListIndex);
|
for(int i=0;i<prmItemList.size();i++){
|
if(i!=itemListIndex){
|
res.add(i, prmItemList.get(i));
|
}else{
|
res.add(i,prmItem);
|
}
|
}
|
prmItemList = res;
|
}else{
|
prmItemList.add(prmItem);
|
}
|
prm.setPrmItemList(prmItemList);
|
|
try {
|
prmText = UITools.getPRMText(prm);
|
} catch (Throwable e) {
|
e.printStackTrace();
|
}
|
dispose();
|
}
|
|
|
});
|
cancelButton.addActionListener(new ActionListener() {
|
|
@Override
|
public void actionPerformed(ActionEvent paramActionEvent) {
|
try {
|
prm = UITools.getPRM(pvi.prm);
|
prmText = UITools.getPRMText(prm);
|
} catch (Throwable e) {
|
e.printStackTrace();
|
}
|
dispose();
|
}
|
});
|
}
|
private List<String> getValueList() {
|
List<String> list = new ArrayList<String>();
|
for(int i=0;i<jdValuelistModel.getSize();i++){
|
String elementAt = (String) jdValuelistModel.getElementAt(i);
|
list.add(elementAt);
|
}
|
return list;
|
}
|
private String getTypeCobValue() {
|
String selectedItem = (String) jdTypeComBox.getSelectedItem();
|
Set<String> keySet = jdTypeComBoxListMap.keySet();
|
Iterator<String> iterator = keySet.iterator();
|
String value = "";
|
while(iterator.hasNext()){
|
value = iterator.next();
|
if(selectedItem== null){
|
return "";
|
}
|
if(selectedItem.equals(jdTypeComBoxListMap.get(value))){
|
break;
|
}
|
}
|
return value;
|
}
|
/**
|
* "单行文本框","文本按钮框","多行文本框","富文本框","数字输入框", "密码框","单选按钮","多选按钮","下拉菜单","Web编辑器",
|
* "日期输入框","时间输入框","日期时间输入框","隐藏或普通文字","自定义表单","文件上传","多文件上传"
|
* "自定义"
|
* "text","textbtn","textarea","number","password","radio","checkbox","select","webeditor",
|
* "date", "time", "datetime", "hidden","customform","file","multiFile","custom"
|
*/
|
private void initJdTypeComBoxList(){
|
jdTypeComBoxListMap = new HashMap<String,String>();
|
jdTypeComBoxListMap.put("text", "单行文本框");
|
jdTypeComBoxListMap.put("textbtn", "文本按钮框");
|
jdTypeComBoxListMap.put("textarea", "多行文本框");
|
jdTypeComBoxListMap.put("richtext", "富文本框");
|
jdTypeComBoxListMap.put("number", "数字输入框");
|
jdTypeComBoxListMap.put("password", "密码框");
|
jdTypeComBoxListMap.put("radio", "单选按钮");
|
jdTypeComBoxListMap.put("checkbox", "多选按钮");
|
jdTypeComBoxListMap.put("select", "下拉菜单");
|
jdTypeComBoxListMap.put("webeditor", "Web编辑器");
|
jdTypeComBoxListMap.put("date", "日期输入框");
|
jdTypeComBoxListMap.put("time", "时间输入框");
|
jdTypeComBoxListMap.put("datetime", "日期时间输入框");
|
jdTypeComBoxListMap.put("hidden", "隐藏或普通文字");
|
jdTypeComBoxListMap.put("customform", "自定义表单");
|
jdTypeComBoxListMap.put("file", "文件上传");
|
jdTypeComBoxListMap.put("multiFile", "多文件上传");
|
jdTypeComBoxListMap.put("custom", "自定义");
|
jdTypeComBox.addItem("");
|
Set<String> keySet = jdTypeComBoxListMap.keySet();
|
Iterator<String> iterator = keySet.iterator();
|
while(iterator.hasNext()){
|
String next = iterator.next();
|
jdTypeComBox.addItem(jdTypeComBoxListMap.get(next));
|
}
|
}
|
|
private void initjdListTable(){
|
// if(selectNodeObject instanceof BtmItemWrapper){
|
// ((BtmItemWrapper)selectNodeObject).btmItem.;
|
// }else if(selectNodeObject instanceof LinkTypeWrapper){
|
// ((LinkTypeWrapper)selectNodeObject).o.name;
|
// }
|
// jdListTable.addItem("");
|
}
|
private void initData(){
|
if(prmItem == null){
|
return;
|
}
|
jdFieldTxt.setText(prmItem.getItemField());
|
jdNameTxt.setText(prmItem.getItemName());
|
jdTypeComBox.setSelectedItem(jdTypeComBoxListMap.get(prmItem.getItemType()));
|
jdVlueTxt.setText(prmItem.getItemValue());
|
if(prmItem.getItemCols()!=null&&prmItem.getItemCols().equals("1")){
|
fullDisRadio.setSelected(true);
|
}else if(prmItem.getItemCols()!=null&&prmItem.getItemCols().equals("2") ){
|
halfDisRadio.setSelected(true);
|
}else if(prmItem.getItemCols()!=null&&prmItem.getItemCols().equals("0") ){
|
noDisRadio.setSelected(true);
|
}
|
for(int j =0;j<prmItem.getItemValueList().size();j++){
|
String string = prmItem.getItemValueList().get(j);
|
jdValuelistModel.addElement(string);
|
}
|
jdStyleTxt.setText(prmItem.getItemStyle());
|
jdScriptTxt.setText(prmItem.getItemScript());
|
jdTipsTxt.setText(prmItem.getItemTips());
|
if("1".equals(prmItem.getItemIsEditable())){
|
jdiseditable.setSelected(true);
|
}
|
if("1".equals(prmItem.getItemIsRequired())){
|
jdisrequired.setSelected(true);
|
}
|
jdctrldisplycol.setText(prmItem.getItemCtrlDisplyCol());
|
jdctrldisplycond.setText(prmItem.getItemCtrlDisplyCondition());
|
jdqueryrefields.setText(prmItem.getItemQueryRefFields());
|
jdcustomclass.setText(prmItem.getItemCustomClass());
|
|
jdListTableTxt.setText(prmItem.getItemListTable());
|
jdListTxtTxt.setText(prmItem.getItemListTxt());
|
jdListValTxt.setText(prmItem.getItemListVal());
|
|
|
if("1".equals(prmItem.getItemIsHttpSave())){
|
jdishttpsave.setSelected(true);
|
}
|
jdhttpvolumnpath.setText(prmItem.getItemHttpVolumnPath());
|
jdhttppathfield.setText(prmItem.getItemHttpPathField());
|
jdaddfilter.setText(prmItem.getItemAddFilter());
|
}
|
|
private void initDisControl(){
|
if(jdishttpsave.isSelected()){
|
jdhttpvolumnpath.setEnabled(true);
|
jdhttppathfield.setEnabled(true);
|
}else{
|
jdhttpvolumnpath.setEnabled(false);
|
jdhttppathfield.setEnabled(false);
|
}
|
}
|
}
|