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:
(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)