Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom cell editor in property sheet
Custom cell editor in property sheet [message #220324] Sun, 01 March 2009 22:18 Go to next message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
Hello
I'm trying to implement a custom celleditor for my own datatype. I want it
to appear in property sheet of one of the objects.

I've been following a short tutorial that can be found at:
http://www.jevon.org/wiki/Using_EDataTypes_in_GMF

So I've implemented my own CustomizedPropertyDescriptor and put there code
like this:

public CellEditor createPropertyEditor(Composite composite) {
if (dataType.equals(DeploymentPackage.eINSTANCE.getMyType())) {
...
return new ExtendedComboBoxCellEditor(composite, new
ArrayList<Object>(choiceOfValues), getEditLabelProvider(),
itemPropertyDescriptor.isSortChoices(object))
}

return super.createPropertyEditor(composite);
}

I get values for that particular CellEditor from some place, they appear
correctly in the editor and I can iterate through them. However I can't
select any of them - they become null. This weird behavior is cause by
UndoableModelPropertySheetEntry.applyEditorValue() and most of all this
function's ending:

...

else if (!editValue.equals(newValue))
changed = true;

// Set the editor value
if (changed)
setValue(newValue);

changed is never set to true, because editValue actually equals newValue.

Any ideas?

Marcin
[SOLVED] Re: Custom cell editor in property sheet [message #220393 is a reply to message #220324] Mon, 02 March 2009 20:26 Go to previous message
Marcin Cylke is currently offline Marcin CylkeFriend
Messages: 61
Registered: July 2009
Member
The problem was not with the Eclipse function ( :) ), I've missed proxying
the value through EDataTypeValueHandler.

After that small correction, things work ok.
Previous Topic:[Announce] GMF 2.2.0 I200902270802 is available
Next Topic:EMF Outline-View in GMF editor
Goto Forum:
  


Current Time: Thu Apr 25 07:27:02 GMT 2024

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

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

Back to the top