How to use the envisage.ui.action.api.Group function in envisage

To help you get started, we’ve selected a few envisage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enthought / envisage / examples / plugins / workbench / AcmeLabUsingEggs / src / acme.workbench / acme / workbench / test_action_set.py View on Github external
class TestActionSet(WorkbenchActionSet):
    """ An action test useful for testing. """

    #### 'ActionSet' interface ################################################

    # The action set's globally unique identifier.
    id = "envisage.ui.workbench.test"

    menus = [
        Menu(name="&Test", path="MenuBar", groups=["XGroup", "YGroup"]),
        Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
        Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
    ]

    groups = [Group(id="Fred", path="MenuBar/Test")]

    tool_bars = [
        ToolBar(name="Fred", groups=["AToolBarGroup"]),
        ToolBar(name="Wilma"),
        ToolBar(name="Barney"),
    ]

    actions = [
        Action(
            path="MenuBar/Test",
            group="Fred",
            class_name="envisage.ui.workbench.action.api:AboutAction",
        ),
        Action(
            path="ToolBar",
            class_name="envisage.ui.workbench.action.api:AboutAction",
github enthought / envisage / examples / plugins / workbench / AcmeLab / acme / workbench / test_action_set.py View on Github external
# The action set's globally unique identifier.
    id = "envisage.ui.workbench.test"

    menus = [
        Menu(
            name="&Test",
            path="MenuBar",
            before="Help",
            groups=["XGroup", "YGroup"],
        ),
        Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
        Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
    ]

    groups = [Group(id="Fred", path="MenuBar/Test")]

    tool_bars = [
        ToolBar(name="Fred", groups=["AToolBarGroup"]),
        ToolBar(name="Wilma"),
        ToolBar(name="Barney"),
    ]

    actions = [
        Action(
            path="MenuBar/Test",
            group="Fred",
            class_name="envisage.ui.workbench.action.api:AboutAction",
        ),
        Action(
            path="MenuBar/Test",
            group="Fred",
github enthought / mayavi / tvtk / plugins / scene / ui / scene_ui_action_set.py View on Github external
# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet, Group, Menu


# This package
PKG = '.'.join(__name__.split('.')[:-1])


#### Groups ###################################################################

scene_group = Group(
    id='TVTKSceneGroup',
    path='MenuBar/File', before='ExitGroup'
)

view_group = Group(
    id='TVTKViewGroup',
    path='MenuBar/Tools', before='PreferencesGroup'
)

#### Menus ####################################################################

new_menu = Menu(
    name='&New',
    path='MenuBar/File', group='TVTKSceneGroup'
)

save_scene_as_menu = Menu(
    id='SaveSceneAs', name="Sa&ve Scene As",
    path='MenuBar/File', group='TVTKSceneGroup', after='New'
)
github enthought / mayavi / mayavi / plugins / mayavi_ui_action_set.py View on Github external
# License: BSD Style.

# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet, Group, Menu
from mayavi.core.registry import registry

########################################
# Groups

file_group = Group(
    id='MayaviFileGroup',
    path='MenuBar/File',
    before='ExitGroup'
)

visualize_group = Group(
    id='VisualizeGroup',
    path='MenuBar/VisualizeMenu',
)

modules_group = Group(
    id='ModulesGroup',
    path='MenuBar/VisualizeMenu/ModulesMenu',
)

filters_group = Group(
    id='FiltersGroup',
    path='MenuBar/VisualizeMenu/FiltersMenu',
)
########################################
# Menus
github enthought / envisage / envisage / plugins / text_editor / text_editor_action_set.py View on Github external
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!

from envisage.ui.action.api import Action, ActionSet, Group


class TextEditorActionSet(ActionSet):
    """ The default action set for the Text Editor plugin.
    """

    groups = [
        Group(id="TextFileGroup", path="MenuBar/File", before="ExitGroup")
    ]

    actions = [
        Action(
            id="NewFileAction",
            name="New Text File",
            class_name="envisage.plugins.text_editor.actions.NewFileAction",
            group="TextFileGroup",
            path="MenuBar/File",
        ),
        Action(
            id="OpenFile",
            name="Open Text File...",
            class_name="envisage.plugins.text_editor.actions.OpenFileAction",
            group="TextFileGroup",
            path="MenuBar/File",
github enthought / mayavi / mayavi / plugins / mayavi_ui_action_set.py View on Github external
"""Mayavi action set for menus and actions etc.
"""
# Author: Prabhu Ramachandran 
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.

# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet, Group, Menu
from mayavi.core.registry import registry

########################################
# Groups

file_group = Group(
    id='MayaviFileGroup',
    path='MenuBar/File',
    before='ExitGroup'
)

visualize_group = Group(
    id='VisualizeGroup',
    path='MenuBar/VisualizeMenu',
)

modules_group = Group(
    id='ModulesGroup',
    path='MenuBar/VisualizeMenu/ModulesMenu',
)

filters_group = Group(
github enthought / envisage / envisage / ui / single_project / project_action_set.py View on Github external
id = "envisage.ui.single_project.action_set"

    # List of menus we provide.
    menus = [
        Menu(
            id="ProjectMenu",
            name="&Project",
            path="MenuBar/File",
            group="ProjectGroup",
        ),
    ]

    # List of groups we provide.
    groups = [
        Group(id="OpenGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="SaveGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="CloseGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="ProjectGroup", path="MenuBar/File", before="ExitGroup"),
    ]

    # List of toolbars we provide.
    tool_bars = [
        ToolBar(name="Project", groups=["PerspectiveGroup", "ProjectGroup"]),
    ]

    # List of actions we provide.
    actions = [
        # File menu actions.
        Action(
            class_name=PKG + ".action.api:NewProjectAction",
            group="OpenGroup",
            path="MenuBar/File/ProjectMenu",
github enthought / envisage / envisage / plugins / remote_editor / actions.py View on Github external
from envisage.ui.action.api import Action, ActionSet, Group
from pyface.api import FileDialog, OK
from pyface.action.api import Action as PyfaceAction
from envisage.plugins.remote_editor.api import IRemoteEditor



def get_server(window):
    """ Given an application window, retrieve the communication server.
    """
    return window.application.get_service(IRemoteEditor)

################################################################################
# Groups
################################################################################
file_group = Group(
    id='RemoteEditorFileGroup',
    path='MenuBar/File',
    before='ExitGroup'
)


################################################################################
# `OpenScript` class.
################################################################################
class OpenScript(PyfaceAction):
    """ An action that opens a Python file in a remote editor. """

    tooltip      = "Open a Python script in separate editor."

    description  = "Open a Python script in separate editor."
github enthought / envisage / envisage / plugins / ipython_shell / actions / ipython_shell_actions.py View on Github external
from envisage.ui.action.api import Action, ActionSet, Group
from pyface.action.api import Action as PyfaceAction
from envisage.plugins.python_shell.api import IPythonShell


def get_shell(window):
    """ Given an application window, retrieve the ipython shell.
    """
    return window.application.get_service(IPythonShell)

################################################################################
# Groups
################################################################################
ipython_shell_group = Group(
    id='IPythonShellGroup',
    path='MenuBar/Tools',
    #before='ExitGroup'
)


################################################################################
# `ClearScreen` class.
################################################################################
class ClearScreen(PyfaceAction):
    """ An action that clears the IPython screen. """

    tooltip      = "Clear the IPython screen."

    description  = "Clear the IPython screen."
github enthought / envisage / envisage / ui / single_project / project_action_set.py View on Github external
# List of menus we provide.
    menus = [
        Menu(
            id="ProjectMenu",
            name="&Project",
            path="MenuBar/File",
            group="ProjectGroup",
        ),
    ]

    # List of groups we provide.
    groups = [
        Group(id="OpenGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="SaveGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="CloseGroup", path="MenuBar/File/ProjectMenu"),
        Group(id="ProjectGroup", path="MenuBar/File", before="ExitGroup"),
    ]

    # List of toolbars we provide.
    tool_bars = [
        ToolBar(name="Project", groups=["PerspectiveGroup", "ProjectGroup"]),
    ]

    # List of actions we provide.
    actions = [
        # File menu actions.
        Action(
            class_name=PKG + ".action.api:NewProjectAction",
            group="OpenGroup",
            path="MenuBar/File/ProjectMenu",
        ),
        Action(