/** * */ package com.vci.client.logon.client; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import com.vci.client.ui.exception.VCIException; import com.vci.client.ui.swing.VCIOptionPane; import com.vci.client.ui.swing.VCISwingUtil; import com.vci.client.ui.swing.components.VCIJButton; import com.vci.client.ui.swing.components.VCIJFrame; import com.vci.client.ui.swing.components.VCIJLabel; import com.vci.client.ui.swing.components.VCIJPanel; import com.vci.client.ui.swing.components.VCIJScrollPane; import com.vci.client.ui.swing.components.VCIJTextArea; import com.vci.client.workflow.delegate.ProcessCustomClientDelegate; /** * 查看申请成功的代码,以便进行‘已阅知’ *

Title:

*

Description:

*

Copyright: Copyright (c) 2012

*

Company: VCI

* @author xchao * @time 2013-5-20 * @version 1.0 */ public class ViewCodeFrame extends VCIJFrame implements ActionListener { /** * */ private static final long serialVersionUID = 5313552457943357727L; private String codes = ""; private String title = "查看申请的代码"; private VCIJLabel lblCode = new VCIJLabel("代码列表:"); private VCIJTextArea txtCode = new VCIJTextArea(); private VCIJButton btnViewed = VCISwingUtil.createVCIJButton("viewed", "已阅知", "已阅知", "accept.png", this); private VCIJButton btnClose = VCISwingUtil.createVCIJButton("close", "关闭", "关闭", "cancel.png", this); public ViewCodeFrame(String codes){ this.codes = codes; init(); } private void init(){ initComponents(); initContents(); initLocationAndSize(); } private void initComponents(){ txtCode.setBorder(null); txtCode.setLineWrap(true); txtCode.setWrapStyleWord(true); txtCode.setEditable(false); VCIJScrollPane jspCode = new VCIJScrollPane(txtCode); VCIJPanel palBtns = new VCIJPanel(); palBtns.add(btnViewed); palBtns.add(btnClose); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 1.0, 0.1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 5, 5); gbc.gridx = 0; gbc.gridy = 0; add(lblCode, gbc); gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 1.0; gbc.weighty = 10.0; add(jspCode, gbc); gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 2; add(palBtns, gbc); } private void initContents(){ setTitle(title); txtCode.setText(codes.replace(",", "\n")); } private void initLocationAndSize(){ setDefaultCloseOperation(VCIJFrame.EXIT_ON_CLOSE); setSize(600, 500); setLocationRelativeTo(null); } @Override public void actionPerformed(ActionEvent e) { String actionCommand = e.getActionCommand(); if("viewed".equals(actionCommand)){ viewed(); } else if("close".equals(actionCommand)){ close(); } } private void viewed(){ if(!"".equals(this.codes)){ ProcessCustomClientDelegate del = new ProcessCustomClientDelegate(null); try{ del.searchComplateTask(new String[]{ codes, "IRMS", "" }); VCIOptionPane.showMessage(this, "已阅知成功"); this.close(); }catch (VCIException e) { e.printStackTrace(); VCIOptionPane.showMessage(this, "已阅知的过程中发生错误!"); } } } private void close(){ setVisible(false); dispose(); System.exit(0); } }