code: def _create_rubber_bands_action(self):
          
          icon = resources_path('img', 'icons', 'toggle-rubber-bands.svg')
          self.action_toggle_rubberbands = QAction(
              QIcon(icon),
              self.tr('Toggle Scenario Outlines'), self.iface.mainWindow())
          message = self.tr('Toggle rubber bands showing scenario extents.')
          self.action_toggle_rubberbands.setStatusTip(message)
          self.action_toggle_rubberbands.setWhatsThis(message)
          # Set initial state
          self.action_toggle_rubberbands.setCheckable(True)
          flag = setting('showRubberBands', False, expected_type=bool)
          self.action_toggle_rubberbands.setChecked(flag)
          # noinspection PyUnresolvedReferences
          self.action_toggle_rubberbands.triggered.connect(
              self.dock_widget.toggle_rubber_bands)
          self.add_action(self.action_toggle_rubberbands)
docs: Create action for toggling rubber bands.