Close a specific modal component.

@param component
the modal's component
966598
public static void closeModal(Component component) {
	synchronized (modals) {
	  RootPaneContainer frame = null;
	  Modal modal = null;

	  Iterator<Entry<RootPaneContainer, Modal>> it =
		  modals.entrySet().iterator();
	  while (it.hasNext()) {
		Entry<RootPaneContainer, Modal> entry = it.next();
		modal = entry.getValue();
		frame = entry.getKey();
		if (frame != null && modal != null
			&& modal.components.contains(component)) {
		  break;
		} else {
		  frame = null;
		  modal = null;
		}
	  }
	  if (frame != null && modal != null) {
		modal.close(component);
		if (modal.getSize() == 0) {
		  modals.remove(frame);
		}
	  }
	}
  }
404151
function (item) {
            var ri,
                key = this._getKeyForItem(item),
                list = this.$renderedItems;
            if (key) {
                list = this.$renderedItemsMap[key];
            }
            for (var i = 0; i < list.length; i++) {
                ri = list[i];
                if (key || ri.item === item) {
                    this.$parent.removeChild(ri.component);
                    list.splice(i, 1);
                    ri.component.destroy();
                    return;
                }
            }
        }
1088492
void removeRow() {

        HasComponents parent = CmsRemovableFormRow.this.getParent();
        if (parent instanceof ComponentContainer) {
            ((ComponentContainer)parent).removeComponent(CmsRemovableFormRow.this);
        }
        if (m_remove != null) {
            m_remove.run();
        }
    }
14556
@FFDCIgnore(Exception.class)
    public void deactivate(ComponentContext componentContext) {
        String methodName = "deactivate";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Deactivating the WebContainer bundle");
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posting STOPPED_EVENT");
        }
        Event event = this.eventService.createEvent(WebContainerConstants.STOPPED_EVENT);
        this.eventService.postEvent(event);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posted STOPPED_EVENT");
        }

        this.classLoadingSRRef.deactivate(componentContext);
        this.sessionHelperSRRef.deactivate(componentContext);
        this.cacheManagerSRRef.deactivate(componentContext);
        this.injectionEngineSRRef.deactivate(componentContext);
        this.managedObjectServiceSRRef.deactivate(context);
        this.servletContainerInitializers.deactivate(componentContext);
        this.transferContextServiceRef.deactivate(componentContext);
        this.webMBeanRuntimeServiceRef.deactivate(componentContext);

        // will now purge each host as it becomes redundant rather than all here.
        //this.vhostManager.purge(); // Clear/purge all maps.

        WebContainer.instance.compareAndSet(this, null);
        extensionFactories.clear();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Deactivating the WebContainer bundle: Complete");
        }                
    }
1140667
void remove(JInternalFrame internalFrame)
    {
        Component component = frameToComponent.get(internalFrame);
        container.remove(component);
    }
464817
public void closeEditor() {

        if (m_saveButton != null) {
            if (m_saveButton.isEnabled()) {
                CmsConfirmDialog dialog = new CmsConfirmDialog(
                    org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_DIALOG_RESET_TITLE_0),
                    Messages.get().key(Messages.GUI_CONFIRM_LEAVING_EDITOR_0));
                dialog.setHandler(new I_CmsConfirmDialogHandler() {

                    public void onClose() {

                        cancelEdit();
                    }

                    public void onOk() {

                        saveAndExit();
                    }
                });
                dialog.center();
            } else {
                cancelEdit();
            }
        }
    }
1055924
public void removeFromAccordion(JComponent component) 
    {
        CollapsiblePanel collapsiblePanel = collapsiblePanels.get(component);
        if (collapsiblePanel != null)
        {
            contentPanel.remove(collapsiblePanel);
            collapsiblePanels.remove(component);
            revalidate();
        }
    }
446623
public static void closeWindow(Component component) {

        Window window = getWindow(component);
        if (window != null) {
            window.close();
        }
    }
1203462
private void closeCurrent() {
	if (components.size() > 0) {
	  Component component = components.remove(components.size() - 1);
	  getModalPanel().removeAll();
	  fireCloseActionListener(listeners.get(component));
	  listeners.remove(component);

	  if (components.size() > 0) {
		showNextComponent();
	  } else {
		restoreRootPane();
	  }
	}
  }
517674
function destroyComponent(instance) {
            if (util.isFn(instance.destroy) && !instance._destroyed) {
                instance.destroy();
                instance._destroyed = true;
            }
        }
14910
public void close() {
        if (animation != null) {
            animation.setRate(-1);
            animation.play();
            animation.setOnFinished(e -> {
                closeDialog();
            });
        } else {
            setOpacity(0);
            setVisible(false);
            closeDialog();
        }

    }
959051
function disposeSubscription(component) {
  if (defined(component.__observeModelChangeSubscriptions)) {
    for (
      let i = 0;
      i < component.__observeModelChangeSubscriptions.length;
      ++i
    ) {
      component.__observeModelChangeSubscriptions[i].dispose();
    }
    component.__observeModelChangeSubscriptions = undefined;
  }
}
972936
protected void close() {

        if (m_dialog != null) {
            m_dialog.hide();
            m_dialog = null;
            m_editorHandler.onClose(m_editableData.getSitePath(), m_editableData.getStructureId(), m_isNew, false);
            m_editorHandler = null;
        }
        if (m_form != null) {
            m_form.removeFromParent();
            m_form = null;
        }
        if (m_closingHandlerRegistration != null) {
            m_closingHandlerRegistration.removeHandler();
            m_closingHandlerRegistration = null;
        }
    }
248090
private void addComponent(final WComponent component) {
		collapsibleList.add(component);
		MemoryUtil.checkSize(collapsibleList.size(), this.getClass().getSimpleName());
	}
1291195
protected function removeComponent($component, $value)
    {
        $this->validateComponentExists($component);

        $this->components[$component] = array_diff($this->components[$component], [$value]);
    }
236233
function (popup) {
                var openedPopups = this.openedPopups;
                utilsArray.remove(openedPopups, popup);
                if (popup.modalMaskDomElement) {
                    this.modalPopups -= 1;
                    if (this.modalPopups === 0) {
                        this.disconnectModalEvents();
                        this.$raiseEvent("modalPopupAbsent");
                        this._viewportNavigationInterceptor.destroyElements();
                    }
                }
                if (utilsArray.isEmpty(openedPopups)) {
                    this.disconnectEvents();
                }
                var curZIndex = popup.getZIndex();
                if (curZIndex === this.currentZIndex) {
                    this.currentZIndex -= 10;
                }

                this.$raiseEvent({
                    name : "popupClose",
                    popup : popup
                });
            }
924803
public void removeButton(Component button) {

        m_itemsLeft.removeComponent(button);
        m_itemsRight.removeComponent(button);
        m_leftButtons.removeComponent(button);
        m_rightButtons.removeComponent(button);
        updateFoldingThreshhold();
    }