Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: [ve-dev] Overriding the Property-Editor in a Subclass does notseem to work


Hi,
You can do it through the beaninfo, but if you don't have one it would be easier to do it through the override file.

I wish you were at 1.2 because the format of the override file changes and I had to go back and try to dig up the old format. :-)

I think this will do it:

<?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:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:event="event.xmi" xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore">
  <event:Add featureName="eStructuralFeatures">
    <addedEObjects xsi:type="ecore:EReference" name="text" eType="org.eclipse.jem.internal.java:JavaClass java:/java.lang#String" unsettable="true">
      <eAnnotations xsi:type="org.eclipse.ve.internal.cde.decorators:BasePropertyDecorator"
        cellEditorClassname="...your cell editor to use..."/>
    </addedEObjects>
  </event:Add>
</xmi:XMI>

Rich


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

06/21/2006 10:19 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: [ve-dev] Overriding the Property-Editor in a Subclass does        notseem        to work





Hi Rich!

Thanks for the answer.

"You would have to completely redefine the property at the RButton level. You would have to completely specify it".

How could I redefine the property? How to completely specify it?
Thru writing a custom BeanInfo class?

Thanks & best regards,
Peter


-----Ursprüngliche Nachricht-----
Von: ve-dev-bounces@xxxxxxxxxxx im Auftrag von Rich Kulp
Gesendet: Mi 21.06.2006 16:06
An: Discussions people developing code for the Visual Editor project
Betreff: Re: [ve-dev] Overriding the Property-Editor in a Subclass does notseem                 to work

Hello,

There isn't really a safe way to do that. You would have to completely
redefine the property at the RButton level. You would have to completely
specify it.

As long as the "text" property isn't a special property that some super
class may access directly through the ULCButton's text estructuralfeature
it may work. An example of an override that wouldn't work is to try to
change the "components" feature of the awt Container. That is because this
is a very special feature that is used directly and is not looked up by
name. Because of that it would find the awt Component's feature. In your
case I don't think this is true. Everywhere the feature is probably looked
up by name and so it will find your feature first.

Rich



"Peter Koch" <Peter.Koch@xxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
06/21/2006 09:19 AM
Please respond to
Discussions people developing code for the Visual Editor project
<ve-dev@xxxxxxxxxxx>


To
<ve-dev@xxxxxxxxxxx>
cc

Subject
[ve-dev] Overriding the Property-Editor in a Subclass does not seem     to
work






Hi!

I'm currently writing a plugin which customizes
the ULC VE plugin (own widgets, different palette,
other property-editors, ...).

I'm struggling about the following problem:

I have a class RButton which extends ULCButton.
In my RButton.override I'd like to define an own
property editor for the "text" property
(like in MyCustomPrompter.override from the VE tutorial).

But this does not work.

Overriding of property editors for properties which
already have defined a property editor
for a property in a superclass generally
does not seem to be possible.

If I make an own property like "buttonText", everything is fine.
But this is only a workaround.

(I'm working with ULC VE 5.0 which bases on VE 1.1.0.1)


Any ideas, comments ?

Thanks & best regards,
Peter Koch
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev

Attachment: winmail.dat
Description: Binary data


Back to the top