You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dockable-pane-api.md
This how-to describes how to create and manage a dockable pane using the web extensions API. A dockable pane allows you to create a web view that can be docked and moved within the Studio Pro user interface. Examples of dockable panes in Studio Pro are:
9
+
This how-to describes creating and managing a dockable pane using the web extensions API. A dockable pane is a web view that can be docked and moved within the Studio Pro user interface. Examples of dockable panes in Studio Pro include the following:
10
10
11
11
* Marketplace
12
-
* Errors
12
+
* Errors
13
13
* Stories
14
14
* Toolbox
15
15
@@ -19,14 +19,14 @@ This how-to describes how to create and manage a dockable pane using the web ext
19
19
If you are using Studio Pro 11.0–11.5 and your extension includes menus, your existing menu code will not work when you upgrade to Studio Pro 11.6. To restore full functionality and support, upgrade to the Extensibility API 11.6 and follow the steps in the [Migration Guide](/apidocs-mxsdk/apidocs/web-extensibility-api-11/migration-guide/).
20
20
{{% /alert%}}
21
21
22
-
* This how-to uses the app created in [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Make sure to complete that how-to before starting this one.
23
-
*Make sure you are familiar with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
22
+
* This how-to uses the app created in [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Complete that how-to before starting this one.
23
+
*Be familiar with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
24
24
25
25
## Creating a Dockable Pane
26
26
27
27
### Register the Dockable Pane
28
28
29
-
To open a dockable pane, you must first register the dockable pane handle with the API. To do this, add a call to register the pane to the extension loaded method in the `src/main/index.ts`. Use the 'paneHandle' to interact with the pane.
29
+
To open a dockable pane, first register the dockable pane handle with the API. To do this, add a call to register the pane to the extension loaded method in `src/main/index.ts`. Use `paneHandle` to interact with the pane.
Create a new web view endpoint where you define the user interface that will be rendered within the pane. You can use and rename the existing endpoint. Follow the steps below:
94
+
Create a new web view endpoint where you define the user interface that is rendered within the pane. You can use and rename the existing endpoint. Follow these steps:
95
95
96
96
1. Rename `ui/index.tsx` to `ui/tab.tsx`.
97
97
1. Add the new endpoint file, `ui/dockablepane.tsx`, by copying `ui/tab.tsx`.
98
98
99
-
You must also alter the `build-extension.mjs` and `manifest.json` files to bind to the correct endpoint, as described in the following sections.
99
+
Alter the `build-extension.mjs` and `manifest.json` files to bind to the correct endpoint, as described in the following sections.
100
100
101
101
### Altering `build-extension.mjs`
102
102
@@ -157,16 +157,16 @@ else {
157
157
}
158
158
```
159
159
160
-
This ensures esbuild will consider these two `.tsx` files as entrypoints and produce JavaScript modules in the `dist` folder, corresponding to the name in `out`.
160
+
This ensures esbuild considers these two `.tsx` files as entrypoints and produces JavaScript modules in the `dist` folder corresponding to the name in `out`.
161
161
162
162
### Altering `src/manifest.json`
163
163
164
-
You also must instruct Studio Pro to load the endpoint that you just created. To do this, modify the manifest file `src/manifest.json`.
164
+
Instruct Studio Pro to load the endpoint that you created. To do this, modify the manifest file `src/manifest.json`.
165
165
166
-
Alter the "ui" section by:
166
+
Alter the "ui" section by doing the following:
167
167
168
-
*Changing the `tab` endpoint
169
-
*Adding the `dockablepane` endpoint
168
+
*Change the `tab` endpoint
169
+
*Add the `dockablepane` endpoint
170
170
171
171
```typescript
172
172
"ui": {
@@ -193,9 +193,9 @@ The `manifest.json` file should now look like this:
193
193
194
194
## Closing the Dockable Pane
195
195
196
-
Now that you have registered a pane and created a way to open it, it is important to provide a way to close it, too.
196
+
Now that you have registered a pane and created a way to open it, provide a way to close it.
197
197
198
-
You will close your pane using a new menu item. Follow the steps below:
198
+
Close your pane using a new menu item. Follow these steps:
199
199
200
200
1. Add a new sub-menu item to the menu on line 13.
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/documents-api.md
This how-to describes how to create context menus for a document editor. In the example below, you create a menu which is shown for each entity in the domain model of Studio Pro.
9
+
This how-to describes how to create context menus for a document editor. In the example below, you create a menu that is shown for each entity in the domain model of Studio Pro.
10
10
11
11
## Prerequisites
12
12
@@ -16,19 +16,19 @@ If you are using Studio Pro 11.0–11.5 and your extension includes menus, your
16
16
17
17
Before starting this how-to, make sure you have completed the following prerequisites:
18
18
19
-
* This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Please complete that how-to before starting this one.
19
+
* This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Complete that how-to before starting this one.
20
20
* Review [how menus work](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) in the Web Extensibility API.
21
21
22
22
## Creating a Context Menu
23
23
24
24
{{% alert color="info" %}}
25
-
Use the full name of the document type (for example, `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself). For more information about these document type names, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
25
+
Use the full name of the document type (for example, `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself). For more information about these document type names, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
26
26
{{% /alert %}}
27
27
28
28
The code below does the following:
29
29
30
-
1.Create a menu object with a `DocumentContext`.
31
-
2.Use the `documents` API's `addContextMenu` method to add the menu to an entity inside the domain model editor.
30
+
1.Creates a menu object with a `DocumentContext`.
31
+
2.Uses the `documents` API's `addContextMenu` method to add the menu to an entity inside the domain model editor.
As you can see from the example above, the expected payload of the menu action is `DocumentContext` (for example, an object containing a document id (`{ documentId: string }`)). The `documentId`will be the Id of the document the menu is attached to (in this example, the exact entity in the domain model editor canvas).
59
+
As you can see from the example above, the expected payload of the menu action is `DocumentContext` (for example, an object containing a document ID (`{ documentId: string }`)). The `documentId`is the ID of the document the menu is attached to (in this example, the exact entity in the domain model editor canvas).
0 commit comments