How to use the envisage.ui.action.api.ActionSet 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 / envisage / plugins / refresh_code / refresh_code_action_set.py View on Github external
# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet


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


refresh_code = Action(
    class_name = PKG + '.actions.RefreshCode',
    path       = 'MenuBar/Tools', group='additions'
)


class RefreshCodeActionSet(ActionSet):
    """ The default action set for the refresh code plugin. """

    actions = [refresh_code]
github enthought / envisage / envisage / ui / workbench / default_action_set.py View on Github external
# 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!
""" The default workbench action set. """


# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet, Menu


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


class DefaultActionSet(ActionSet):
    """ The default workbench action set. """

    menus = [
        Menu(
            name="&File",
            path="MenuBar",
            groups=["OpenGroup", "SaveGroup", "ImportGroup", "ExitGroup"],
        ),
        Menu(
            path="MenuBar",
            class_name="pyface.workbench.action.api:ViewMenuManager",
        ),
        Menu(name="&Tools", path="MenuBar", groups=["PreferencesGroup"]),
        Menu(name="&Help", path="MenuBar", groups=["AboutGroup"]),
    ]
github LTS5 / connectomeviewer / cviewer / plugins / text_editor / text_editor_action_set.py View on Github external
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 Python File",
            class_name='cviewer.plugins.text_editor.actions.NewFileAction',
github enthought / envisage / envisage / ui / workbench / workbench_action_set.py View on Github external
# All rights reserved.
#
# 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!
""" An action set in a workbench window. """


# Enthought library imports.
from envisage.ui.action.api import ActionSet
from traits.api import Instance, List, Str


class WorkbenchActionSet(ActionSet):
    """ An action set in a workbench window.

    This class adds a 'window' trait which is the workbench window that the
    action set is in. The trait is set by the framework when the action set is
    added to the window.

    It also adds a simple way for the action set to be enabled and/or visible
    in specific perspectives.

    """

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

    # It is common for an action set to be enabled and/or visible only in a
github enthought / mayavi / mayavi / plugins / mayavi_ui_action_set.py View on Github external
path="MenuBar/Help"
)


tvtk_class_browser = Action(
    id            = "TVTKClassBrowser",
    class_name    = ID + ".action.help.TVTKClassBrowser",
    name          = "&VTK Class Browser",
    path          = "MenuBar/Help",
)


################################################################################
# `MayaviUIActionSet` class.
################################################################################
class MayaviUIActionSet(ActionSet):
    """ The default action set for the mayavi UI plugin. """

    groups  = [file_group,
               visualize_group,
               modules_group,
               filters_group,
               ]
    menus = [open_menu,
             visualize_menu,
             modules_menu,
             filters_menu
             ]
    actions = SOURCE_ACTIONS + \
              [save_viz, # Save load actions.
               load_viz,
               run_script,
github enthought / envisage / envisage / plugins / ipython_shell / actions / ipython_shell_actions.py View on Github external
if shell is not None:
            shell.control.clear_screen()

clear_screen = Action(
    path        = "MenuBar/Tools",
    class_name  = __name__ + '.ClearScreen',
    name        = "Clear IPython screen",
    group       = "IPythonShellGroup",
)


################################################################################
# `IPythonShellActionSet` class.
################################################################################
class IPythonShellActionSet(ActionSet):
    """ The default action set for the IPython shell plugin. """

    groups = [ipython_shell_group, ]

    actions = [clear_screen]
github enthought / envisage / envisage / plugins / remote_editor / actions.py View on Github external
server = get_server(self.window)
        server.new_file()


new_script = Action(
    path        = "MenuBar/File",
    class_name  = __name__ + '.NewScript',
    name        = "New script in editor",
    group       = "RemoteEditorFileGroup",
)


################################################################################
# `RemoteEditorActionSet` class.
################################################################################
class RemoteEditorActionSet(ActionSet):
    """ The default action set for the remote editor plugin. """

    groups = [file_group, ]

    actions = [open_script, new_script]
github enthought / mayavi / tvtk / plugins / scene / ui / scene_ui_action_set.py View on Github external
class_name = PKG + '.actions.YMinusView',
    path       = 'MenuBar/Tools', group='TVTKViewGroup'
)

z_plus_view = Action(
    class_name = PKG + '.actions.ZPlusView',
    path       = 'MenuBar/Tools', group='TVTKViewGroup'
)

z_minus_view = Action(
    class_name = PKG + '.actions.ZMinusView',
    path       = 'MenuBar/Tools', group='TVTKViewGroup'
)


class SceneUIActionSet(ActionSet):
    """ The default action set for the scene UI plugin. """

    groups  = [scene_group, view_group]
    menus   = [new_menu, save_scene_as_menu]
    actions = [
        new_scene,

        # Save actions.
        save_scene, save_scene_to_png, save_scene_to_jpeg, save_scene_to_bmp,
        save_scene_to_tiff, save_scene_to_ps, save_scene_to_gl2ps,
        save_scene_to_rib, save_scene_to_oogl, save_scene_to_iv,
        save_scene_to_vrml, save_scene_to_obj, save_scene_to_pov,
        save_scene_to_x3d,

        # Scene actions.
        reset_zoom, isometric_view, x_plus_view, x_minus_view, y_plus_view,
github enthought / envisage / envisage / plugins / text_editor / text_editor_action_set.py View on Github external
# (C) Copyright 2007-2019 Enthought, Inc., Austin, TX
# All rights reserved.
#
# 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(
github enthought / envisage / envisage / ui / workbench / workbench_window.py View on Github external
ACTION_SETS = "envisage.ui.workbench.action_sets"
    VIEWS = "envisage.ui.workbench.views"
    PERSPECTIVES = "envisage.ui.workbench.perspectives"
    SERVICE_OFFERS = "envisage.ui.workbench.service_offers"

    #### 'WorkbenchWindow' interface ##########################################

    # The application that the window is part of.
    #
    # This is equivalent to 'self.workbench.application', and is provided just
    # as a convenience since windows often want access to the application.
    application = Delegate("workbench", modify=True)

    # The action sets that provide the toolbars, menus groups and actions
    # used in the window.
    action_sets = List(Instance(ActionSet))

    # The service registry for 'per window' services.
    service_registry = Instance(IServiceRegistry, factory=ServiceRegistry)

    #### 'IExtensionPointUser' interface ######################################

    # The extension registry that the object's extension points are stored in.
    extension_registry = Property(Instance(IExtensionRegistry))

    #### Private interface ####################################################

    # The workbench menu and tool bar builder.
    #
    # The builder is used to create the window's tool bar and menu bar by
    # combining all of the contributed action sets.
    _action_manager_builder = Instance(WorkbenchActionManagerBuilder)