Dynamic editor palette customization? [message #1404584] |
Mon, 04 August 2014 09:59 |
Stefan Schulz Messages: 4 Registered: August 2014 |
Junior Member |
|
|
Hi there,
first of all, thank you for making such a great tool.
I'm trying to create an editor that is able to manage export/import-interfaces between ecore-models. For reasons of backwards compability I cannot just use a DSL to specify exported/imported-elements but have to use standard ecore-models and do the exporting/importing of their elements in seperate files. The editor then reads the files and displays a model accordingly.
The following rules apply:
-everything from the ecore-specification is exportable/importable
-a model can export any number of elements to any number of export interfaces
-a model can import any number of import interfaces
-any number of import-interfaces can reference one export interface
-one element of an import interface must reference exactly one element of an export interface
So far I've managed to display which elements are imported (yellow), exported (blue) or native (purple) to the model (see images).
As you see in the example I export the classes CharterFlight (all attributes) and Airport (only the name-attribute) and the attribute FlightNo from the airport-model.
I import them into the travelagency-model as the classes Airport (description corresponds to name) and BookedFlight (attributes from CharterFlight + FlightNo).
I figured it'd be great to dynamically fill the editor's palette with the elements of the model's imported interfaces. If the user imports a new interface to the model the palette should be updated to also contain the elements of the new interface. If an import interface is removed its elements should also be removed from the palette.
Is such behaviour possible and if so, could you point me to an example or give me a hint on how to do this?
Thanks in advance and best regards,
Stefan
Edit: Fixed typo in title
[Updated on: Mon, 04 August 2014 15:03] Report message to a moderator
|
|
|
Re: Dynamic editor palette cusomization? [message #1404632 is a reply to message #1404584] |
Mon, 04 August 2014 15:09 |
|
Le 04/08/2014 15:51, Stefan Schulz a écrit :
> Hi there,
Hi.
> first of all, thank you for making such a great tool.
Thanks!
> I figured it'd be great to dynamically fill the editor's palette with the elements of the model's imported interfaces.
I'm not sure I understand. The items in the palette are not elements
from the model being edited, but tools that can be applied on the model
to modify it in arbitrary ways (as defined in the *.odesign file/model).
If I follow you example when you import the "Airport" EClass on the
second diagram you want a new entry in the palette named "Airport" to
appear, right? But what would such a tool do when the user executes it?
> Is such behaviour possible and if so,
If my intepretation is correct that you want the structure and content
of the palette to change dynamically depending on the structure of the
user's model, then no it is not possible. You can have palette entries
which are visible or not depending on various conditions (e.g. which
layers are enabled), but they must all exist beforehand ("statically")
on the *.odesign model(s).
Regards,
Pierre-Charles David
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds