Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Deleting markers
Deleting markers [message #416688] Tue, 12 February 2008 16:19 Go to next message
Damien Thivolle is currently offline Damien ThivolleFriend
Messages: 25
Registered: July 2009
Junior Member
Hello,

I've been trying to play around with the MarkerUtil class provided by
EMF. I noticed that, when using the general validation example, the
error marker (cause by an empty library name) does not disappear after a
successful validation (library name no longer empty).

I've taken a look at the source code and well the MarkerUtil does not
provide anything else than methods for creating markers. When I saw the
name of that class I imagined it would provide something to handle the
validation status and take action accordingly:
- deleting a previously created marker if the validation was a success,
- creating a new marker if the validation failed.

I hope you will find this comment interesting.

Is there any way to add a few lines of code to the general validation
example to remove the markers after a successful validation?

I could simply get the current file under validation and call the
_deleteMarkers_ method with the proper list of arguments but that just
wouldn't feel right to do so..

Many thanks in advance,

--
Damien THIVOLLE
[Validation] Re: Deleting markers [message #416689 is a reply to message #416688] Tue, 12 February 2008 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Damien,

Please use [Validation] in the subject for questions about the EMF
Validation Framework component. Thanks.

See some responses to your questions in-line, below.

HTH,

Christian

Damien Thivolle wrote:

> Hello,
>
> I've been trying to play around with the MarkerUtil class provided by
> EMF. I noticed that, when using the general validation example, the
> error marker (cause by an empty library name) does not disappear after a
> successful validation (library name no longer empty).

I thought the the example first cleared the markers of the resource that is
being validated. Perhaps that has changed; the example might enhancement,
there, although working with markers isn't really a primary focus of the
example.


> I've taken a look at the source code and well the MarkerUtil does not
> provide anything else than methods for creating markers. When I saw the
> name of that class I imagined it would provide something to handle the
> validation status and take action accordingly:
> - deleting a previously created marker if the validation was a success,
> - creating a new marker if the validation failed.
>
> I hope you will find this comment interesting.

These may be useful enhancements. Note, however, that the reporting of "OK"
status messages in the results of validation is optional, so there are a
variety of cases to consider in determine the differences in the marker
states.

Contributions are welcome!


> Is there any way to add a few lines of code to the general validation
> example to remove the markers after a successful validation?

Yes. You can contribute a patch in the bugzilla database. :-)


> I could simply get the current file under validation and call the
> _deleteMarkers_ method with the proper list of arguments but that just
> wouldn't feel right to do so..

Why not? I have seen plenty of applications take exactly this approach.


> Many thanks in advance,
>
Re: [Validation] Re: Deleting markers [message #416691 is a reply to message #416689] Tue, 12 February 2008 17:40 Go to previous messageGo to next message
Damien Thivolle is currently offline Damien ThivolleFriend
Messages: 25
Registered: July 2009
Junior Member
Christian W. Damus a écrit :
> Hi, Damien,
>
> Please use [Validation] in the subject for questions about the EMF
> Validation Framework component. Thanks.

Will do from now on :)

>
> See some responses to your questions in-line, below.
>
> HTH,
>
> Christian
>
> Damien Thivolle wrote:
>
>> Hello,
>>
>> I've been trying to play around with the MarkerUtil class provided by
>> EMF. I noticed that, when using the general validation example, the
>> error marker (cause by an empty library name) does not disappear after a
>> successful validation (library name no longer empty).
>
> I thought the the example first cleared the markers of the resource that is
> being validated. Perhaps that has changed; the example might enhancement,
> there, although working with markers isn't really a primary focus of the
> example.
>

I've checked the current version on the cvs and it looks exactly like
the one I have so I guess it doesn't clear the markers anymore.

>
>> I've taken a look at the source code and well the MarkerUtil does not
>> provide anything else than methods for creating markers. When I saw the
>> name of that class I imagined it would provide something to handle the
>> validation status and take action accordingly:
>> - deleting a previously created marker if the validation was a success,
>> - creating a new marker if the validation failed.
>>
>> I hope you will find this comment interesting.
>
> These may be useful enhancements. Note, however, that the reporting of "OK"
> status messages in the results of validation is optional, so there are a
> variety of cases to consider in determine the differences in the marker
> states.
>
> Contributions are welcome!
>
>
>> Is there any way to add a few lines of code to the general validation
>> example to remove the markers after a successful validation?
>
> Yes. You can contribute a patch in the bugzilla database. :-)
>

