docs: public static void detectAndApply(Widget widget) {
          if (!widget.isAttached()) {
              widget.addAttachHandler(event -> {
                  if (event.isAttached()) {
                      detectAndApply();
                  }
              });
          } else {
              detectAndApply();
          }
      }