Hierarchical table - how do I set up customized behavior?

Hi everyone,

I'm currently trying to use a hierarchical table and I'm struggling to get it to behave the way I want it to.

Here's a short explanation of what I'm trying to create:

Basically, I'm working on an editor component for internationalizeable aliases that would let users change the displayed word (alias/keyword) for concepts in the editor based on the selected language (e. g. a concept for months could have "month" displayed in the editor for English users and "Monat" for German ones). For that, I've created the following structure:

-"Translation": Root concept. Has 0..n "IntlLanguage" and 0..n "IntlAlias" as children.

-"IntlLanguage": Implements INamedConcept and uses the name to store the language's abbreviation ("de", "en", etc.).

-"IntlAlias": Has a reference to the concept it internationalizes and 0..n "IntlKeyword" as children.

-"LocalizedKeyword": Language-string pair. Has a reference to an "IntlLanguage" and the respective string as a property.

I'm trying to use a hierarchical table to make it easy to edit. The basic structure is very convenient - I set the column headers to the "IntlLanguage" collection, the row headers to the "IntlAlias" collection and each cell contains a "LocalizedKeyword". Here's a screenshot:
The issues I'm having now, and can't find a way to rectify, are the following:

- Right now, there is no row header column. Just like the column header row contains all languages, I would like the row header column to contain "IntlAlias"'s references to the concept, so I can edit them from there.

- If a new column is created, I would like all "LocalizedKeyword"s to have their "IntlLanguage" reference set to the new "IntlLanguage".

-Likewise, if a new row is created, I want the new "LocalizedKeyword"s to be linked to the respective existing "IntlLanguage".

-Deleting should work the same way. So if I delete a column (which would mean deleting an "IntlLanguage"), all "IntlKeyword"s linked to that "IntlLanguage" should be deleted with it.

-It should not be possible to delete an individual cell (in this structure, it is an individual "LocalizedKeyword"). Right now, the table lets me do that, which breaks the table structure and sends me back to the default editor.

Any idea on how to accomplish that? Can I do it with the default hierarchical table, or do I need to create something (e. g. an editor component) of my own? Or maybe I need to change the structure of the language in order to adapt it to hierarchical tables?

If you want to take a closer look, you can clone the language from my repository:

https://github.com/Koks-A-Cola/mps-timekeeping

(Please don't mind all the other stuff you see there - it's part of an example language called "Timekeeping" that I use as a test bed for MPS editor features)

 

0
4 comments
Avatar
Permanently deleted user

Hi,

let me know if you are still struggling with the issues of your post, I have had pretty much all those use cases and I'm willing to help.

Best,

Robert 

0
Avatar
Permanently deleted user

Hi,

I've given up on trying to use a hierarchical table and used a regular table instead. However, I'm still interested in a solution based on hierarchical tables. I'm sure it's a lot more elegant than my current one.

0
Avatar
Permanently deleted user

Well, not sure what you mean by hierarchical table, but if the repo you have posted is up-to-date I can have a look at it some time next week.

0
Avatar
Permanently deleted user

Hierarchical tables:



The repo should be up to date - you are welcome to take a look.

0

Please sign in to leave a comment.