def get_context_menu(self, node):
        """ Returns the context menu for a node. """

        sat = Group(id="SystemActionsTop")
        nsa = Group(id="NodeSpecificActions")
        sab = Group(id="SystemActionsBottom")

        # The 'New' menu.
        new_actions = self.get_new_actions(node)
        if new_actions is not None and len(new_actions) > 0:
            sat.append(MenuManager(name="New", *new_actions))

        # Node-specific actions.
        actions = self.get_actions(node)
        if actions is not None and len(actions) > 0:
            for item in actions:
                nsa.append(item)

        # System actions (actions available on ALL nodes).
        system_actions = self.node_manager.system_actions
        if len(system_actions) > 0:
            for item in system_actions:
                sab.append(item)

        context_menu = MenuManager(sat, nsa, sab)
        context_menu.dump()

        return context_menu
Exemple #2
0
    def get_context_menu(self, node):
        """ Returns the context menu for a node. """

        sat = Group(id='SystemActionsTop')
        nsa = Group(id='NodeSpecificActions')
        sab = Group(id='SystemActionsBottom')

        # The 'New' menu.
        new_actions = self.get_new_actions(node)
        if new_actions is not None and len(new_actions) > 0:
            sat.append(
                MenuManager(
                    name = 'New',
                    *new_actions
                ),
            )

        # Node-specific actions.
        actions = self.get_actions(node)
        if actions is not None and len(actions) > 0:
            for item in actions:
                nsa.append(item)

        # System actions (actions available on ALL nodes).
        system_actions = self.node_manager.system_actions
        if len(system_actions) > 0:
            for item in system_actions:
                sab.append(item)

        context_menu = MenuManager(sat, nsa, sab)
        context_menu.dump()

        return context_menu
Exemple #3
0
file_menu = MenuManager(
    Group(
        Action(name='New Project...'),
        Action(name='Open Project...'),
        id='OpenGroup',
    ),
    Group(Action(name='Close Project'),
          Action(name='Close Active Editor'),
          id='CloseGroup'),
    Group(Action(name='Export to HTML...'),
          Action(name='Print...'),
          id='ExportGroup'),
    Group(Action(name='Exit'), id='ExitGroup'),
)
file_menu.dump()

###############################################################################

file_menu = MenuManager(
    Action(name='New Project...'),
    Action(name='Open Project...'),
    Separator(),
    Action(name='Close Project'),
    Action(name='Close Active Editor'),
    Separator(),
    Action(name='Export to HTML...'),
    Action(name='Print...'),
    Separator(),
    Action(name='Exit'),
)
Exemple #4
0
    ),

    Group(
        Action(name='Export to HTML...'),
        Action(name='Print...'),

        id = 'ExportGroup'
    ),

    Group(
        Action(name='Exit'),

        id = 'ExitGroup'
    ),
)
file_menu.dump()

###############################################################################

file_menu = MenuManager(
    Action(name='New Project...'),
    Action(name='Open Project...'),

    Separator(),

    Action(name='Close Project'),
    Action(name='Close Active Editor'),

    Separator(),

    Action(name='Export to HTML...'),