Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » proper way to constrain org.eclipse.gef.ui.properties.SetValueCommand for an IPropertySource?
proper way to constrain org.eclipse.gef.ui.properties.SetValueCommand for an IPropertySource? [message #205670] Tue, 20 December 2005 16:22 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
I am trying to constrain an IPropertySource and display an error if the
constraint is hit. Unfortunely it seems that
IPropertySource.setPropertyValue is getting getting called multiple times
when the value in the cell editor chnages.

First Time: I catch it and do not set the value of the internal model
object.
Second Time: Cell editor reverts text to the previous (done automagically)
Third Time : Chnage selection causes setPropertyValue to be called again.
(done automagically)


Is there a better way to constrain the propertySource values. (The value is
a text string that I need to check).
Re: proper way to constrain org.eclipse.gef.ui.properties.SetValueCommand for an IPropertySource? [message #205696 is a reply to message #205670] Tue, 20 December 2005 18:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You should be constraining the value by setting a validator on the
celleditor when the descriptor constructs the cell editor.

"Drew" <drew@acm.org> wrote in message
news:do9b3g$ca4$1@utils.eclipse.org...
>I am trying to constrain an IPropertySource and display an error if the
> constraint is hit. Unfortunely it seems that
> IPropertySource.setPropertyValue is getting getting called multiple times
> when the value in the cell editor chnages.
>
> First Time: I catch it and do not set the value of the internal model
> object.
> Second Time: Cell editor reverts text to the previous (done automagically)
> Third Time : Chnage selection causes setPropertyValue to be called again.
> (done automagically)
>
>
> Is there a better way to constrain the propertySource values. (The value
> is
> a text string that I need to check).
>
>
>
>
Re: proper way to constrain org.eclipse.gef.ui.properties.SetValueCommand for an IPropertySource? [message #205726 is a reply to message #205670] Wed, 21 December 2005 13:55 Go to previous message
Eclipse UserFriend
Originally posted by: marian.schedenig.gft.com

Drew schrieb:
> Unfortunely it seems that
> IPropertySource.setPropertyValue is getting getting called multiple times
> when the value in the cell editor chnages.

I'm having the same problem; I posted a question on Dec 16, but didn't
get an answer so far. In my case, the problem is that the displayed
value may differ from the value the user entered (stripped spaces etc.),
which causes the property to be set twice. I'm still looking for a way
to prevent this.

Marian.
Previous Topic:popup menu
Next Topic:Documentation for GEF 3.2M3
Goto Forum:
  


Current Time: Tue Jan 21 19:52:27 GMT 2025

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

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

Back to the top