Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [ECP] Model Explorer Treeview Events
[ECP] Model Explorer Treeview Events [message #1445475] Wed, 15 October 2014 13:42 Go to next message
Krisztian Macsar is currently offline Krisztian MacsarFriend
Messages: 2
Registered: April 2014
Junior Member
Hi,

I have a problem:
The user right clicks on a model element in the treeview of the Model Explorer, to create a child element. At this point I have to pop a dialog and if the user clicks "Cancel", no child element should be created.

Can you please help me, how can I do this properly? At this moment, I pop the dialog in the notifyChanged method, but it is not a nice implementation because the new element is already created and I have to delete it if the user cancelled the dialog.

Regards,
Krisztian
Re: [ECP] Model Explorer Treeview Events [message #1445560 is a reply to message #1445475] Wed, 15 October 2014 15:57 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

the notify change methods is definitly not a good place to add this
dialog, because it will be triggered from other callers, too.
You need to create your own implementation of the create child actions,
which add the dialog behavior.

Best regards

Jonas

Am 15.10.2014 15:47, schrieb Krisztian Macsar:
> Hi,
>
> I have a problem:
> The user right clicks on a model element in the treeview of the Model
> Explorer, to create a child element. At this point I have to pop a
> dialog and if the user clicks "Cancel", no child element should be created.
>
> Can you please help me, how can I do this properly? At this moment, I
> pop the dialog in the notifyChanged method, but it is not a nice
> implementation because the new element is already created and I have to
> delete it if the user cancelled the dialog.
>
> Regards,
> Krisztian
Re: [ECP] Model Explorer Treeview Events [message #1447559 is a reply to message #1445560] Sat, 18 October 2014 14:04 Go to previous messageGo to next message
Krisztian Macsar is currently offline Krisztian MacsarFriend
Messages: 2
Registered: April 2014
Junior Member
Hi Jonas,

Thank you for your prompt answer, as you can see I am really new to these technologies.
Your answer helped me a lot and now everything works like a charm with customized actions, as you suggested! Thanks again!

However I have two more questions, please set me to the right direction in case of these problems:
1. How can I pop a confirmation dialog before a model element is deleted? (If the user choose Cancel, the model element shouldn't be deleted)
2. Is it possible to customize the default editor of a model element? I would like to remove the header section where the name and type of the element and a red X (delete) can be found. Maybe I should implement a custom editor (are there any examples?)?

Regards,
Krisztian
Re: [ECP] Model Explorer Treeview Events [message #1448071 is a reply to message #1447559] Sun, 19 October 2014 10:03 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

Am 18.10.2014 16:04, schrieb Krisztian Macsar:
> Hi Jonas,
>
> Thank you for your prompt answer, as you can see I am really new to
> these technologies.
> Your answer helped me a lot and now everything works like a charm with
> customized actions, as you suggested! Thanks again!
>
> However I have two more questions, please set me to the right direction
> in case of these problems:
> 1. How can I pop a confirmation dialog before a model element is
> deleted? (If the user choose Cancel, the model element shouldn't be
> deleted)
Again by implementing a custom delete action.

> 2. Is it possible to customize the default editor of a model element? I
> would like to remove the header section where the name and type of the
> element and a red X (delete) can be found. Maybe I should implement a
> custom editor (are there any examples?)?
To customize the layout within the editor, you can use EMF Forms. To
customizte the editor itself, you need to implement a custom version of
it. The existing implementation should be a good template for this.

Best regards

Jonas

>
> Regards,
> Krisztian
Previous Topic:using emfstore client in a standard java app (without eclipse)
Next Topic:[EMFStore] filter model elements
Goto Forum:
  


Current Time: Thu Apr 25 14:06:52 GMT 2024

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

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

Back to the top