|
|
|
@ -374,10 +374,8 @@ public abstract class JListControlPane extends JControlPane implements ListContr
|
|
|
|
|
this.iconLabel.setBorder(new ScaledEmptyBorder(0, 4, 0, 0)); |
|
|
|
|
add(this.textLabel, BorderLayout.CENTER); |
|
|
|
|
add(this.iconLabel, BorderLayout.WEST); |
|
|
|
|
this.iconLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); |
|
|
|
|
//iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义
|
|
|
|
|
this.textLabel.setOpaque(true); |
|
|
|
|
this.iconLabel.setOpaque(true); |
|
|
|
|
this.textLabel.setOpaque(false); |
|
|
|
|
this.iconLabel.setOpaque(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -390,9 +388,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr
|
|
|
|
|
this.textLabel.setText(nameable.getName()); |
|
|
|
|
boolean iconSet = false; |
|
|
|
|
if(isSelected) { |
|
|
|
|
this.textLabel.setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); |
|
|
|
|
setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); |
|
|
|
|
} else { |
|
|
|
|
this.textLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); |
|
|
|
|
setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); |
|
|
|
|
} |
|
|
|
|
for (NameableCreator creator : JListControlPane.this.creators()) { |
|
|
|
|
if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) { |
|
|
|
|