yuxc
2025-01-15 c09f81131e8b7c83937206d7cf76f34d2020be75
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package com.vci.client.workflow.editor.ui;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
 
import com.vci.client.workflow.delegate.EventConfClientDelegate;
import com.vci.corba.common.VCIError;
 
/**
 * 任务描述
 * @author liudi
 *
 * 2012-7-12
 */
public class TaskDescPanel extends JPanel {
    private static final long serialVersionUID = 1300418480939892949L;
    
    private JLabel taskDesLab ;
    private JTextArea taskDesArea;
    
    private JLabel urlLb ;
    private JTextArea urlTextArea;
    
    public JTextArea getUrlTextArea() {
        return urlTextArea;
    }
 
    public void setUrlTextArea(String value) {
        urlTextArea.setText(value);
    }
 
    public String getTaskDesArea() {
        return taskDesArea.getText();
    }
 
    public void setTaskDesArea(String value) {
        taskDesArea.setText(value);
    }
 
    public TaskDescPanel() throws VCIError {
        initUI();
    }
 
    private void initUI() throws VCIError {
        setLayout(new BorderLayout());
        JPanel northPanel = new JPanel();
        urlLb =  new JLabel("功能:");
        urlLb.setPreferredSize(new Dimension(100,25));
        northPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
        urlTextArea = new JTextArea();
        urlTextArea.setLineWrap(true);
        urlTextArea.setEditable(false);
        JScrollPane urlJsp = new JScrollPane();
        urlJsp.getViewport().add(urlTextArea);
        urlJsp.setPreferredSize(new Dimension(800,50));
        northPanel.add(urlLb);
        northPanel.add(urlJsp);
        
        JPanel centerPanel = new JPanel();
        centerPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
        taskDesLab = new JLabel("功能描述:");
        taskDesLab.setPreferredSize(new Dimension(100,25));
        taskDesArea = new JTextArea();
        taskDesArea.setLineWrap(true);
        JScrollPane jsp = new JScrollPane();
        jsp.getViewport().add(taskDesArea);
        jsp.setPreferredSize(new Dimension(800,50));
        centerPanel.add(taskDesLab);
        centerPanel.add(jsp);
        
        //edit start by lmh2015-12-11
        /*final String urlDialogControl = EventProperties.getStringProperty("workflow.business.function.class");*/
        //add by caill start 2016.4.8 通过corba连接服务端
        final String urlDialogControl = new EventConfClientDelegate().getStringProperty("workflow.business.function.class");
        //add by caill end
        //final String urlDialogControl = CommonProperties.getStringProperty("workflow.urlDialog");
        if(urlDialogControl!=null && !"".equals(urlDialogControl)) {
            JButton addBtn = new JButton("维护");
            addBtn.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent actionEvent) {
                    selectUrlDialog(urlDialogControl);
                }
            });
            northPanel.add(addBtn);
        }
        add(northPanel,BorderLayout.NORTH);
        add(centerPanel,BorderLayout.CENTER);
    }
    
    private void selectUrlDialog(final String urlDialogControl) {
        try {
            Class<?> cls = Class.forName(urlDialogControl);
            try {
                Object obj = cls.newInstance();
                cls.getDeclaredMethod("init", JPanel.class).invoke(obj, this);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}