Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem(Problem when using live validation in the property viewer)
UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem [message #697981] Mon, 18 July 2011 14:36 Go to next message
baudryvincent is currently offline baudryvincent
Messages: 5
Registered: July 2011
Junior Member
Hi,

I got the following issue in Eclipse 3.6 :

I'm using live validation in Eclipse / EMF / GMF. In the property viewer, when I change a combo box value for a wrong one, the validation is correctly triggered a first time, and an error popup is correctly shown. But after this, when I click anywhere in Eclipse, the change of active part launches the validation again. It's not optimal but won't be a problem, except the wrong value is kept and applied a second time, and I got the error message again.

I've traced the problem. When first initialized, the CCombo attached to my UndoableModelPropertySheetEntry has its selection correctly initialized with the correct value (in the PropertySheetEntry.getEditor() method). Then when I change the value for a wrong one (validation speaking), the SelectionListener attached to the ComboBoxCellEditor launches widgetSelected(), and the internal "selection" attribute is set to the new index.

After that the UndoableModelPropertySheetEntry.setValue() method calls the validation, and if the validation status is ok, sets definitely the new value. In my case it does not, which is correct, but the "selection" attribute keeps the same value.

When the main editor is activated by clicking on it, as the same object had the focus in this editor before (which is why I was able to edit the corresponding properties), it sets the same input to the property viewer. That's also fine, except the Property Editor doesn't have the focus in the meantime and it doesn't not reset the "selection" attribute via the getEditor(), that still is referencing the wrong value. So the UndoableModelPropertySheetEntry.setValue() retrieves it indirectly (by asking the combo is current selection), and sets this wrong value again (because it's still different from the value it knows), launching the validation again ...

Does someone have an idea what I can do to prevent this behaviour ? Considering all this code (except the validation class) is generic GMF/EMF code ?
Re: UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem [message #705183 is a reply to message #697981] Fri, 29 July 2011 14:40 Go to previous messageGo to next message
baudryvincent is currently offline baudryvincent
Messages: 5
Registered: July 2011
Junior Member
Filled a bug entry #352578

(Cannot post links yet)
Re: UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem [message #715089 is a reply to message #705183] Fri, 12 August 2011 10:40 Go to previous messageGo to next message
vinny503 Missing name is currently offline vinny503 Missing name
Messages: 156
Registered: August 2011
Senior Member
Hi

I am not familiar with the gmf source code generated..\
My requirement is when I right click on node, it should show have some kind of
pop up window, where I can add new parameters to it.

Thanks Inadvance,
Vinay
Re: UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem [message #715987 is a reply to message #697981] Tue, 16 August 2011 07:09 Go to previous messageGo to next message
vinny503 Missing name is currently offline vinny503 Missing name
Messages: 156
Registered: August 2011
Senior Member
Hi

I have 1 small requirement....
I have the default values set for node in gmf editor....
When I launch the application I edit only the name of the node and corresponding xml
generated has only the name attribute. I dont see the remaining attributes for
node (which was set some default values) in the xml file generated.
How to get that in xml without editing default values ??

thanks,
vinay
Re: UndoableModelPropertySheetEntry and ComboBoxCellEditor validation problem [message #905408 is a reply to message #697981] Thu, 30 August 2012 10:37 Go to previous message
Alex B is currently offline Alex B
Messages: 1
Registered: August 2012
Junior Member
im having the same problem as baudryvincent. does anyone know a solution to this?
Previous Topic:Use a model as a library
Next Topic:Several diagrams for large models
Goto Forum:
  


Current Time: Sat Oct 25 16:57:08 GMT 2014

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

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