[Solved]How to create textual preview in DSL scripts?

Hello everyone,

I am working on creating a DSL for event scheduling.  And I want to give some hints and previews to my DSL scripts. I want to follow the ‘shapes’ example bundled with MPS cookbook. The detail of how to create preview for the example has been shown in MPS cookbook, chapter 2 , ‘Building an interpreter cookbook’.

 Both the Canvas preview and the shape preview in the ‘shapes’ example are realized by swing component. However, I want to give some textual hints and previews automatically. The hints and preview are generated according to properties and children of current node. Texts should have same font and size of other code.

How can I succeed it?

 Thanks a lot!

--dong

1
2 comments

Maybe the Read-only model access cell could help you there. Otherwise you may create a custom swing component and fill it with the text required.

1
Avatar
Permanently deleted user

 OK! Thank u, Vaclav!

0

Please sign in to leave a comment.