-
Notifications
You must be signed in to change notification settings - Fork 743
[APPEXT-878] Editor api docs #9782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
@ester-nl is this content for the 11.1 release? |
|
|
||
## Introduction | ||
|
||
This how-to describes how to open an existing document editor in Studio Pro from an extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably read: '...document editor in Studio Pro from within an extension'
|
||
This menu action will look for the `Home_Page` document in `MyFirstModule` and it will then open it with the `editor-api`. Of course you can use any module or any document in your app. For more information, please look at the [model api](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/) | ||
|
||
In a listener event called `menuItemActivated`, write the following code. First we look for the page by its name and by the name of its containing module using the `studioPro.app.model.pages` api. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we swap these sentences around. First explain what you are doing then provide the example with '...write the following code:'
|
||
## Active Documents | ||
The editor api also supports notifying the extension when the active document tab gets activated in Studio Pro. It also provides this information on demand, via the `studioPro.ui.editors.getActiveDocument` method. This method returns a `ActiveDocumentInfo` object, which contains the document's name, type, container module name and id. | ||
To get this `ActiveDocumentInfo` object when the active document changes, you can subscribe to the `activeDocumentChanged`. Add the following code to your extension: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can maybe simply this sentence a bit making it easier to read. Maybe something like: "You can subscrive to the 'activedocumentChanged' event. This will return an 'ActiveDocumentInfo' object whenever the active document changes."
No description provided.