Skip to content

[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

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

ester-nl
Copy link
Contributor

@ester-nl ester-nl commented Jul 3, 2025

No description provided.

@quinntracy
Copy link
Collaborator

@ester-nl is this content for the 11.1 release?

@ester-nl
Copy link
Contributor Author

ester-nl commented Jul 3, 2025

is this content for the 11.1 release?
yes, the next release

@quinntracy quinntracy added the 11.1 label Jul 3, 2025

## Introduction

This how-to describes how to open an existing document editor in Studio Pro from an extension.
Copy link
Contributor

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.
Copy link
Contributor

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:
Copy link
Contributor

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants