|
|
|
@ -70,8 +70,8 @@ public class ITTableEditorPane<T> extends BasicPane {
|
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
int row = ((JTable) e.getSource()).rowAtPoint(e.getPoint()); |
|
|
|
|
int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint()); |
|
|
|
|
if (col == 0) { |
|
|
|
|
ITContent content = (ITContent) editTable.getValueAt(row, 6); |
|
|
|
|
if (col == ITReplaceSouthPanel.CHECKBOX_INDEX) { |
|
|
|
|
ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); |
|
|
|
|
if (content.isSelected()) { |
|
|
|
|
content.setSelected(false); |
|
|
|
|
editTable.setValueAt(content.isSelected(), row, col); |
|
|
|
@ -116,7 +116,7 @@ public class ITTableEditorPane<T> extends BasicPane {
|
|
|
|
|
if (e.getClickCount() > 0) { |
|
|
|
|
//获得选中列
|
|
|
|
|
int selectColumn = tableHeader.columnAtPoint(e.getPoint()); |
|
|
|
|
if (selectColumn == 0) { |
|
|
|
|
if (selectColumn == ITReplaceSouthPanel.CHECKBOX_INDEX) { |
|
|
|
|
boolean value = !selectBox.isSelected(); |
|
|
|
|
selectBox.setSelected(value); |
|
|
|
|
selectAllOrNull(value); |
|
|
|
@ -152,7 +152,7 @@ public class ITTableEditorPane<T> extends BasicPane {
|
|
|
|
|
label.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
selectBox.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
|
selectBox.setBorderPainted(true); |
|
|
|
|
JComponent component = (column == 0) ? selectBox : label; |
|
|
|
|
JComponent component = (column == ITReplaceSouthPanel.CHECKBOX_INDEX) ? selectBox : label; |
|
|
|
|
component.setForeground(tableHeader.getForeground()); |
|
|
|
|
component.setBackground(tableHeader.getBackground()); |
|
|
|
|
component.setFont(tableHeader.getFont()); |
|
|
|
@ -187,7 +187,7 @@ public class ITTableEditorPane<T> extends BasicPane {
|
|
|
|
|
*/ |
|
|
|
|
public static void selectAllOrNull(Boolean value) { |
|
|
|
|
for (int i = 0; i < getEditTable().getRowCount(); i++) { |
|
|
|
|
((ITContent) (getEditTable().getValueAt(i, 6))).setSelected(value); |
|
|
|
|
((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|