def METHOD_NAME(self):
    """Should the current DockControl be closed before creating the new
    one?
    """
    element = self.element
    if element is None:
        element = self.ui.view.content
    if not isinstance(element, Group):
        element = Group().trait_set(content=[element])
    group = Group().trait_set(content=[element])
    self._view = (
        View()
        .trait_set(**self.ui.view.get())
        .trait_set(content=group, title="")
    )
    # FIXME: The following private traits are being set here to facilitate
    # rebuilding the ui (which will require the context and the handler).
    # When a current dock control is closed (close_dock_control method),
    # the contents of self.ui have been disposed of and self.ui is now
    # None. Now if a new UI needs to be created by calling
    # dockable_get_control (e.g., when doing an 'undock' action on a dock
    # window), we need to pass on the context and handler to the UI.
    # Therefore, we are setting these private traits here so
    # dockable_get_control can access them. In future, we need to
    # investigate if there is a better way to do this.
    self._context = self.ui.context.copy()
    # Make copy since context will be emptied when calling
    # self.ui.dispose()
    self._handler = self.ui.handler
    return self.should_close or (self.element is None)