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();
|
}
|
}
|
}
|