Override property problem [message #612226] |
Wed, 01 March 2006 09:38 |
Eclipse User |
|
|
|
I have class which has String attributes
For example
public class Person{
String name;
public String getName(){
return name;
}
public String setName(String name){
this.name=name;
}
}
Let's say that this class is visualised in the VE editor and the
attribute "name" is displayed and can be edited in the Properties view.
I do not know how to associate my own cell editor (for the Properties
view) with the attribute name.
I have tried to use the approach from the "Extending The Visual Editor:
Enabling support for a custom widget tutorial" I made something like this:
I created the Person.override file and made all things to make it work.
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:event="event.xmi">
<event:Add featureName="eStructuralFeatures">
<addedEObjects xsi:type="ecore:EReference" name="name"
unsettable="true">
<eAnnotations
xsi:type=" org.eclipse.ve.internal.cde.decorators:BasePropertyDecorator "
cellEditorClassname="me.testpackage/me.myTestPackage.MyPersonCellEditor "/>
</addedEObjects>
</event:Add>
</xmi:XMI>
The problem is that the "name" attribute of the Person class is still
edited by the default editor for the Strings:-(. (The override is
applied to the person class).
|
|
|
Powered by
FUDForum. Page generated in 0.02951 seconds