|
|
@ -5,6 +5,7 @@ import java.awt.Dimension;
|
|
|
|
import java.awt.Toolkit;
|
|
|
|
import java.awt.Toolkit;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter;
|
|
|
|
import java.awt.event.MouseEvent;
|
|
|
|
import java.awt.event.MouseEvent;
|
|
|
|
import java.awt.event.MouseListener;
|
|
|
|
import java.awt.event.MouseListener;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
@ -45,6 +46,8 @@ import javax.swing.JTable;
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
import javax.swing.ListSelectionModel;
|
|
|
|
import javax.swing.ListSelectionModel;
|
|
|
|
import javax.swing.RowSorter;
|
|
|
|
import javax.swing.RowSorter;
|
|
|
|
|
|
|
|
import javax.swing.event.TableModelEvent;
|
|
|
|
|
|
|
|
import javax.swing.event.TableModelListener;
|
|
|
|
import javax.swing.table.DefaultTableModel;
|
|
|
|
import javax.swing.table.DefaultTableModel;
|
|
|
|
import javax.swing.table.TableColumnModel;
|
|
|
|
import javax.swing.table.TableColumnModel;
|
|
|
|
import javax.swing.table.TableModel;
|
|
|
|
import javax.swing.table.TableModel;
|
|
|
@ -64,6 +67,7 @@ import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValues;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValues;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValuesType;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValuesType;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentProject;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentProject;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentUser;
|
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
|
import com.teamcenter.rac.kernel.TCProperty;
|
|
|
|
import com.teamcenter.rac.kernel.TCProperty;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
@ -72,6 +76,8 @@ import com.teamcenter.rac.util.MessageBox;
|
|
|
|
import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
import com.teamcenter.soa.client.model.LovValue;
|
|
|
|
import com.teamcenter.soa.client.model.LovValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import k.util.KOrgDialog;
|
|
|
|
|
|
|
|
|
|
|
|
public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
|
|
|
|
private Map<String, JTextField> textMap = new HashMap<>();
|
|
|
|
private Map<String, JTextField> textMap = new HashMap<>();
|
|
|
@ -100,7 +106,7 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
private String objectString;
|
|
|
|
private String objectString;
|
|
|
|
private boolean readOnly;
|
|
|
|
private boolean readOnly;
|
|
|
|
private ArrayList<Integer> canWriteColume = new ArrayList<Integer>();
|
|
|
|
private ArrayList<Integer> canWriteColume = new ArrayList<Integer>();
|
|
|
|
|
|
|
|
private ArrayList<Integer> choosePersonColume = new ArrayList<Integer>();
|
|
|
|
public RWFPDialog(TCSession session, String type, String id, String objectString, boolean readOnly) {
|
|
|
|
public RWFPDialog(TCSession session, String type, String id, String objectString, boolean readOnly) {
|
|
|
|
// TODO Auto-generated constructor stub
|
|
|
|
// TODO Auto-generated constructor stub
|
|
|
|
this.session = session;
|
|
|
|
this.session = session;
|
|
|
@ -164,6 +170,11 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
String[] split4 = split3[2].split("%");
|
|
|
|
String[] split4 = split3[2].split("%");
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
canWriteColume.add(j);
|
|
|
|
canWriteColume.add(j);
|
|
|
|
|
|
|
|
}else if(split3[2].contains("#")) {
|
|
|
|
|
|
|
|
String[] split4 = split3[2].split("#");
|
|
|
|
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
|
|
|
|
choosePersonColume.add(j);
|
|
|
|
|
|
|
|
canWriteColume.add(j);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
widtheMap.put(j, Integer.parseInt(split3[2]));
|
|
|
|
widtheMap.put(j, Integer.parseInt(split3[2]));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -176,6 +187,11 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
System.out.println("split4[0]========"+split4[0]);
|
|
|
|
System.out.println("split4[0]========"+split4[0]);
|
|
|
|
canWriteColume.add(j);
|
|
|
|
canWriteColume.add(j);
|
|
|
|
|
|
|
|
}else if(split3[2].contains("#")) {
|
|
|
|
|
|
|
|
String[] split4 = split3[2].split("#");
|
|
|
|
|
|
|
|
widtheMap.put(j, Integer.parseInt(split4[0]));
|
|
|
|
|
|
|
|
choosePersonColume.add(j);
|
|
|
|
|
|
|
|
canWriteColume.add(j);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
widtheMap.put(j, Integer.parseInt(split3[2]));
|
|
|
|
widtheMap.put(j, Integer.parseInt(split3[2]));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -186,7 +202,7 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("choosePersonColume====="+choosePersonColume.size());
|
|
|
|
System.out.println("canWriteColume====="+canWriteColume.size());
|
|
|
|
System.out.println("canWriteColume====="+canWriteColume.size());
|
|
|
|
System.out.println("fieldsMap====="+fieldsMap);
|
|
|
|
System.out.println("fieldsMap====="+fieldsMap);
|
|
|
|
System.out.println("positionMap====="+lovPositionMap);
|
|
|
|
System.out.println("positionMap====="+lovPositionMap);
|
|
|
@ -257,7 +273,7 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
while (result.next()) {
|
|
|
|
while (result.next()) {
|
|
|
|
ArrayList<String> arList = new ArrayList<String>();
|
|
|
|
ArrayList<String> arList = new ArrayList<String>();
|
|
|
|
for (int i = 0; i < fieldsMap.size(); i++) {
|
|
|
|
for (int i = 0; i < fieldsMap.size(); i++) {
|
|
|
|
System.out.println("result.getString(i+1)==========="+result.getString(i+1));
|
|
|
|
//System.out.println("result.getString(i+1)==========="+result.getString(i+1));
|
|
|
|
arList.add(result.getString(i+1) == null? result.getString(i+1) : validateAndFormatDate(result.getString(i+1)));
|
|
|
|
arList.add(result.getString(i+1) == null? result.getString(i+1) : validateAndFormatDate(result.getString(i+1)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dtm1.addRow(arList.toArray(new Object[0]));
|
|
|
|
dtm1.addRow(arList.toArray(new Object[0]));
|
|
|
@ -343,6 +359,28 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
table.getColumnModel().getColumn(map.getKey()).setCellEditor(new DefaultCellEditor(jComboBox));
|
|
|
|
table.getColumnModel().getColumn(map.getKey()).setCellEditor(new DefaultCellEditor(jComboBox));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table.addMouseListener(new MouseAdapter() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
|
|
|
if (e.getClickCount() == 2 || e.getClickCount() == 1) { // 判断是否双击并且是在第二列
|
|
|
|
|
|
|
|
int row = table.rowAtPoint(e.getPoint());
|
|
|
|
|
|
|
|
int column = table.columnAtPoint(e.getPoint());
|
|
|
|
|
|
|
|
System.out.println("column========"+column);
|
|
|
|
|
|
|
|
if (choosePersonColume.contains(column)) {
|
|
|
|
|
|
|
|
System.out.println("1111111111111111111111111111111");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
TCComponentUser user = new KOrgDialog("").getUser();
|
|
|
|
|
|
|
|
System.out.println("user============"+user.getUserName());
|
|
|
|
|
|
|
|
//table.setValueAt(user.getUserName()+"("+user.getUserId()+")", row, column);
|
|
|
|
|
|
|
|
} catch (TCException e1) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
pane.setPreferredSize(new Dimension(1800, 850));
|
|
|
|
pane.setPreferredSize(new Dimension(1800, 850));
|
|
|
|
pane.setViewportView(table);// ΪscrollPaneÖ¸¶¨ÏÔʾ¶ÔÏóΪtable
|
|
|
|
pane.setViewportView(table);// ΪscrollPaneÖ¸¶¨ÏÔʾ¶ÔÏóΪtable
|
|
|
|
return pane;
|
|
|
|
return pane;
|
|
|
@ -391,7 +429,6 @@ public class RWFPDialog extends JFrame implements ActionListener {
|
|
|
|
if (canWriteColume.size() > 0) {
|
|
|
|
if (canWriteColume.size() > 0) {
|
|
|
|
for (int i = 0; i < canWriteColume.size(); i++) {
|
|
|
|
for (int i = 0; i < canWriteColume.size(); i++) {
|
|
|
|
if (canWriteColume.get(i) == column) {
|
|
|
|
if (canWriteColume.get(i) == column) {
|
|
|
|
System.out.println("row==========" + row);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|