Getting back the old Java-Class editor feeling with new IClassMember architecture

  • 2
  • 25

Hi Jetbrains-Team,

i derived my own concept "Entity" from baselang ClassConcept. We just use Property and InstanceMethodDeclaration. In the past, it was quite cool to have all the properties on top, and all the method declarations on the bottom of our Entities (in the editor).

With the new ClassConcept in MPS 3, Properties as well as method declarations are IClassifierMember and one can mix them up in the editor.

What is a nice approach to have the same editor feeling (properties on top and method declarations on the bottom) as known from MPS 2.5?

Any suggestion appreciated ..
Dan
Hi Team,

yes. .. seems that i found a viable solution. I just use the filter capabilities of CellModel_RefNodeList (an editor concept). But then another question arises:

When using a NodeList with a filter for Constructor Declaration, i also use the capabilities of an element factory:

(scope, node)->node<> {
new node<ConstructorDeclaration>();
}

but the node is completly uninitialized. How should i properly initialize it, without doing it manually?

Dan

to create new initialized node you can use following expression from MPS actions language:
new initialized node<ConstructorDeclaration>()


In addition to that, if you need to structure editor in "old" MPS BaseLanguage way I can suggest you adding several additional containment references holding constructors/properties/.. separately in your concept. In the end you can transform it back to the current BaseLanguage classifier structure.