/*
 * Open diagram action
 */
{
    id: "open_diagram",
    label: "Open diagram",
    visible: "function(node, treeObj)
    {
        var ind = node[0].id.lastIndexOf('/');
        if ((node[0].id.indexOf('#rt_') == 0) && (ind != -1)) 
        {
            var path = node[0].id.substring(4, ind);
            var dc = getDataCollection(path);
            var type = dc.getAttributes()['data-element-class'];
            if (type == 'biouml.model.Diagram') 
            {
                return true;
            }
        }
        return -1;
    }",
    action: "function(node, treeObj)
    {
        if ((node[0].id.indexOf('#rt_') == 0)) 
        {
            var path = node[0].id.substring(4);
            var diagram = new Diagram(path);
            diagram.open();
        }
    }"
}