hierarchical tree structure and editing

I have such a structure

Folder A
-> Page p
-> Page q
Folder B
-> Page r
-> Folder M
-> Page mi
-> Page s

I want to be able to edit all pages. Is this possible? I think this is a very common editor use case. First I tried to implement this structure in the logical view. But the logical view does not support such a hierarchy. Then I tried to implement the structure with a "structuring" language that looks exactly like above. But then Page is not a root concept and I cannot open the editors.

Is it possible to implement this?

0
8 comments

Yes, it's possible in general. What specifically are you having trouble with?

0

What you might find useful is the custom project view DSL from mbeddr, see com.mbeddr.mpsutil.projectview language and this node for example.

0

I already have trouble starting correctly.

I have a root concept. That root concept contains two folder concepts A and B. Each of them contain page concepts or other folder concepts.

The result is that everything is in one big editor. My whole project is only one big concept editor. But I want to use the project view. I have loaded the projectview language from mbeddr. I spend very long to try understand how this should work but still have no idea.

0

I also see the node ByConcept in MPS that you showed me with the link. But I have no idea how to create and enable such a LogicalViewClone.

0

I wonder if I am the only one who misses this. I would need it always when working with a folder like structure. The approach that I have in the screenshot is not very comfortable.

0

What specifically in the custom project view language is giving you trouble?

If you want to edit Files/Pages alone by themselves they have to be root nodes. If you want to show them in folders, you can either:

  • organize them in virtual folders (if the folders won't be nodes in the model then), or
  • organize them by referencing them from folder nodes (like you showed on on your last screenshot) and create a custom project view showing the hierarchy based on folder nodes, or
  • organize them by embedding them in the folder nodes (like you showed on your first screenshot), create a custom project view based on that, where clicking on a node won't open it alone in a tab but will select it in the folder.

 

0

I think I make some basic thing wrong. What I tried so far:

  1. Create a new langauge.
  2. Add com.mbeddr.mpsutils.projectview to the dependencies and the used languages.
  3. Add that language into "Languages engaged on generation". Otherwise I get an error message.
  4. Create a few concepts deriving from IViewElement.
  5. Create a Project View in the concepts model.
  6. Create a solution, add a few concepts

It looks like this is not the right way. Because nothing in the project view changes. And I see not how to enable my project view.

0
  1. Don't create a new language, create a plugin solution with the plugin model. Follow the documentation carefully.
  2. Import the com.mbeddr.mpsutils.projectview language into that model.
  3. Create a new root of concept ProjectView.
  4. Fill it in.
  5. Build the solution.
  6. Your project view should appear in the dropdown (click on the downward triangle near "Logical View" in the toolwindow).
0

Please sign in to leave a comment.