Destiny.Lin
1 year ago
5 changed files with 74 additions and 33 deletions
@ -0,0 +1,35 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import javax.swing.AbstractCellEditor; |
||||
import javax.swing.JTable; |
||||
import javax.swing.table.TableCellEditor; |
||||
import java.awt.*; |
||||
|
||||
import static com.fr.design.mainframe.vcs.ui.AbstractSupportSelectTablePane.DEFAULT_SELECT_TABLE_ROW_COLOR; |
||||
|
||||
/** |
||||
* Vcs的表格Editor |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/20 |
||||
*/ |
||||
public class VcsCellEditor extends AbstractCellEditor implements TableCellEditor { |
||||
|
||||
private final VcsOperatorPane vcsPanel; |
||||
|
||||
public VcsCellEditor(VcsOperatorPane vcsPanel) { |
||||
this.vcsPanel = vcsPanel; |
||||
} |
||||
|
||||
@Override |
||||
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { |
||||
vcsPanel.setBackground(isSelected ? DEFAULT_SELECT_TABLE_ROW_COLOR : Color.WHITE); |
||||
return vcsPanel; |
||||
} |
||||
|
||||
@Override |
||||
public Object getCellEditorValue() { |
||||
return vcsPanel; |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import javax.swing.JTable; |
||||
import javax.swing.table.TableCellRenderer; |
||||
import java.awt.*; |
||||
|
||||
import static com.fr.design.mainframe.vcs.ui.AbstractSupportSelectTablePane.DEFAULT_SELECT_TABLE_ROW_COLOR; |
||||
|
||||
/** |
||||
* Vcs的表格Render |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/20 |
||||
*/ |
||||
public class VcsCellRender implements TableCellRenderer { |
||||
|
||||
private final VcsOperatorPane vcsPanel; |
||||
|
||||
public VcsCellRender(VcsOperatorPane vcsPanel) { |
||||
this.vcsPanel = vcsPanel; |
||||
} |
||||
|
||||
@Override |
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
||||
vcsPanel.setBackground(isSelected ? DEFAULT_SELECT_TABLE_ROW_COLOR : Color.WHITE); |
||||
return vcsPanel; |
||||
} |
||||
} |
Loading…
Reference in new issue