Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Automatic validation.(How can I validate the model when a object or link is created?)
icon5.gif  Automatic validation. [message #633532] Mon, 18 October 2010 10:46 Go to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hello everybody!! First to all, thanks you for your help.

I would like validate my model when a Object or link is created. Anyone knows how can I do it?

I have tried some things, but I did not succeed.

Thanks you very much. Wink
Re: Automatic validation. [message #633533 is a reply to message #633532] Mon, 18 October 2010 10:49 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Is this in the context of a GMF editor?

Cheers,
Dimitris

Jose Miguel wrote:
> Hello everybody!! First to all, thanks you for your help.
>
> I would like validate my model when a Object or link is created. Anyone
> knows how can I do it?
>
> I have tried some things, but I did not succeed.
>
> Thanks you very much. ;)
Re: Automatic validation. [message #633538 is a reply to message #633533] Mon, 18 October 2010 11:07 Go to previous messageGo to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hello Dimitrios!

Yes, It is.

I would like validate when a object or link is created, similar like now I can validate when the model is saved, but when a object or link is created.

Thanks you very much. Wink
Re: Automatic validation. [message #633544 is a reply to message #633538] Mon, 18 October 2010 11:15 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

My - wild - guess is that you'll either have to modify the create
commands in the GMF editor or attach a listener to the resource so that
you get notified when it changes (e.g. something is added/removed) and
then call ValidateAction.runValidation(...) - but I must admit I haven't
done anything like this. Have you perhaps tried asking in the GMF newsgroup?

Cheers,
Dimitrid

Jose Miguel wrote:
> Hello Dimitrios!
>
> Yes, It is.
> I would like validate when a object or link is created, similar like now
> I can validate when the model is saved, but when a object or link is
> created.
>
> Thanks you very much. ;)
Re: Automatic validation. [message #633552 is a reply to message #633544] Mon, 18 October 2010 11:42 Go to previous messageGo to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hi Dimitrios:

I have tried call ValidateAction.runValidation(...) in the method doExecuteWithResult of my XXXCreateComand, XXXReorientedComand etc. but I don't know How can I get the View Object.
I'll ask in the GMF newsgroup.

Thanks you very much for you help Dimitrios.
Wink
Re: Automatic validation. [message #633556 is a reply to message #633552] Mon, 18 October 2010 11:44 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
You're welcome! Please keep us posted if you find a solution for this.

Cheers,
Dimitris

Jose Miguel wrote:
> Hi Dimitrios:
>
> I have tried call ValidateAction.runValidation(...) in the method
> doExecuteWithResult of my XXXCreateComand, XXXReorientedComand etc. but
> I don't know How can I get the View Object.
> I'll ask in the GMF newsgroup.
>
> Thanks you very much for you help Dimitrios.
> ;)
Re: Automatic validation. [message #633728 is a reply to message #633552] Tue, 19 October 2010 06:55 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 18.10.10 13.42, Jose Miguel wrote:
>
> I have tried call ValidateAction.runValidation(...) in the method
> doExecuteWithResult of my XXXCreateComand, XXXReorientedComand etc. but
> I don't know How can I get the View Object.
> I'll ask in the GMF newsgroup.
>
> Thanks you very much for you help Dimitrios.
> ;)

GMF supports validating the model, so the question is how to trigger it.
A fairly generic solution is listening to changes to the command stack,
and then trigger the validation (that I think normally happens when you
save). Then you know that the command has completed, any model listeners
have reacted to model changes etc.

I think you can get hold of the command stack through the editing
domain. The EMF editor uses this technique to set the dirty flag of the
editor, so it should be fairly easy to find example code.

Hallvard
Previous Topic:switch-case null issue
Next Topic:Modify dynamically the icons of a node
Goto Forum:
  


Current Time: Fri Apr 19 21:39:03 GMT 2024

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

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

Back to the top