leave the component we are on.
 This should be followed by all containers, so that the on_leave action
 of earlier comp can be displayed, such as dimming components selections
345413
def leave_current_component
      begin
        @current_component.on_leave
      rescue FieldValidationException => fve
        alert fve.to_s
      end
      # NOTE this is required, since repaint will just not happen otherwise
      # Some components are erroneously repainting all, after setting this to true so it is 
      # working there. 
      @current_component.repaint_required true
      $log.debug " after on_leave STACKFLOW XXX #{@current_component.focussed}   #{@current_component.name}"
      @current_component.repaint
    end
511416
public void displaySelection(final WComponent selectedComponent) {
		WComponent currentComponent = getCurrentComponent();

		if (selectedComponent == currentComponent) {
			// We are already displaying this component, so nothing to do.
			return;
		}

		// We have a new selection so display it.
		container.removeAll();
		container.add(selectedComponent);
	}
337628
def component_activated(self, component):
        
        component.env = self
        super(Environment, self).component_activated(component)
980454
function() {
      if (process.env.NODE_ENV !== 'production') {
        warning(
          this.__didWarnIsMounted,
          '%s: isMounted is deprecated. Instead, make sure to clean up ' +
            'subscriptions and pending requests in componentWillUnmount to ' +
            'prevent memory leaks.',
          (this.constructor && this.constructor.displayName) ||
            this.name ||
            'Component'
        );
        this.__didWarnIsMounted = true;
      }
      return !!this.__isMounted;
    }
225858
def leave_command_mode(self, append_to_history=False):
        
        self.previewer.restore()

        self.application.layout.focus_last()
        self.application.vi_state.input_mode = InputMode.NAVIGATION

        self.command_buffer.reset(append_to_history=append_to_history)
1041195
def stop(self):
        
        for component in self.components:
            component.close()
            self.log('Stopping component - {}', component.__class__.__name__)

        for controller in self.controllers.values():
            controller.close()
            self.log('Stopping controller - {}', controller.__class__.__name__)

        atexit.unregister(self.stop)
608450
def _leave_event_hide(self):
        
        if (self.hide_timer_on and not self._hide_timer.isActive() and
            # If Enter events always came after Leave events, we wouldn't need
            # this check. But on Mac OS, it sometimes happens the other way
            # around when the tooltip is created.
            self.app.topLevelAt(QCursor.pos()) != self):
            self._hide_timer.start(800, self)
819476
def removeComponent(self, component):
        
        if isinstance(component, int):
            index = component
        else:
            index = self._getComponentIndex(component)
        index = normalizers.normalizeIndex(index)
        if index >= self._len__components():
            raise ValueError("No component located at index %d." % index)
        self._removeComponent(index)
446623
public static void closeWindow(Component component) {

        Window window = getWindow(component);
        if (window != null) {
            window.close();
        }
    }
309234
protected void deactivate(ComponentContext compContext) {
        if (mbeanTracker != null) {
            mbeanTracker.close();
        }
        pipeline.remove(mDelayedMBeanActivator);
    }
1105056
function cleanupAtContainer(container) {
  ReactDOM.unmountComponentAtNode(container)
  if (container.parentNode === document.body) {
    document.body.removeChild(container)
  }
  mountedContainers.delete(container)
}
262191
def leaveEvent(self, event):
        
        super(XDockToolbar, self).leaveEvent(event)
        
        if not self.actionHeld():
            self.setCurrentAction(None)
304790
protected void deactivate(ComponentContext compcontext) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Deactivating " + this);
        }
        INSTANCE.compareAndSet(this, null);
    }
326862
function(container) {
      var index = WireIt.indexOf(container, this.containers);
      if( index != -1 ) {
	  
	container.remove();
	    
        this.containers[index] = null;
        this.containers = WireIt.compact(this.containers);
      
	this.eventRemoveContainer.fire(container);

	this.eventChanged.fire(this);
      }
   }
338319
private void undeployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) {
    for (final ComponentContext<?> component : components) {
      final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size());
      counter.setHandler(new Handler<AsyncResult<Void>>() {
        @Override
        public void handle(AsyncResult<Void> result) {
          if (result.failed()) {
            complete.fail(result.cause());
          } else {
            // Remove the component's context from the cluster.
            data.remove(component.address(), new Handler<AsyncResult<String>>() {
              @Override
              public void handle(AsyncResult<String> result) {
                if (result.failed()) {
                  complete.fail(result.cause());
                } else {
                  complete.succeed();
                }
              }
            });
          }
        }
      });
      undeployInstances(component.instances(), counter);
    }
  }
131950
def close(self):
        
        if self.___closed:
            return

        for ref in self.___subs:
            sub = ref()
            if sub is not None:
                sub.close()

        # Destroy in reverse order as first elements created have more components depending on them
        for call in self.___close_list[::-1]:
            if inspect.iscoroutinefunction(call):
                self.loop.run_until_complete(call())
            else:
                call()

        self.___closed = True
689458
public function endSlot()
    {
        end($this->componentStack);
        $currentSlot = array_pop(
            $this->slotStack[$this->currentComponent()]
        );
        $this->slots[$this->currentComponent()]
        [$currentSlot] = trim(ob_get_clean());
    }