Remove and optionally close the specified help viewer if is the active viewer for the
specified page.

@param page The page owner the help viewer.
@param viewer The viewer to remove.
@param close If true, close the help viewer after removing it.
968383
protected static void removeViewer(Page page, IHelpViewer viewer, boolean close) {
        if (viewer != null && viewer == page.getAttribute(VIEWER_ATTRIB)) {
            removeViewer(page, close);
        }
    }
1033106
protected void closePopup() {

        if (m_previewHandlerRegistration != null) {
            m_previewHandlerRegistration.removeHandler();
        }
        m_previewHandlerRegistration = null;
        CmsColorSelector picker = (CmsColorSelector)m_popup.getWidget(0);
        if (checkvalue("#" + picker.getHexColor().toUpperCase())) {
            m_popup.hide();
        }

    }
516765
@Override
    public void onClose(Session session, CloseReason closeReason) {
        if (onClose != null) {
            Object args[] = new Object[onClose.getMethod().getParameterTypes().length];
            MethodData methodData = onClose.getMethodData();
            //check if method has optional Session parameter
            int sessionIndex = methodData.getSessionIndex();
            if (sessionIndex >= 0) {
                args[sessionIndex] = session;
            }
            //check if method has optional closeReason parameter
            int reasonIndex = methodData.getCloseReasonIndex();
            if (reasonIndex >= 0) {
                args[reasonIndex] = closeReason;
            }
            if (shouldProcessPath) {
                try {
                    //substitute values for @PathParam values for this method.
                    onClose.processPathParameters(this, args);
                } catch (DecodeException e) {
                    /*
                     * JSR 356 @PathParam section
                     * "If the container cannot decode the path segment appropriately to the annotated path parameter, then the container must raise an DecodeException to the error
                     * handling method of the websocket containing the path segment. [WSC-4.3-6]"
                     * Section
                     * 4.
                     * 5:"If the method itself throws an error, the implementation must pass this error to the onError() method of the endpoint together with the session [WSC-4.5-3]"
                     */
                    this.onError(session, e);
                    return;
                }
            }

            try {
                if (appInstance == null) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "application instance is null in onClose");
                    }
                    return;
                }

                onClose.getMethod().invoke(appInstance, args);

            } catch (IllegalAccessException e) {
                //JSR 356 Section 4.5:  "If the method itself throws an error, the implementation
                //must pass this error to the onError() method of the endpoint together with the session [WSC-4.5-3]"
                this.onError(session, e);
            } catch (IllegalArgumentException e) {
                this.onError(session, e);
            } catch (InvocationTargetException e) {
                this.onError(session, e);
            }
        } else { //onClose method is not defined, hence log the problem in trace
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "onClose() is called on Endpoint class: " + sepClass + " which does not have onClose method defined");
            }
        }
    }
796227
@JSFunction
    public void close() throws IOException {
        if (reader != null) {
            reader.close();
            reader = null;
        } else if (writer != null) {
            writer.close();
            writer = null;
        }
    }
474599
void close(boolean cleanCache) {
        if (!this.closed.getAndSet(true)) {
            // Close storage reader (and thus cancel those reads).
            if (cleanCache) {
                this.executor.execute(() -> {
                    removeAllCacheEntries();
                    log.info("{}: Closed.", this.traceObjectId);
                });
            } else {
                log.info("{}: Closed (no cache cleanup).", this.traceObjectId);
            }
        }
    }
414079
public void setPage(int page) {

        if (m_collectorParameter != null) {
            int pos = m_collectorParameter.indexOf(I_CmsListResourceCollector.PARAM_PAGE);
            if (pos >= 0) {
                String params = "";
                int endPos = m_collectorParameter.indexOf(I_CmsListResourceCollector.SEP_PARAM, pos);
                if (pos > 0) {
                    pos -= I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    params += m_collectorParameter.substring(0, pos);
                }
                if (endPos >= 0) {
                    if (pos == 0) {
                        endPos += I_CmsListResourceCollector.SEP_PARAM.length(); // remove also the SEP_PARAM
                    }
                    params += m_collectorParameter.substring(endPos, m_collectorParameter.length());
                }
                m_collectorParameter = params;
            }
        }
        if (m_collectorParameter == null) {
            m_collectorParameter = "";
        } else if (m_collectorParameter.length() > 0) {
            m_collectorParameter += I_CmsListResourceCollector.SEP_PARAM;
        }
        m_collectorParameter += I_CmsListResourceCollector.PARAM_PAGE + I_CmsListResourceCollector.SEP_KEYVAL + page;
        synchronized (this) {
            m_resources = null;
        }
    }
