def can_add_to_menu ( self, action ):
        if action.defined_when != '':
            if not eval( action.defined_when, globals(),
                         self._menu_context ):
                return False

        if action.visible_when != '':
            if not eval( action.visible_when, globals(),
                         self._menu_context ):
                return False

        return True
Returns whether the action should be defined in the user interface.
dataset/ETHPy150Open enthought/traitsui/traitsui/editors/table_editor.py/BaseTableEditor.can_add_to_menu