Compare commits
No commits in common. '8142db5be04015f4ebd2ffa6fcaa5b2db70a1431' and '9806e11b62db3730232b0c46f15604bf113fa39f' have entirely different histories.
8142db5be0
...
9806e11b62
@ -1,103 +0,0 @@
|
|||||||
package com.chint.plm.createEcn;
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.FlowLayout;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JTextArea;
|
|
||||||
|
|
||||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
|
||||||
|
|
||||||
import javafx.scene.control.TableView;
|
|
||||||
/**
|
|
||||||
* 功能描述: 长文本内容弹窗查看编辑
|
|
||||||
* 创建日期:2024-12-02
|
|
||||||
* @author 李冬阳
|
|
||||||
*
|
|
||||||
* 修改日期 修改人 修改描述
|
|
||||||
* 2024-12-02 李冬阳 新增
|
|
||||||
*/
|
|
||||||
public class EditTextDialog extends AbstractAIFDialog {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private JTextArea textArea;
|
|
||||||
private JButton okBtn;
|
|
||||||
private JButton cancelBtn;
|
|
||||||
private TableView<EcnBean> refTable;
|
|
||||||
private List<EcnBean> refTableBeans;
|
|
||||||
private int row;
|
|
||||||
private boolean before;
|
|
||||||
|
|
||||||
public EditTextDialog(CreateEcnFrame parent, TableView<EcnBean> refTable, int row, List<EcnBean> refTableBeans,
|
|
||||||
boolean before, boolean edit) {
|
|
||||||
super(parent, true);
|
|
||||||
|
|
||||||
this.refTable = refTable;
|
|
||||||
this.refTableBeans = refTableBeans;
|
|
||||||
this.row = row;
|
|
||||||
this.before = before;
|
|
||||||
|
|
||||||
initUI(edit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initUI(boolean edit) {
|
|
||||||
|
|
||||||
textArea = new JTextArea();
|
|
||||||
textArea.setWrapStyleWord(true);
|
|
||||||
textArea.setEditable(edit);
|
|
||||||
|
|
||||||
JPanel panel = new JPanel(new FlowLayout());
|
|
||||||
okBtn = new JButton("确定");
|
|
||||||
cancelBtn = new JButton("取消");
|
|
||||||
panel.add(okBtn);
|
|
||||||
panel.add(cancelBtn);
|
|
||||||
|
|
||||||
okBtn.setEnabled(edit);
|
|
||||||
|
|
||||||
addActionListener();
|
|
||||||
|
|
||||||
this.setLayout(new BorderLayout());
|
|
||||||
this.add(BorderLayout.CENTER, new JScrollPane(textArea));
|
|
||||||
this.add(BorderLayout.SOUTH, panel);
|
|
||||||
this.setPreferredSize(new Dimension(1400, 400));
|
|
||||||
Dimension screen = getToolkit().getScreenSize();
|
|
||||||
setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2);
|
|
||||||
setAlwaysOnTop(true);
|
|
||||||
this.setAlwaysOnTop(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run(){
|
|
||||||
showDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addActionListener() {
|
|
||||||
//final Shell dialog = shell;
|
|
||||||
okBtn.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
|
||||||
if(before) {
|
|
||||||
refTableBeans.get(EditTextDialog.this.row).getOverChange().setText(textArea.getText());
|
|
||||||
}else {
|
|
||||||
refTableBeans.get(EditTextDialog.this.row).getAfterChange().setText(textArea.getText());
|
|
||||||
}
|
|
||||||
refTable.refresh();
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
cancelBtn.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue