diff --git a/core/src/test/java/ui/ComponentDemo.java b/core/src/test/java/ui/ComponentDemo.java index 59ed04a9..1a82ef4e 100644 --- a/core/src/test/java/ui/ComponentDemo.java +++ b/core/src/test/java/ui/ComponentDemo.java @@ -65,6 +65,7 @@ public interface ComponentDemo { new IntelliJTheme(), new SolarizedLightTheme(), new SolarizedDarkTheme(), + new HighContrastLightTheme(), new HighContrastDarkTheme()}) { createThemeItem(currentThemeName, menu, bg, theme); } diff --git a/core/src/test/java/ui/button/ToggleButtonDemo.java b/core/src/test/java/ui/button/ToggleButtonDemo.java index 1e742a59..0a2640db 100644 --- a/core/src/test/java/ui/button/ToggleButtonDemo.java +++ b/core/src/test/java/ui/button/ToggleButtonDemo.java @@ -25,6 +25,7 @@ package ui.button; import com.github.weisj.darklaf.icons.IconLoader; import com.github.weisj.darklaf.ui.togglebutton.DarkToggleButtonUI; +import com.github.weisj.darklaf.ui.togglebutton.ToggleButtonConstants; import ui.ComponentDemo; import ui.DemoPanel; @@ -67,18 +68,12 @@ public class ToggleButtonDemo implements ComponentDemo { }}, "span"); controlPanel = panel.addControls(); - controlPanel.add(new JLabel("JToggleButton.variant:")); + controlPanel.add(new JLabel(ToggleButtonConstants.KEY_VARIANT + ":")); controlPanel.add(new JComboBox() {{ - addItem("slider"); + addItem(ToggleButtonConstants.VARIANT_SLIDER); addItem("none"); - setSelectedItem("no JToggleButton.variant"); - addItemListener(e -> { - if (e.getItem().equals("slider")) { - button.putClientProperty("JToggleButton.variant", "slider"); - } else { - button.putClientProperty("JToggleButton.variant", null); - } - }); + setSelectedItem("none"); + addItemListener(e -> button.putClientProperty("JToggleButton.variant", e.getItem())); }}); return panel; } diff --git a/core/src/test/java/ui/tabFrame/TabFrameDemo.java b/core/src/test/java/ui/tabFrame/TabFrameDemo.java index 92f51a4a..1b692452 100644 --- a/core/src/test/java/ui/tabFrame/TabFrameDemo.java +++ b/core/src/test/java/ui/tabFrame/TabFrameDemo.java @@ -93,6 +93,7 @@ public class TabFrameDemo implements ComponentDemo { }}, Alignment.NORTH, 1); */ tabFrame.setAcceleratorAt(1, Alignment.NORTH_WEST, 0); + tabFrame.setTabEnabled(Alignment.NORTH_EAST, 0, false); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(tabFrame, BorderLayout.CENTER); diff --git a/core/src/test/java/ui/table/TableDemo.java b/core/src/test/java/ui/table/TableDemo.java index 4824f2ac..fad0f036 100644 --- a/core/src/test/java/ui/table/TableDemo.java +++ b/core/src/test/java/ui/table/TableDemo.java @@ -24,6 +24,7 @@ package ui.table; import com.github.weisj.darklaf.ui.table.DarkTableCellEditor; +import com.github.weisj.darklaf.ui.table.DarkTableUI; import com.github.weisj.darklaf.util.PropertyKey; import ui.ComponentDemo; import ui.DemoPanel; @@ -96,6 +97,10 @@ public class TableDemo implements ComponentDemo { addActionListener(e -> table.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT)); }}); + controlPanel.add(new JCheckBox(DarkTableUI.KEY_ALTERNATE_ROW_COLOR) {{ + setSelected(Boolean.TRUE.equals(table.getClientProperty(DarkTableUI.KEY_ALTERNATE_ROW_COLOR))); + addActionListener(e -> table.putClientProperty(DarkTableUI.KEY_ALTERNATE_ROW_COLOR, isSelected())); + }}); controlPanel.add(new JCheckBox("reordering") {{ setSelected(header.getReorderingAllowed()); addActionListener(e -> header.setReorderingAllowed(isSelected())); @@ -114,6 +119,18 @@ public class TableDemo implements ComponentDemo { addActionListener(e -> table.setRowSelectionAllowed(isSelected())); table.addPropertyChangeListener(e -> setSelected(table.getRowSelectionAllowed())); }}); + controlPanel.add(new JCheckBox(DarkTableUI.KEY_RENDER_BOOLEAN_AS_CHECKBOX) {{ + setSelected(Boolean.TRUE.equals(table.getClientProperty(DarkTableUI.KEY_RENDER_BOOLEAN_AS_CHECKBOX))); + addActionListener(e -> table.putClientProperty(DarkTableUI.KEY_RENDER_BOOLEAN_AS_CHECKBOX, isSelected())); + }}, "span"); + controlPanel.add(new JLabel(DarkTableUI.KEY_BOOLEAN_RENDER_TYPE + ":", JLabel.RIGHT)); + controlPanel.add(new JComboBox() {{ + addItem(DarkTableUI.RENDER_TYPE_CHECKBOX); + addItem(DarkTableUI.RENDER_TYPE_RADIOBUTTON); + setSelectedItem(table.getClientProperty(DarkTableUI.KEY_BOOLEAN_RENDER_TYPE)); + addItemListener(e -> table.putClientProperty(DarkTableUI.KEY_BOOLEAN_RENDER_TYPE, e.getItem())); + }}); + controlPanel = panel.addControls(3); controlPanel.add(new JLabel("Row height:")); controlPanel.add(new JSpinner() {{