I will make some proposals tomorrow.

>
>> I could simply get the current file under validation and call the
>> _deleteMarkers_ method with the proper list of arguments but that just
>> wouldn't feel right to do so..
>
> Why not? I have seen plenty of applications take exactly this approach.
>

Because these markers were created by MarkerUtil, it would be normal, I
think, that this class also takes care of removing them when they are no
longer needed.

I guess it's possible implement some deleteMarkers method in MarkerUtil.
But at first glance it seemed to me that there should be handler
method in that class that would process the validation results and
update the markers accordingly. That's just a first glance thought, I
don't really know if that class is used for other purposes, etc.

Thanks for your answers,

Best regards,

--
Damien THIVOLLE | INRIA Rhone-Alpes / VASY
PHD Student | 655, Avenue de l'Europe
damien.thivolle@inria.fr | Montbonnot
http://www.inrialpes.fr/vasy | 38 334 Saint Ismier Cedex France
Re: [Validation] Re: Deleting markers [message #416704 is a reply to message #416691] Wed, 13 February 2008 14:30 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Damien,

I see that you have raised bugzillae for these issues. Thanks! I look
forward to your contribution.

cW

Damien Thivolle wrote:

> Christian W. Damus a écrit :
>> Hi, Damien,
>>
>> Please use [Validation] in the subject for questions about the EMF
>> Validation Framework component. Thanks.
>
> Will do from now on :)
>
>>
>> See some responses to your questions in-line, below.
>>
>> HTH,
>>
>> Christian
>>
>> Damien Thivolle wrote:
>>
>>> Hello,
>>>
>>> I've been trying to play around with the MarkerUtil class provided by
>>> EMF. I noticed that, when using the general validation example, the
>>> error marker (cause by an empty library name) does not disappear after a
>>> successful validation (library name no longer empty).
>>
>> I thought the the example first cleared the markers of the resource that
>> is
>> being validated. Perhaps that has changed; the example might
>> enhancement, there, although working with markers isn't really a primary
>> focus of the example.
>>
>
> I've checked the current version on the cvs and it looks exactly like
> the one I have so I guess it doesn't clear the markers anymore.
>
>>
>>> I've taken a look at the source code and well the MarkerUtil does not
>>> provide anything else than methods for creating markers. When I saw the
>>> name of that class I imagined it would provide something to handle the
>>> validation status and take action accordingly:
>>> - deleting a previously created marker if the validation was a
>>> success, - creating a new marker if the validation failed.
>>>
>>> I hope you will find this comment interesting.
>>
>> These may be useful enhancements. Note, however, that the reporting of
>> "OK" status messages in the results of validation is optional, so there
>> are a variety of cases to consider in determine the differences in the
>> marker states.
>>
>> Contributions are welcome!
>>
>>
>>> Is there any way to add a few lines of code to the general validation
>>> example to remove the markers after a successful validation?
>>
>> Yes. You can contribute a patch in the bugzilla database. :-)
>>
>
> I will make some proposals tomorrow.
>
>>
>>> I could simply get the current file under validation and call the
>>> _deleteMarkers_ method with the proper list of arguments but that just
>>> wouldn't feel right to do so..
>>
>> Why not? I have seen plenty of applications take exactly this approach.
>>
>
> Because these markers were created by MarkerUtil, it would be normal, I
> think, that this class also takes care of removing them when they are no
> longer needed.
>
> I guess it's possible implement some deleteMarkers method in MarkerUtil.
> But at first glance it seemed to me that there should be handler
> method in that class that would process the validation results and
> update the markers accordingly. That's just a first glance thought, I
> don't really know if that class is used for other purposes, etc.
>
> Thanks for your answers,
>
> Best regards,
>
Previous Topic:OutOfMemoryError during EMF model code generation from XSD source
Next Topic:EMF - Default Valued Feature
Goto Forum:
  


Current Time: Fri Apr 26 23:49:04 GMT 2024

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

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

Back to the top