code: public ElementBase getRoot() {
          ElementBase root = this;
          
          while (root.getParent() != null) {
              root = root.getParent();
          }
          
          return root;
      }
docs: Returns the UI element at the root of the component tree.
  
  @return Root UI element.