Browse Source

Rename CellEditorToggleButton to CellToggleButton

pull/214/head
weisj 4 years ago
parent
commit
3c576f19a0
  1. 2
      core/src/main/java/com/github/weisj/darklaf/ui/cell/CellToggleButton.java
  2. 8
      core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java
  3. 6
      core/src/main/java/com/github/weisj/darklaf/ui/table/renderer/DarkTableCellEditorToggleButton.java
  4. 2
      core/src/test/java/ui/table/TableDemo.java

2
core/src/main/java/com/github/weisj/darklaf/ui/cell/CellEditorToggleButton.java → core/src/main/java/com/github/weisj/darklaf/ui/cell/CellToggleButton.java

@ -27,4 +27,4 @@ package com.github.weisj.darklaf.ui.cell;
/**
* @author Jannis Weis
*/
public interface CellEditorToggleButton { void setHasFocus(final boolean hasFocus); }
public interface CellToggleButton { void setHasFocus(final boolean hasFocus); }

8
core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java

@ -39,7 +39,7 @@ import com.github.weisj.darklaf.ui.tree.DarkTreeCellRendererDelegate;
/**
* @author Jannis Weis
*/
public class DarkCellRendererToggleButton<T extends JToggleButton & CellEditorToggleButton>
public class DarkCellRendererToggleButton<T extends JToggleButton & CellToggleButton>
implements TableCellRenderer, TreeCellRenderer, SwingConstants {
private final T toggleButton;
@ -86,7 +86,7 @@ public class DarkCellRendererToggleButton<T extends JToggleButton & CellEditorTo
return toggleButton;
}
public static class CellCheckBox extends JCheckBox implements CellRenderer, CellEditorToggleButton {
public static class CellCheckBox extends JCheckBox implements CellRenderer, CellToggleButton {
private boolean hasFocus;
@ -113,7 +113,7 @@ public class DarkCellRendererToggleButton<T extends JToggleButton & CellEditorTo
}
}
public static class CellRadioButton extends JRadioButton implements CellRenderer, CellEditorToggleButton {
public static class CellRadioButton extends JRadioButton implements CellRenderer, CellToggleButton {
private boolean hasFocus;
@ -145,7 +145,7 @@ public class DarkCellRendererToggleButton<T extends JToggleButton & CellEditorTo
}
}
public static class CellTristateButton extends TristateCheckBox implements CellRenderer, CellEditorToggleButton {
public static class CellTristateButton extends TristateCheckBox implements CellRenderer, CellToggleButton {
private boolean hasFocus;

6
core/src/main/java/com/github/weisj/darklaf/ui/table/renderer/DarkTableCellEditorToggleButton.java

@ -30,7 +30,7 @@ import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.TableCellEditor;
import com.github.weisj.darklaf.ui.cell.CellEditorToggleButton;
import com.github.weisj.darklaf.ui.cell.CellToggleButton;
import com.github.weisj.darklaf.ui.table.DarkTableCellBorder;
/**
@ -53,8 +53,8 @@ public class DarkTableCellEditorToggleButton extends AbstractCellEditor implemen
if (value instanceof Boolean) {
toggleButton.setSelected((Boolean) value);
}
if (toggleButton instanceof CellEditorToggleButton) {
((CellEditorToggleButton) toggleButton).setHasFocus(true);
if (toggleButton instanceof CellToggleButton) {
((CellToggleButton) toggleButton).setHasFocus(true);
}
toggleButton.setBorder(editorBorder);
return toggleButton;

2
core/src/test/java/ui/table/TableDemo.java

@ -36,8 +36,6 @@ import ui.DemoPanel;
import com.github.weisj.darklaf.components.OverlayScrollPane;
import com.github.weisj.darklaf.ui.table.DarkTableUI;
import com.github.weisj.darklaf.ui.table.renderer.DarkTableCellEditor;
import com.github.weisj.darklaf.ui.table.renderer.DarkTableCellRenderer;
import com.github.weisj.darklaf.ui.table.renderer.DarkTableCellRendererDelegate;
import com.github.weisj.darklaf.util.PropertyKey;
import com.github.weisj.darklaf.util.PropertyUtil;

Loading…
Cancel
Save