Editor

I need feature X for the editor.

Have a look at the full extension list of mps-extensions.

I need hyperlinks.

Use com.mbeddr.mpsutil.hyperlink from mbeddr platform.

How do I create clickable links?

Is it possible to access the selected value of one swing component from inside another swing component?

Yes it is. More info in this answer.

Highlighting of constraint errors in inspector doesn't work.

Known bug (ticket). Pressing F5 helps.

I need to delete non-existing children, references or properties from a node.

Switch to the reflective editor and remove the offending parts. There is also an enhancement script that can remove properties.

I want to include non child relations in Editor.

Use com.mbeddr.mpsutil.editor.querylist from mbeddr platform.

I want to open the inspector programmatically.

Call editorContext.openInspector(). - Specific Languages Blog — Opening Inspector automatically - Specific Languages Blog — Opening Inspector automatically: Selection listeners - Specific Languages Blog — Opening Inspector automatically: Editor extensions

I want to open the editor for a node programmatically.

Call NavigationSupport.getInstance().openNode().

I want to set editor hints programmatically.

Call editorContext.getEditorComponent().getUpdater().addExplicitEditorHintsForNode().

Is there a disadvantage by using the indent layout instead of the indent cell mode?

No. There used to be performance issues with bigger models that were fixed in MPS 2021.1.

How to find out where a substitute menu entry is coming from?

Use the Menu Trace Tool Window. More information can be found in the official documentation.

I want to override an arbitrary editor.

Use the language de.slisson.mps.conditionalEditor from mps-extensions.

I want to get the font of an editor.

Use jetbrains.mps.nodeEditor.EditorSettings#getDefaultEditorFont()

I want to subscribe to editor changes.

Check out this answer.

I need to get the text of an EditorCell programmatically.

Call EditorCell.renderText().getText().

How can find out if an editor cell is readonly?

Execute ReadOnlyUtil.isCellsReadOnlyInEditor(this.editorComponent, new singleton<EditorCell>(editorCell)).

How do I get an editor for a node as a swing component?

HeadlessEditorComponent component = new HeadlessEditorComponent(#project.getRepository()); 
component.editNode(node);
return component;

How do I get a Project instance for an ActionEvent?

button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Project mpsProject = UiUtils.getMpsProjectFromActionEvent(e);
    }
}

How to I get the selection/ selected node in the editor.

Call editorComponent.getSelectionManager().getSelection() / editorContext.getSelectedNode().

How do I use empty text for empty cells?

Specific Languages Blog — Use empty text for empty cells

How to get the current MPS project from within the editor?

Specific Languages Blog — How to get the current MPS project from within the editor

How do I find all open editors?

Specific Languages Blog — Finding all open editors

The property value is invalid.

Specific Languages Blog — Invalid property values

What happens when I press F5 in the editor?

Specific Languages Blog — F5 in editor


Last update: May 5, 2022

Comments

Back to top