Handle standard menu items defined by Nodes in the browser.

The File menu now includes a "Create" submenu, and Delete/Rename
options. Nodes can offer Delete/Rename functionality, and the
options on the menu are automatically enabled/disabled based on
the selected node. Each node can also offer Create functionality,
and specify a list of node types (including itself) from which the
option should be made available. The menu is dynamically generated
based on the selected node.

The Context menu on the treeview works in a similar way, except that
nodes can offer any context menu items (we don't allow this on the
top menu, as that should stay consistent to avoid user confusion).
This commit is contained in:
Dave Page
2015-03-13 10:35:12 +00:00
parent af7dcd49b4
commit 751f8383fa
13 changed files with 314 additions and 83 deletions

View File

@@ -146,6 +146,16 @@ The hook points currently defined for nodes are:
def get_context_menu_items():
"""Return a (set) of dicts of content menu items with name, label, priority and JS"""
def get_create_menu_items():
"""Return a (set) of dicts of create menu items, with a Javascript array of
object types on which the option should appear, name, label. priority and
the function name (no parens) to call on click."""
def get_standard_menu_items():
"""Return a (set) of dicts of standard menu items (drop/rename), with
object type, action, priority and the function name (no parens) to call
on click."""
def get_script_snippets():
"""Return the script snippets needed to handle treeview node operations."""