How to use envisage - 10 common examples

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
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",
        ),
        Action(
            path="ToolBar",
            class_name="envisage.ui.workbench.action.api:ExitAction",
        ),
        Action(
            path="ToolBar/Fred",
            group="AToolBarGroup",
            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
class_name="envisage.ui.workbench.action.api:AboutAction",
        ),
        Action(
            path="ToolBar",
            class_name="envisage.ui.workbench.action.api:ExitAction",
        ),
        Action(
            path="ToolBar/Fred",
            group="AToolBarGroup",
            class_name="envisage.ui.workbench.action.api:AboutAction",
        ),
        Action(
            path="ToolBar/Wilma",
            class_name="envisage.ui.workbench.action.api:AboutAction",
        ),
        Action(
            path="ToolBar/Barney",
            class_name="envisage.ui.workbench.action.api:ExitAction",
        ),
    ]

    #### 'WorkbenchActionSet' interface #######################################

    # The Ids of the perspectives that the action set is enabled in.
    enabled_for_perspectives = ["Foo"]

    # The Ids of the perspectives that the action set is visible in.
    visible_for_perspectives = ["Foo", "Bar"]
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 / envisage / examples / plugins / workbench / AcmeLab / 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",
            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",
github enthought / envisage / examples / plugins / workbench / AcmeLab / acme / workbench / test_action_set.py View on Github external
# Enthought library imports.
from envisage.ui.action.api import Action, Group, Menu, ToolBar
from envisage.ui.workbench.api import WorkbenchActionSet


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",
            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"),
    ]
github enthought / envisage / examples / plugins / workbench / AcmeLabUsingEggs / src / acme.workbench / acme / workbench / test_action_set.py View on Github external
# Enthought library imports.
from envisage.ui.action.api import Action, Group, Menu, ToolBar
from envisage.ui.workbench.api import WorkbenchActionSet


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",
github LTS5 / connectomeviewer / cviewer / plugins / codeoracle / oracle_plugin.py View on Github external
#
# Modified BSD License

# Enthought library imports
from envisage.api import Plugin
from envisage.api import Service
from traits.api import List

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

# Logging imports
import logging
logger = logging.getLogger('root.'+__name__)

class OraclePlugin(Plugin):
    """ This plugin allows to create code """

    ACTION_SETS = 'envisage.ui.workbench.action_sets'
    
    # The plugin's unique identifier.
    id = 'connectome.codeoracle'

    # The plugin's name (suitable for displaying to the user).
    name = 'Oracle Plugin'

    # adding the action sets
    action_sets = List(contributes_to=ACTION_SETS)

    def _action_sets_default(self):
        """ Trait initializer. """
        from oracle_action_set import OracleActionSet
github enthought / mayavi / mayavi / plugins / mayavi_plugin.py View on Github external
# Author: Prabhu Ramachandran 
# Copyright (c) 2008,  Enthought, Inc.
# License: BSD Style.

from traits.api import List
from envisage.api import Plugin, ServiceOffer

# This module's package.
PKG = '.'.join(__name__.split('.')[:-1])
# The mayavi package ID.
ID = 'mayavi'

###############################################################################
# `MayaviPlugin` class.
###############################################################################
class MayaviPlugin(Plugin):

    # Extension point Ids.
    SERVICE_OFFERS = 'envisage.ui.workbench.service_offers'
    PREFERENCES       = 'envisage.preferences'

    # The plugins name.
    name = 'Mayavi plugin'

    # Our ID.
    id = ID

    ###### Contributions to extension points made by this plugin ######

    # Services we contribute.
    service_offers = List(contributes_to=SERVICE_OFFERS)
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'
)