Browse Source

Merge remote-tracking branch 'origin/fbp/master' into fbp/master

fbp/master
Anner 1 month ago
parent
commit
337132bed0
  1. 12
      designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java
  2. 16
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  3. 10
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

12
designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java

@ -84,6 +84,16 @@ public class FineTableHeaderUI extends FlatTableHeaderUI {
setHorizontalAlignment(SwingConstants.LEFT); setHorizontalAlignment(SwingConstants.LEFT);
} }
/**
* 是否选中修改背景
* @param isSelected 被选中
* @param columnClass 列类型
* @return 是否修改
*/
public boolean checkSelected(boolean isSelected, Class columnClass) {
return isSelected && columnClass != Boolean.class;
}
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Class<?> columnClass = table.getColumnClass(0); Class<?> columnClass = table.getColumnClass(0);
@ -95,7 +105,7 @@ public class FineTableHeaderUI extends FlatTableHeaderUI {
border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")), border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")),
UIManager.getBorder("Table.cellNoFocusBorder")); UIManager.getBorder("Table.cellNoFocusBorder"));
} }
if (isSelected && columnClass != Boolean.class) { if (checkSelected(isSelected, columnClass)) {
selectionBackground = UIManager.getColor( "Table.selectionBackground"); selectionBackground = UIManager.getColor( "Table.selectionBackground");
} else { } else {
selectionBackground = UIManager.getColor("Table.background"); selectionBackground = UIManager.getColor("Table.background");

16
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -1220,6 +1220,11 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return this; return this;
} }
@Override
public boolean checkSelected(boolean isSelected, Class columnClass) {
return isSelected;
}
} }
/* /*
@ -1245,6 +1250,11 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return this; return this;
} }
@Override
public boolean checkSelected(boolean isSelected, Class columnClass) {
return isSelected;
}
} }
/** /**
@ -1263,7 +1273,11 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
setSelected((value != null && ((Boolean) value).booleanValue())); setSelected((value != null && ((Boolean) value).booleanValue()));
setUI(getUICheckBoxUI()); setUI(getUICheckBoxUI());
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor"))); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
setBackground(Color.WHITE); if (isSelected) {
setBackground(UIManager.getColor( "Table.selectionBackground"));
} else {
setBackground(UIManager.getColor("Table.background"));
}
return this; return this;
} }
} }

10
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -580,6 +580,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return this; return this;
} }
@Override
public boolean checkSelected(boolean isSelected, Class columnClass) {
return isSelected;
}
} }
private class ColumnRowGroupCellRenderer2 extends FineTableHeaderUI.TableRenderer { private class ColumnRowGroupCellRenderer2 extends FineTableHeaderUI.TableRenderer {
@ -613,6 +618,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return this; return this;
} }
@Override
public boolean checkSelected(boolean isSelected, Class columnClass) {
return isSelected;
}
} }
} }
} }

Loading…
Cancel
Save