Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » comboboxcelleditor not firing
comboboxcelleditor not firing [message #652622] Fri, 04 February 2011 18:11 Go to next message
Ravi Kiran is currently offline Ravi KiranFriend
Messages: 41
Registered: December 2010
Member
As a part of making gmf editor i want to return a comboboxcelleditor for certain datatypes(enum) in my metamodel

so i have implemented my own property descriptor and returned comboboxcelleditor as a cell editor.

but in the gmf editor when i click on show property view, for that data type it's displaying a uneditable default value(default value given enum datatype.

what do i do if i want to show a comboboxcelleditor for that enum datatype


customized proprty descriptor
below DNTypes is the enum data type declared in the meta model.
if everything works fine it should show type1,type2.. in combobox but it isn't showing up
------------------------------------------------------------ -------------
public CellEditor createPropertyEditor(Composite composite) {
CellEditor result=super.createPropertyEditor(composite);

if (result==null)
{
return null;
}


EClassifier eType = ((EStructuralFeature) itemPropertyDescriptor
.getFeature(object)).getEType();

if (eType instanceof EDataType) {
EDataType eDataType = (EDataType) eType;
if(eDataType.getInstanceClass() == DNTypes.class)
{
String s[]={"type1","type2","type3","type4"};
ComboBoxCellEditor cbe=new ComboBoxCellEditor(composite.getParent(),s,getEditLabelProvi der);
cbe.setActivationStyle(0);


return cbe;
//return result;

}

}

return result;
}


}
------------------------------------------------------------ -----------

any pointers how to proceed
Re: comboboxcelleditor not firing [message #663392 is a reply to message #652622] Mon, 04 April 2011 20:17 Go to previous messageGo to next message
Aurelien Pupier is currently offline Aurelien PupierFriend
Messages: 574
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I remember that there are more work to do.

Have you already ake a look at this article: http://www.jevon.org/wiki/Using_EDataTypes_in_GMF

Otherwise, I have done it in Jasmine Design: http://wiki.jasmine.ow2.org/xwiki/bin/view/Main/Design
But it was some time ago, I won't able to guide you more.

Regards,


Aurélien Pupier - Bonitasoft S.A.
My company Eclipse-related blog
Re: comboboxcelleditor not firing [message #758588 is a reply to message #663392] Wed, 23 November 2011 19:30 Go to previous message
Hoang  is currently offline Hoang Friend
Messages: 45
Registered: September 2011
Location: Milan
Member
Hi Aurelien,

Thanks for the post, it is very helpful. I have succeeded to create my own File Selector in the property sheet. You're the hero!

My solution is here if someone is interested: https://github.com/pnhoang/Selflet

Hoang,

Previous Topic:Saving diagram drawn on the GMF Editor
Next Topic:How to know the size of the Diagram
Goto Forum:
  


Current Time: Sat Nov 29 02:54:04 GMT 2014

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

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