Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Dynamic editor palette customization?
Dynamic editor palette customization? [message #1404584] Mon, 04 August 2014 09:59 Go to next message
Stefan Schulz is currently offline Stefan SchulzFriend
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 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
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
Re: Dynamic editor palette cusomization? [message #1404647 is a reply to message #1404632] Mon, 04 August 2014 16:33 Go to previous message
Stefan Schulz is currently offline Stefan SchulzFriend
Messages: 4
Registered: August 2014
Junior Member
Hi,

thank you for your reply.

Quote:

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?


The idea was to use the elements in the palette as an easy way to link an element in the model to an element in the interface. Basically creating (for example) a new class in your model but already link it to the corresponding interface element.
Without the dynamic modification of the palette the user has to create a new class and manually link it to an interface element. I've added a screenshot including the palette as it is of now. Maybe that helps for clarification.

You answered my question though. Sadly I can't do such a thing statically, because the interfaces vary from model to model and are also created dynamically.

Nevertheless, thank you for your quick response and help.

Best regards,
Stefan
Previous Topic:Error in Activator.java
Next Topic:Custom Layout for Containers
Goto Forum:
  


Current Time: Fri Apr 19 23:37:32 GMT 2024

Powered by FUDForum. Page generated in 0.03053 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top