📄 materialeditui.java
字号:
package com.cownew.PIS.basedata.client;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import com.cownew.PIS.basedata.common.IMaterialDAO;
import com.cownew.PIS.basedata.common.IMeasureUnitGroupDAO;
import com.cownew.PIS.basedata.common.ISupplierDAO;
import com.cownew.PIS.basedata.common.MaterialInfoValidator;
import com.cownew.PIS.framework.client.ClientMetaDataLoaderFactory;
import com.cownew.PIS.framework.common.IValueObject;
import com.cownew.PIS.framework.common.db.Selectors;
import com.cownew.PIS.ui.commonUI.EditUI;
import com.cownew.PIS.ui.ctrl.prompt.OVPicker.PopupValueObjectPicker;
public class MaterialEditUI extends EditUI
{
private JLabel jLabel;
private JTextField txtNumber;
private JLabel jLabel1;
private JTextField txtName;
private JLabel jLabel2;
private JLabel jLabel3;
private JLabel jLabel4;
private JLabel jLabel5 ;
private JTextField txtType ;
private PopupValueObjectPicker popSupplier;
private PopupValueObjectPicker popMeasureUnitGroup;
private JScrollPane jScrollPane;
private JTextArea txtDesc;
public MaterialEditUI() throws Exception
{
super();
}
protected void initDataBind()
{
super.initDataBind();
dataBinder.registerBind(txtName, "name");
dataBinder.registerBind(txtNumber, "number");
dataBinder.registerBind(popSupplier, "supplier");
dataBinder.registerBind(popMeasureUnitGroup, "measureUnitGroup");
dataBinder.registerBind(txtType, "type");
dataBinder.registerBind(txtDesc, "description");
}
protected void verifyBeforeSubmit(IValueObject vo) throws Exception
{
super.verifyBeforeSubmit(vo);
MaterialInfoValidator validator = new MaterialInfoValidator(
ClientMetaDataLoaderFactory.getLoader(), getRemoteService());
validator.validate(vo);
}
protected void initialize()
{
super.initialize();
jLabel5 = new JLabel();
jLabel5.setText("备注");
jLabel5.setLocation(new Point(10, 100));
jLabel5.setSize(new Dimension(31, 16));
jLabel4 = new JLabel();
jLabel4.setText("计量单位组");
jLabel4.setLocation(new Point(10, 70));
jLabel4.setSize(new Dimension(71, 16));
jLabel3 = new JLabel();
jLabel3.setBounds(new Rectangle(237, 40, 31, 16));
jLabel3.setText("型号");
jLabel2 = new JLabel();
jLabel2.setText("供应商");
jLabel2.setLocation(new Point(10, 40));
jLabel2.setSize(new Dimension(72, 16));
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(237, 10, 31, 16));
jLabel1.setText("名称");
jLabel = new JLabel();
jLabel.setText("编码");
jLabel.setLocation(new Point(10, 10));
jLabel.setSize(new Dimension(72, 16));
this.setLayout(null);
this.setSize(new Dimension(418, 176));
this.add(jLabel, null);
this.add(getTxtNumber(), null);
this.add(jLabel1, null);
this.add(getTxtName(), null);
this.add(jLabel2, null);
this.add(jLabel3, null);
this.add(jLabel4, null);
this.add(jLabel5, null);
this.add(getTxtType(), null);
this.add(getPopSupplier(), null);
this.add(getPopMeasureUnitGroup(), null);
this.add(getJScrollPane(), null);
this.add(getTxtNumber(), null);
}
public Selectors getSelectors()
{
Selectors selector = super.getSelectors();
selector.add("supplier");
selector.add("measureUnitGroup");
return selector;
}
public Class getServiceIntfClass()
{
return IMaterialDAO.class;
}
/**
* This method initializes txtNumber
*
* @return javax.swing.JTextField
*/
private JTextField getTxtNumber()
{
if (txtNumber == null)
{
txtNumber = new JTextField();
txtNumber.setSize(new Dimension(111, 20));
txtNumber.setPreferredSize(new Dimension(111, 20));
txtNumber.setLocation(new Point(100, 10));
}
return txtNumber;
}
/**
* This method initializes txtName
*
* @return javax.swing.JTextField
*/
private JTextField getTxtName()
{
if (txtName == null)
{
txtName = new JTextField();
txtName.setPreferredSize(new Dimension(111, 20));
txtName.setSize(new Dimension(111, 20));
txtName.setLocation(new Point(277, 10));
}
return txtName;
}
/**
* This method initializes txtType
*
* @return javax.swing.JTextField
*/
private JTextField getTxtType()
{
if (txtType == null)
{
txtType = new JTextField();
txtType.setBounds(new Rectangle(277, 40, 111, 21));
}
return txtType;
}
/**
* This method initializes popSupplier
*
* @return com.cownew.PIS.ui.ctrl.prompt.OVPicker.PopupValueObjectPicker
*/
private PopupValueObjectPicker getPopSupplier()
{
if (popSupplier == null)
{
popSupplier = new PopupValueObjectPicker(ISupplierDAO.class);
popSupplier.setBounds(new Rectangle(100, 40, 111, 20));
popSupplier.setDisplayProperty("name");
}
return popSupplier;
}
/**
* This method initializes popMeausreUnitGroup
*
* @return com.cownew.PIS.ui.ctrl.prompt.OVPicker.PopupValueObjectPicker
*/
private PopupValueObjectPicker getPopMeasureUnitGroup()
{
if (popMeasureUnitGroup == null)
{
popMeasureUnitGroup = new PopupValueObjectPicker(IMeasureUnitGroupDAO.class);
popMeasureUnitGroup.setBounds(new Rectangle(100, 70, 111, 20));
popMeasureUnitGroup.setDisplayProperty("name");
}
return popMeasureUnitGroup;
}
/**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPane()
{
if (jScrollPane == null)
{
jScrollPane = new JScrollPane();
jScrollPane.setBounds(new Rectangle(101, 97, 287, 67));
jScrollPane.setViewportView(getTxtDesc());
}
return jScrollPane;
}
/**
* This method initializes txtDesc
*
* @return javax.swing.JTextArea
*/
private JTextArea getTxtDesc()
{
if (txtDesc == null)
{
txtDesc = new JTextArea();
txtDesc.setLineWrap(true);
txtDesc.setWrapStyleWord(true);
}
return txtDesc;
}
} // @jve:decl-index=0:visual-constraint="10,10"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -