Skip to main content



      Home
Home » Eclipse Projects » GEF » Vetoing property changes
Vetoing property changes [message #128029] Tue, 20 April 2004 04:43 Go to next message
Eclipse UserFriend
I am using the Property View to make changes to properties of
IPropertySources contained in a GEF model. This changes are made through a
non public command class called SetPropertyValueCommand.

Is there any way to veto a property change or tell someone that the command
should not be executed when some condition arises?

If I throw an exception within setPropertyValue the only thing I get is a
message telling me that some error occurred but unfortunately the undo
commad is set up the same way as no error happened. This is incorrect and
very annoying and misleading for the user.

In my each time more humble opinion some mechanism has to be build to deal
with this situation.

Jose M beleta
Re: Vetoing property changes [message #128055 is a reply to message #128029] Tue, 20 April 2004 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Have you tried using a validator on the PropertyDescriptor? Would this suit
your purpose?

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c62ngr$m7h$1@eclipse.org...
> I am using the Property View to make changes to properties of
> IPropertySources contained in a GEF model. This changes are made through a
> non public command class called SetPropertyValueCommand.
>
> Is there any way to veto a property change or tell someone that the
command
> should not be executed when some condition arises?
>
> If I throw an exception within setPropertyValue the only thing I get is a
> message telling me that some error occurred but unfortunately the undo
> commad is set up the same way as no error happened. This is incorrect and
> very annoying and misleading for the user.
>
> In my each time more humble opinion some mechanism has to be build to deal
> with this situation.
>
> Jose M beleta
>
>
Re: Vetoing property changes [message #128082 is a reply to message #128055] Tue, 20 April 2004 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Whitney,

Thank you for your hint. Yes a validator could be used. Is a little bit
expensive: you need to create a ICellEditorValidator and a
PropertyDescriptor for every PropertySource you have, because
ICellEditorValidator#isValid() only takes the new value as an argument.

This is not the way I expected but it should work.

Thanks again.

Jose M Beleta


"Whitney Sorenson" <none@us.ibm.com> escribi
Re: Vetoing property changes [message #128096 is a reply to message #128082] Tue, 20 April 2004 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I would have to say that would depend on the exact type of validating you
are doing. In the Logic Example, we use a single instance of
LogicNumberCellEditorValidator to validate all our PropertyDescriptors.

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c63ghk$rpg$1@eclipse.org...
> Whitney,
>
> Thank you for your hint. Yes a validator could be used. Is a little bit
> expensive: you need to create a ICellEditorValidator and a
> PropertyDescriptor for every PropertySource you have, because
> ICellEditorValidator#isValid() only takes the new value as an argument.
>
> This is not the way I expected but it should work.
>
> Thanks again.
>
> Jose M Beleta
>
>
> "Whitney Sorenson" <none@us.ibm.com> escribi
Re: Vetoing property changes [message #128107 is a reply to message #128096] Tue, 20 April 2004 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Yes, you are right, but unfortunately my validation depends on the
PropertySource, so I need to access it to validate the new property value.

Jose M Beleta

"Whitney Sorenson" <none@us.ibm.com> escribi
Re: Vetoing property changes [message #128133 is a reply to message #128107] Tue, 20 April 2004 17:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

When the IPropertySource interface was originally written, the source of the
property being set was always provided as a reference. But when it was
later refactored to reuse Jface CellEditors, this information was removed.
As you've noted, you can still fake it by creating specific descriptors for
each source.

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c63l7s$346$1@eclipse.org...
> Yes, you are right, but unfortunately my validation depends on the
> PropertySource, so I need to access it to validate the new property value.
>
> Jose M Beleta
>
> "Whitney Sorenson" <none@us.ibm.com> escribi
Re: Vetoing property changes [message #128212 is a reply to message #128133] Wed, 21 April 2004 15:34 Go to previous messageGo to next message
Eclipse UserFriend
By the way, do you know why PropertyDescriptor#getValidator is protected?

This prevent the use of the validator for other purposes like in
command#canExecute. It is all so complicated ...

Jose M Beleta

"Randy Hudson" <none@us.ibm.com> escribi
Re: Vetoing property changes [message #128382 is a reply to message #128212] Thu, 22 April 2004 12:58 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You can get it from the CellEditor.

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c66i17$lv6$1@eclipse.org...
> By the way, do you know why PropertyDescriptor#getValidator is protected?
>
> This prevent the use of the validator for other purposes like in
> command#canExecute. It is all so complicated ...

yup, but most of it for a reason.

> Jose M Beleta
>
> "Randy Hudson" <none@us.ibm.com> escribi
Previous Topic:Need help with zoom in draw2D
Next Topic:GEF viewer in EMF generated editor
Goto Forum:
  


Current Time: Thu Jul 17 23:35:41 EDT 2025

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

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

Back to the top