public static boolean isSmallVariant(Component c) {
    if (!(c instanceof AbstractButton b)) return false;

    boolean smallVariant = b.getClientProperty("ActionToolbar.smallVariant") == Boolean.TRUE;
    ComboBoxAction a = (ComboBoxAction)b.getClientProperty("styleCombo");

    return smallVariant || a != null && a.isSmallVariant();
  }
public static boolean isSmallVariant(Component c)