code: def set_widgets(self):
          
          self.extent_dialog = ExtentSelectorDialog(
              self.parent.iface,
              self.parent.iface.mainWindow(),
              extent=self.parent.dock.extent.user_extent,
              crs=self.parent.dock.extent.crs)
          self.extent_dialog.tool.rectangle_created.disconnect(
              self.extent_dialog.stop_capture)
          self.extent_dialog.clear_extent.connect(
              self.parent.dock.extent.clear_user_analysis_extent)
          self.extent_dialog.extent_defined.connect(
              self.parent.dock.define_user_analysis_extent)
          self.extent_dialog.capture_button.clicked.connect(
              self.start_capture_coordinates)
          self.extent_dialog.tool.rectangle_created.connect(
              self.stop_capture_coordinates)
  
          self.extent_dialog.label.setText(tr(
              'Please specify extent of your analysis:'))
  
          if self.swExtent:
              self.swExtent.hide()
  
          self.swExtent = self.extent_dialog.main_stacked_widget
          self.layoutAnalysisExtent.addWidget(self.swExtent)
docs: Set widgets on the Extent tab.