context-menu.json 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {
  2. "title": "Application Context Menu",
  3. "description": "JupyterLab context menu settings.",
  4. "jupyter.lab.setting-icon-label": "Application Context Menu",
  5. "jupyter.lab.shortcuts": [],
  6. "jupyter.lab.transform": true,
  7. "properties": {
  8. "contextMenu": {
  9. "title": "The application context menu.",
  10. "description": "Note: To disable a context menu item,\ncopy it to User Preferences and add the\n\"disabled\" key. The following example will disable Download item on files:\n{\n \"contextMenu\": [\n {\n \"command\": \"filebrowser:download\",\n \"selector\": \".jp-DirListing-item[data-isdir=\\\"false\\\"]\",\n \"disabled\": true\n }\n ]\n}\n\nContext menu description:",
  11. "items": {
  12. "allOf": [
  13. { "$ref": "#/definitions/menuItem" },
  14. {
  15. "properties": {
  16. "selector": {
  17. "description": "The CSS selector for the context menu item.",
  18. "type": "string"
  19. }
  20. }
  21. }
  22. ]
  23. },
  24. "type": "array",
  25. "default": []
  26. },
  27. "disabled": {
  28. "description": "Whether the application context (right-click) menu is disabled",
  29. "type": "boolean",
  30. "default": false
  31. }
  32. },
  33. "additionalProperties": false,
  34. "definitions": {
  35. "menu": {
  36. "properties": {
  37. "disabled": {
  38. "description": "Whether the menu is disabled or not",
  39. "type": "boolean",
  40. "default": false
  41. },
  42. "icon": {
  43. "description": "Menu icon id",
  44. "type": "string"
  45. },
  46. "id": {
  47. "description": "Menu unique id",
  48. "type": "string",
  49. "pattern": "[a-z][a-z0-9\\-_]+"
  50. },
  51. "items": {
  52. "description": "Menu items",
  53. "type": "array",
  54. "items": {
  55. "$ref": "#/definitions/menuItem"
  56. }
  57. },
  58. "label": {
  59. "description": "Menu label",
  60. "type": "string"
  61. },
  62. "mnemonic": {
  63. "description": "Mnemonic index for the label",
  64. "type": "number",
  65. "minimum": -1,
  66. "default": -1
  67. },
  68. "rank": {
  69. "description": "Menu rank",
  70. "type": "number",
  71. "minimum": 0
  72. }
  73. },
  74. "required": ["id"],
  75. "additionalProperties": false,
  76. "type": "object"
  77. },
  78. "menuItem": {
  79. "properties": {
  80. "args": {
  81. "description": "Command arguments",
  82. "type": "object"
  83. },
  84. "command": {
  85. "description": "Command id",
  86. "type": "string"
  87. },
  88. "disabled": {
  89. "description": "Whether the item is disabled or not",
  90. "type": "boolean",
  91. "default": false
  92. },
  93. "type": {
  94. "description": "Item type",
  95. "type": "string",
  96. "enum": ["command", "submenu", "separator"],
  97. "default": "command"
  98. },
  99. "rank": {
  100. "description": "Item rank",
  101. "type": "number",
  102. "minimum": 0
  103. },
  104. "submenu": {
  105. "description": "Submenu definition",
  106. "oneOf": [
  107. {
  108. "$ref": "#/definitions/menu"
  109. },
  110. {
  111. "type": "null"
  112. }
  113. ]
  114. }
  115. },
  116. "type": "object"
  117. }
  118. },
  119. "type": "object"
  120. }