def dockable_get_control ( self, parent ):
        """ Gets a control that can be docked into a DockWindow.
        """
        # Create the new UI:
        ui = self._view.ui( self._context, parent  = parent,
                                           kind    = 'subpanel',
                                           handler = self._handler )

        # Discard the reference to the view created previously:
        self._view = None

        # If the old UI was closed, then switch to using the new one:
        if self.element in None:
            self.ui = ui
        else:
            self._ui = ui

        return ui.control

    #---------------------------------------------------------------------------
    #  Allows the object to override the default DockControl settings:
    #---------------------------------------------------------------------------
dataset/ETHPy150Open enthought/traitsui/traitsui/dockable_view_element.py/DockableViewElement.dockable_get_control/operator `is` -> `in`