Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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]
# 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"]),
]
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',
# 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
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,
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]
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]
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,
# (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(
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)