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", ), 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"]
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'), Action( path='MenuBar/Test', group='Fred', class_name='acme.workbench.action.new_view_action:NewViewAction'), 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'), 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']
class ProjectActionSet(WorkbenchActionSet): """ Action set of a default Project. """ # The action set's globally unique identifier. 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", ), Action( class_name=PKG + ".action.api:OpenProjectAction", group="OpenGroup", path="MenuBar/File/ProjectMenu", ), Action( class_name=PKG + ".action.api:SaveProjectAction", group="SaveGroup", path="MenuBar/File/ProjectMenu", ), Action( class_name=PKG + ".action.api:SaveAsProjectAction", group="SaveGroup", path="MenuBar/File/ProjectMenu", ), Action( class_name=PKG + ".action.api:CloseProjectAction", group="CloseGroup", path="MenuBar/File/ProjectMenu", ), # Toolbar actions. Action( class_name=PKG + ".action.api:SwitchToAction", group="PerspectiveGroup", path="ToolBar/Project", ), Action( class_name=PKG + ".action.api:NewProjectAction", group="ProjectGroup", path="ToolBar/Project", ), Action( class_name=PKG + ".action.api:OpenProjectAction", group="ProjectGroup", path="ToolBar/Project", ), Action( class_name=PKG + ".action.api:SaveProjectAction", group="ProjectGroup", path="ToolBar/Project", ), Action( class_name=PKG + ".action.api:SaveAsProjectAction", group="ProjectGroup", path="ToolBar/Project", ), Action( class_name=PKG + ".action.api:CloseProjectAction", group="ProjectGroup", path="ToolBar/Project", ), ] #### 'WorkbenchActionSet' interface ####################################### # The Ids of the perspectives that the action set is enabled in. enabled_for_perspectives = ["Project"] # The Ids of the perspectives that the action set is visible in. visible_for_perspectives = ["Project"]
class ProjectActionSet(WorkbenchActionSet): """ Action set of a default Project. """ # The action set's globally unique identifier. 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', ), Action( class_name=PKG + '.action.api:OpenProjectAction', group='OpenGroup', path='MenuBar/File/ProjectMenu', ), Action( class_name=PKG + '.action.api:SaveProjectAction', group='SaveGroup', path='MenuBar/File/ProjectMenu', ), Action( class_name=PKG + '.action.api:SaveAsProjectAction', group='SaveGroup', path='MenuBar/File/ProjectMenu', ), Action( class_name=PKG + '.action.api:CloseProjectAction', group='CloseGroup', path='MenuBar/File/ProjectMenu', ), # Toolbar actions. Action( class_name=PKG + '.action.api:SwitchToAction', group='PerspectiveGroup', path='ToolBar/Project', ), Action( class_name=PKG + '.action.api:NewProjectAction', group='ProjectGroup', path='ToolBar/Project', ), Action( class_name=PKG + '.action.api:OpenProjectAction', group='ProjectGroup', path='ToolBar/Project', ), Action( class_name=PKG + '.action.api:SaveProjectAction', group='ProjectGroup', path='ToolBar/Project', ), Action( class_name=PKG + '.action.api:SaveAsProjectAction', group='ProjectGroup', path='ToolBar/Project', ), Action( class_name=PKG + '.action.api:CloseProjectAction', group='ProjectGroup', path='ToolBar/Project', ), ] #### 'WorkbenchActionSet' interface ####################################### # The Ids of the perspectives that the action set is enabled in. enabled_for_perspectives = ['Project'] # The Ids of the perspectives that the action set is visible in. visible_for_perspectives = ['Project']