You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
package com.langtech.plm.mpart;
|
|
|
|
import java.awt.Component;
|
|
import java.util.List;
|
|
|
|
import javax.swing.JCheckBox;
|
|
import javax.swing.JRadioButton;
|
|
import javax.swing.JTable;
|
|
import javax.swing.SwingConstants;
|
|
import javax.swing.event.ChangeEvent;
|
|
import javax.swing.event.EventListenerList;
|
|
import javax.swing.table.TableCellRenderer;
|
|
|
|
import com.teamcenter.rac.treetable.JTreeTable;
|
|
|
|
|
|
public class TableCellCheckboxRenderer extends JCheckBox implements
|
|
TableCellRenderer {
|
|
private List<Integer> processRows;
|
|
protected EventListenerList listenerList = new EventListenerList();
|
|
protected ChangeEvent changeEvent = new ChangeEvent(this);
|
|
//private TestTreeTableModel tableModel;
|
|
|
|
public List<Integer> getProcessRows() {
|
|
return processRows;
|
|
}
|
|
|
|
public void setProcessRows(List<Integer> processRows) {
|
|
this.processRows = processRows;
|
|
|
|
}
|
|
public TableCellCheckboxRenderer(final JTable table) {
|
|
}
|
|
public TableCellCheckboxRenderer(final JTreeTable table) {
|
|
}
|
|
|
|
@Override
|
|
public Component getTableCellRendererComponent(JTable table, Object value,
|
|
boolean isSelected, boolean hasFocus, int row, int column) {
|
|
// TODO Auto-generated method stub
|
|
this.setHorizontalAlignment(SwingConstants.CENTER);// ±íÍ·±êÇ©¾çÖÐ
|
|
// this.setBorderPainted(true);
|
|
System.out.println("valuevaluevalue==="+value);
|
|
if(value != null)
|
|
{
|
|
this.setSelected(value.toString().equals("1"));
|
|
}
|
|
else
|
|
{
|
|
this.setSelected(false);
|
|
}
|
|
return this;
|
|
}
|
|
} |