Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Validation]How to validate my diagrams without opening the diagram editor
[Validation]How to validate my diagrams without opening the diagram editor [message #508866] Wed, 20 January 2010 15:22 Go to next message
Eclipse UserFriend
Originally posted by: santiagovelasco.mail.com

Is there a way to validate these diagrams without opening them in the
editor, I would like to do this programatically, possibly through a
builder... but any way without opening the editor would be a great start.

Any advice would be greatly appreciated.

Thanks
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #508891 is a reply to message #508866] Wed, 20 January 2010 16:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Santiago,

It's not entirely clear what you mean by "these diagrams." You'll need
to load the resource into a resource set much like the editor does and
then invoke the same validation logic as the editor's validate action
does. This article might help:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/references/overview/EMF.Validation.html

santiago wrote:
> Is there a way to validate these diagrams without opening them in the
> editor, I would like to do this programatically, possibly through a
> builder... but any way without opening the editor would be a great start.
>
> Any advice would be greatly appreciated.
>
> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #512694 is a reply to message #508891] Sat, 06 February 2010 07:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: santiagovelasco.mail.com

Hi Ed

sorry, i think, i should have explained in more detail.

I am already loading the resource as you said, and i am using the
method "runValidation(View view)" in my XXX.diagram.part.validationAction.
in which the createMarkers method is called.

when the markers are set, they are listed in the problems view and
attached to the element in the editor. now, since i may have large
amount of non opened editors, and the call of validation is done
programatically, all editors will be opened by setting the markers.

What i want is to avoid this situation. i only want the errors to get
listed in the problems view. but nevertheless when the user clicks on
the problems view to be redirected to the editor where the element
causing the problem is.

Thanks
Santiago







Ed Merks escribió:
> Santiago,
>
> It's not entirely clear what you mean by "these diagrams." You'll need
> to load the resource into a resource set much like the editor does and
> then invoke the same validation logic as the editor's validate action
> does. This article might help:
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/references/overview/EMF.Validation.html
>
>
> santiago wrote:
>> Is there a way to validate these diagrams without opening them in the
>> editor, I would like to do this programatically, possibly through a
>> builder... but any way without opening the editor would be a great start.
>>
>> Any advice would be greatly appreciated.
>>
>> Thanks
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #512718 is a reply to message #512694] Sat, 06 February 2010 18:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Santiago,

I'm not sure what's causing all the editors to be opened on all the
markers. Did you track down which code is doing that?


santiago wrote:
> Hi Ed
>
> sorry, i think, i should have explained in more detail.
>
> I am already loading the resource as you said, and i am using the
> method "runValidation(View view)" in my
> XXX.diagram.part.validationAction.
> in which the createMarkers method is called.
>
> when the markers are set, they are listed in the problems view and
> attached to the element in the editor. now, since i may have large
> amount of non opened editors, and the call of validation is done
> programatically, all editors will be opened by setting the markers.
>
> What i want is to avoid this situation. i only want the errors to get
> listed in the problems view. but nevertheless when the user clicks on
> the problems view to be redirected to the editor where the element
> causing the problem is.
>
> Thanks
> Santiago
>
>
>
>
>
>
>
> Ed Merks escribió:
>> Santiago,
>>
>> It's not entirely clear what you mean by "these diagrams." You'll
>> need to load the resource into a resource set much like the editor
>> does and then invoke the same validation logic as the editor's
>> validate action does. This article might help:
>> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/references/overview/EMF.Validation.html
>>
>>
>> santiago wrote:
>>> Is there a way to validate these diagrams without opening them in
>>> the editor, I would like to do this programatically, possibly
>>> through a builder... but any way without opening the editor would be
>>> a great start.
>>>
>>> Any advice would be greatly appreciated.
>>>
>>> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #514283 is a reply to message #512718] Sat, 13 February 2010 11:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: santiagovelasco.mail.com

Hi Ed

well, so far i could track it, i can tell the editor would be oppened
when the attributes of the markers are being set.

setting the attributes is done in the addMarker method "public static
IMarker addMarker(IFile file, String elementId, String location, String
message, int statusSeverity)" in the XXXMarkerNavigationProvider

i am not sure what is happening there.
for example when the marker severity is not set, the editor does not get
oppened, the problems get listed in the problems view, but ofcourse not
with the right severity, therefore when double clicking on them a null
pointer exception will be fired.

thanks

sanitago



Ed Merks escribió:
> Santiago,
>
> I'm not sure what's causing all the editors to be opened on all the
> markers. Did you track down which code is doing that?
>
>
> santiago wrote:
>> Hi Ed
>>
>> sorry, i think, i should have explained in more detail.
>>
>> I am already loading the resource as you said, and i am using the
>> method "runValidation(View view)" in my
>> XXX.diagram.part.validationAction.
>> in which the createMarkers method is called.
>>
>> when the markers are set, they are listed in the problems view and
>> attached to the element in the editor. now, since i may have large
>> amount of non opened editors, and the call of validation is done
>> programatically, all editors will be opened by setting the markers.
>>
>> What i want is to avoid this situation. i only want the errors to get
>> listed in the problems view. but nevertheless when the user clicks on
>> the problems view to be redirected to the editor where the element
>> causing the problem is.
>>
>> Thanks
>> Santiago
>>
>>
>>
>>
>>
>>
>>
>> Ed Merks escribió:
>>> Santiago,
>>>
>>> It's not entirely clear what you mean by "these diagrams." You'll
>>> need to load the resource into a resource set much like the editor
>>> does and then invoke the same validation logic as the editor's
>>> validate action does. This article might help:
>>> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/references/overview/EMF.Validation.html
>>>
>>>
>>> santiago wrote:
>>>> Is there a way to validate these diagrams without opening them in
>>>> the editor, I would like to do this programatically, possibly
>>>> through a builder... but any way without opening the editor would be
>>>> a great start.
>>>>
>>>> Any advice would be greatly appreciated.
>>>>
>>>> Thanks
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #517642 is a reply to message #514283] Mon, 01 March 2010 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: santiagovelasco.mail.com

Hi Ed

well, so far i could track it, i can tell the editor would be oppened
when the attributes of the markers are being set.

setting the attributes is done in the addMarker method "public static
IMarker addMarker(IFile file, String elementId, String location, String
message, int statusSeverity)" in the XXXMarkerNavigationProvider

i am not sure what is happening there.
for example when the marker severity is not set, the editor does not get
oppened, the problems get listed in the problems view, but ofcourse not
with the right severity, therefore when double clicking on them a null
pointer exception will be fired.

thanks

sanitago
Re: [Validation]How to validate my diagrams without opening the diagram editor [message #517650 is a reply to message #517642] Mon, 01 March 2010 15:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Santigo,

Comments below.


santiago wrote:
> Hi Ed
>
> well, so far i could track it, i can tell the editor would be oppened
> when the attributes of the markers are being set.
>
> setting the attributes is done in the addMarker method "public static
> IMarker addMarker(IFile file, String elementId, String location,
> String message, int statusSeverity)" in the XXXMarkerNavigationProvider
That's a GMF thing though, so unfortunately I'm not in a position to
help with that.
>
> i am not sure what is happening there.
> for example when the marker severity is not set, the editor does not
> get oppened, the problems get listed in the problems view, but
> ofcourse not with the right severity, therefore when double clicking
> on them a null pointer exception will be fired.
That sounds bad. It's best to ask about it on the GMF newsgroup.
>
> thanks
>
> sanitago


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] recommendations for handling conflicts between multiple cdo-server clients
Next Topic:Use different nsURI during save
Goto Forum:
  


Current Time: Fri Apr 26 18:12:03 GMT 2024

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

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

Back to the top