mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Tree: Fixed missing custom closed/opened/leaf icons of a custom DefaultTreeCellRenderer. (issue #653; regression since implementing PR #609 in FlatLaf 3.0)
This commit is contained in:
@@ -439,6 +439,11 @@ public class FlatComponents2Test
|
||||
tree.setCellRenderer( new TestDefaultTreeCellRenderer() );
|
||||
break;
|
||||
|
||||
case "defaultWithIcons":
|
||||
for( JTree tree : trees )
|
||||
tree.setCellRenderer( new TestDefaultWithIconsTreeCellRenderer() );
|
||||
break;
|
||||
|
||||
case "defaultWithIcon":
|
||||
for( JTree tree : trees )
|
||||
tree.setCellRenderer( new TestDefaultWithIconTreeCellRenderer() );
|
||||
@@ -960,6 +965,7 @@ public class FlatComponents2Test
|
||||
treeRendererComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
|
||||
"default",
|
||||
"defaultSubclass",
|
||||
"defaultWithIcons",
|
||||
"defaultWithIcon",
|
||||
"label",
|
||||
"swingxDefault",
|
||||
@@ -1612,6 +1618,18 @@ public class FlatComponents2Test
|
||||
}
|
||||
}
|
||||
|
||||
//---- class TestDefaultWithIconsTreeCellRenderer -------------------------
|
||||
|
||||
private static class TestDefaultWithIconsTreeCellRenderer
|
||||
extends TestDefaultTreeCellRenderer
|
||||
{
|
||||
public TestDefaultWithIconsTreeCellRenderer() {
|
||||
setLeafIcon( UIManager.getIcon( "FileView.floppyDriveIcon" ) );
|
||||
setClosedIcon( UIManager.getIcon( "FileView.hardDriveIcon" ) );
|
||||
setOpenIcon( UIManager.getIcon( "FileView.computerIcon" ) );
|
||||
}
|
||||
}
|
||||
|
||||
//---- class TestDefaultWithIconTreeCellRenderer --------------------------
|
||||
|
||||
private static class TestDefaultWithIconTreeCellRenderer
|
||||
|
||||
@@ -411,6 +411,7 @@ new FormModel {
|
||||
selectedItem: "default"
|
||||
addElement( "default" )
|
||||
addElement( "defaultSubclass" )
|
||||
addElement( "defaultWithIcons" )
|
||||
addElement( "defaultWithIcon" )
|
||||
addElement( "label" )
|
||||
addElement( "swingxDefault" )
|
||||
|
||||
Reference in New Issue
Block a user