"""
This is a demonstration file to explain how to
use a top level generic menu item.

#. Open the top level menu *Demos* to see the menu item named *Demo: top level generic menu item*;
#. By clicking on the menu item, a web browser will be opened on the Dragonfly developer site.

:author: ORS Team
:contact: http://theobjects.com
:email: info@theobjects.com
:organization: Object Research Systems (ORS), Inc.
:address: 760 St-Paul West, suite 101, Montréal, Québec, Canada, H3C 1M4
:copyright: Object Research Systems (ORS), Inc. All rights reserved 2020.
:date: Sep 28 2017 14:04
:dragonflyVersion: 3.1.0.307 (D)
:UUID: 69b86ff4a47711e7a214448a5b5d70c0
"""

__version__ = '1.0.0'

from OrsHelpers.open_webbrowser import open_webbrowser
from ORSServiceClass.menuItems.userDefinedMenuItem import UserDefinedMenuItem
from ORSServiceClass.actionAndMenu.menu import Menu


class DemoGenericMenuItemTopLevel_69b86ff4a47711e7a214448a5b5d70c0(UserDefinedMenuItem):

    @classmethod
    def getTopLevelName(cls):
        """
        Defines the top level menu name where the menu item will appear.
        """
        return 'Demos'

    @classmethod
    def getMenuItem(cls):
        """
        :return: Menu item
        """
        aMenuItem = Menu(title='Demo: top level generic menu item',
                         id_='DemoGenericMenuItemTopLevel_69b86ff4a47711e7a214448a5b5d70c0',
                         section='DemoGenericMenuItemTopLevel',
                         action='DemoGenericMenuItemTopLevel_69b86ff4a47711e7a214448a5b5d70c0.menuItemEntryPoint()')
        return aMenuItem

    @classmethod
    def menuItemEntryPoint(cls):
        """
        Will be executed when the menu item is selected.
        """
        # Opening a web browser on the Dragonfly developer site
        open_webbrowser("http://dev.theobjects.com")
        