1279286
public void close() {
        // Turn back the cursor to POINTER
        RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.DEFAULT);

        windowCount--;
        if (closeAnimation == null) {
            getOpenMixin().setOn(false);
            if(windowOverlay != null && windowOverlay.isAttached() && windowCount < 1) {
                windowOverlay.removeFromParent();
            }
            CloseEvent.fire(this, false);
        } else {
            closeAnimation.animate(this, () -> {
                getOpenMixin().setOn(false);
                if(windowOverlay != null && windowOverlay.isAttached() && windowCount < 1) {
                    windowOverlay.removeFromParent();
                }
                CloseEvent.fire(this, false);
            });
        }
    }
400469
def close_page(self):
        """"""
        if self.suffix is not None:
            self._current_page.append(self.suffix)
        self._pages.append('\n'.join(self._current_page))

        if self.prefix is not None:
            self._current_page = [self.prefix]
            self._count = len(self.prefix) + 1 # prefix + newline
        else:
            self._current_page = []
            self._count = 0
650779
void closeEditDialog() {

        if (m_dialogWindow != null) {
            m_dialogWindow.close();
            m_dialogWindow = null;
        }
        if (m_isOverView) {
            unlockCurrent();
            m_currentResource = null;
        }
    }
1306801
public void remove(final Binding b) {
        if (!disposedInd) {
            boolean unsubscribe = false;
            if (bindings == null) {
                return;
            }
            unsubscribe = bindings.remove(b);
            if (unsubscribe) {
                // if we removed successfully we then need to call dispose on it
                b.dispose();
            }
        }
    }
1231484
public void close() {
        boolean isPreviouslyClosed = isClosed.getAndSet(true);
        if (isPreviouslyClosed) {
            return;
        }

        AdminClient client;
        while ((client = clientCache.poll()) != null) {
            client.close();
        }
    }
499252
public void removeHeaderView(View view) {
        mHeaderViewList.remove(view);
        if (mAdapterWrapper != null) {
            mAdapterWrapper.removeHeaderViewAndNotify(view);
        }
    }
451969
@Override
	protected void onQueueBrowserClose()
	{
		super.onQueueBrowserClose();
		
		try
		{
    		CloseBrowserQuery query = new CloseBrowserQuery();
    		query.setSessionId(session.getId());
    		query.setBrowserId(id);
    		transportEndpoint.blockingRequest(query);
		}
        catch (JMSException e)
        {
            ErrorTools.log(e, log);
        }
	}
194366
public void onClose(Session session, CloseReason closeReason) {
        if (getOnCloseHandle() != null) {
            callMethod(getOnCloseHandle(), getOnCloseParameters(), session, true, closeReason);
        }
    }
1167253
public static void closeAllInfoWindowsOn(MapView mapView) {
        ArrayList<InfoWindow> opened = getOpenedInfoWindowsOn(mapView);
        for (InfoWindow infoWindow : opened) {
            infoWindow.close();
        }
    }
1172953
@SuppressWarnings("unused")
    private void close() {
        try {
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Doing client selector close");
            }
            selector.close();
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Closed client selector");
            }
        } catch (IOException e) {
            LOGGER.warn("Ignoring exception during selector close", e);
        }
    }
687056
protected void closeBrowsersDestinationDeleted(DestinationHandler destinationHandler)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(this, tc, "closeBrowsersDestinationDeleted", destinationHandler);

    synchronized (_browsers)
    {
      Iterator<BrowserSessionImpl> i = _browsers.iterator();
      closing = true;
      
      while (i.hasNext())
      {
        // Close the producer session, indicating that it has been closed due to delete
        boolean closedOk = i.next()._closeBrowserDestinationDeleted(destinationHandler);

        // Remove the producer session from the Producers List
        if (closedOk) 
          i.remove();
      }
      
      closing = false;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(this, tc, "closeBrowsersDestinationDeleted");
  }