Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: AW: AW: AW: AW: [ve-dev] Overriding the Property-Editor inaSubclassdoesnotseem to work


Hi Peter,

Yeah, I was afraid of that. :-(  Both features still exist on the EMF class. It is just that when you look up the feature by name it will find the first feature from the bottom up, which means it finds the one from your subclass when lookup by name.

I think you may need to also supply a PropertySourceAdapter implementation for your RButton that inherits from BeanPropertySourceAdapter, and it overrides just one method:

protected boolean includeFeature(EStructuralFeature sfeature) {
               
        // Do not include the "text" feature from the base ULCBean.
        if (sfeature.getName().equals("text") && sfeature.getEContainingClass().getName().equals("ULCButton")
                return false;
        else        
                return super.includeFeature(sfeature);
}


Thanks,
Rich


"Peter Koch" <Peter.Koch@xxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

06/23/2006 11:11 AM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
AW: AW: AW: AW: AW: [ve-dev] Overriding the        Property-Editor        inaSubclassdoesnotseem to work





Hi Rich!

Thanks for your patience with me and your help.

You were right, I forgot to declare 2 namespaces in the header...

I think, we're getting closer... I have now the
funny thing that I have TWO "text" properties in the
property sheet for my RButton instance
and on the first one I've got my editor! :-) (see attachement).

any ideas ?

best regards,
peter


current RButton.override:

<?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:org.eclipse.ve.internal.cde.utility="http:///org/eclipse/ve/internal/cde/utility.ecore"
   xmlns:codeGenHelpers="platform:/plugin/org.eclipse.ve.java.core/overrides/codegenHelpers.ecore"
   xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:event="event.xmi"
   xmlns:org.eclipse.jem.java="java.xmi"
   xmlns:org.eclipse.jem.internal.beaninfo="http:///org/eclipse/jem/internal/beaninfo/beaninfo.ecore">
   
   <event:Add featureName="eAnnotations">
       <addedEObjects xsi:type="codeGenHelpers:CodeGenHelperClass"
           source="codegen.CodeGenHelperClass"
           expDecoder="RichDialogVisualEditor/ch.ivyteam.ivy.designer.richdialog.visualeditor.decoder.RTextPropertyDecoder"/>
   </event:Add>
   
   <event:Add featureName="eStructuralFeatures">
       <addedEObjects xsi:type="ecore:EReference" name="text"
           eType="org.eclipse.jem.java:JavaClass java:/java.lang#String"
           unsettable="true">
           <eAnnotations
               xsi:type="org.eclipse.ve.internal.cde.decorators:BasePropertyDecorator"
               cellEditorClassname="RichDialogVisualEditor/ch.ivyteam.ivy.designer.richdialog.visualeditor.propertyeditor.RTextPropertyEditor"/>
           <eAnnotations
               xsi:type="org.eclipse.jem.internal.beaninfo:PropertyDecorator"
               shortDescription="Text displayed on the button"
               readMethod="java:/ch.ivyteam.ivy.designer.richdialog.widgets.components#RButton.getText("
               writeMethod="java:/ch.ivyteam.ivy.designer.richdialog.widgets.components#RButton.setText(java.lang.String"/>
       </addedEObjects>
   </event:Add>
   
   <event:Add featureName="eAnnotations">
       <addedEObjects
           xsi:type="org.eclipse.ve.internal.cde.decorators:ClassDescriptorDecorator"
           graphViewClassname="com.canoo.ulc.visualeditor/com.canoo.ulc.visualeditor.gef.graphical.ULCComponentGraphicalEditPart:true">
           <graphic
               xsi:type="org.eclipse.ve.internal.cde.utility:GIFFileGraphic"
               resourceName="platform:/plugin/org.eclipse.ve.jfc/icons/full/clcl16/button_obj.gif"/>
           <keyedValues xsi:type="ecore:EStringToStringMapEntry"
               key="org.eclipse.ve.internal.cde.core.creationtool.policy"
               value="com.canoo.ulc.visualeditor/com.canoo.ulc.visualeditor.propertysheet.SetPropertyCreationPolicy:text=Button"/>
       </addedEObjects>
   </event:Add>
   
</xmi:XMI>
[attachment "winmail.dat" deleted by Rich Kulp/Raleigh/IBM] _______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top