Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Cell Editor and Inheritance
Cell Editor and Inheritance [message #111589] Wed, 30 November 2005 09:39 Go to next message
Eclipse UserFriend
Originally posted by: SLENGAIGNE_Prestataire.cofidis.fr

Hello,

I need help.

I have a class, "AbstractField" which has a property "validationRules". To
set this propety I have created a customized cell Editor.

The class "Field" extends AbstractField. I want his property "pattern" to
be settable with an other specific cell editor.

For each class i've defined an override file.

The problem is I'm not able to use the both cell editors for the class
Field. VE throws Errors.

- If I only use the AbstractField.override file, the inherited property
validationRules of the class Field is settable with the cell editor.
- If I only use the Field.override file, pattern is settable with his cell
editor.
- If I use the both files, java.lang.ClassCastException...

Here is AbstractField.override

<event:Add featureName="eStructuralFeatures">
<addedEObjects xsi:type="ecore:EReference"
name="validationRules">
<eAnnotations
xsi:type=" org.eclipse.ve.internal.cde.decorators:BasePropertyDecorator "
cellEditorClassname=" cofidis.ide.gui.ve/cofidis.rcp.gui.ve.celleditor.ValidatorSe lectionLabelEditor "
/>
</addedEObjects>
</event:Add>


Field.override

<event:Add featureName="eStructuralFeatures">
<addedEObjects xsi:type="ecore:EReference" name="pattern">
<eAnnotations
xsi:type=" org.eclipse.ve.internal.cde.decorators:BasePropertyDecorator "
cellEditorClassname=" cofidis.ide.gui.ve/cofidis.rcp.gui.ve.celleditor.PatternSele ctionLabelEditor "
/>
</addedEObjects>
</event:Add>


Thanks for your help
Simon Lengaigne
Re: Cell Editor and Inheritance [message #111922 is a reply to message #111589] Wed, 30 November 2005 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: SLENGAIGNE_Prestataire.cofidis.fr

I have accidentally found a solution that seems to work but I don't
understand why...

Apparently, the problem comes from the way I register the override files
in the plugin.xml file.

Here is the old declaration that doesn't works.

<extension point="org.eclipse.jem.beaninfo.registrations">
<registration plugin="xxx.rcp.gui">
<override package="xxx.rcp.gui.form.impl"
path="resources/overrides/xxx/rcp/gui/form/impl" />
<override package="xxx.rcp.gui.form"
path="resources/overrides/xxx/rcp/gui/form" />
<beaninfo path="beaninfo.jar">
<searchpath package="xxx.rcp.gui.form" />
<searchpath package="xxx.rcp.gui.form.impl" />
</beaninfo>
</registration>
</extension>

Here is the good one

<extension point="org.eclipse.jem.beaninfo.registrations">
<registration plugin="xxx.rcp.gui">
<override package="xxx.rcp.gui.form"
path="resources/overrides/xxx/rcp/gui/form" />
<beaninfo path="beaninfo.jar">
<searchpath package="xxx.rcp.gui.form" />
<searchpath package="xxx.rcp.gui.form.impl" />
</beaninfo>
</registration>
</extension>

I don't understand how VE is able to find the Field.override file. His
location is specified in the deleted override entry...

Thanks
Simon Lengaigne
Re: Cell Editor and Inheritance [message #111939 is a reply to message #111922] Wed, 30 November 2005 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It's because impl is a subdirectory of form, so you don't need both. I
think it got confused and try to apply the Field.override twice because
it found it twice, once from the form entry and once from the form.impl
entry.

Taking your example the way the override works is if your java class is
xxx.rcp.gui.form.impl.Field.override, it does pattern matching. The
first registration was for xxx.rcp.gui.form.impl. It matches the
starting part of your package with this. It then strips this part off
and looks in the requested directory. So it strips off
xxx.rcp.gui.form.impl and looks for the file
resources/overrides/xxx/rcp/gui/form/impl/Field.override.

Then it matches your class against xxx.rcp.gui.form. So it strips this
part off (leaving impl.Field), and prepends with the path, so it looks
for resources/overridex/xxx/rcp/gui/form plus impl/Field.override,
because impl.Field was what was left over after stripping the matching
part off.

Simon Lengaigne wrote:
> I have accidentally found a solution that seems to work but I don't
> understand why...
>
> Apparently, the problem comes from the way I register the override files
> in the plugin.xml file.
>
> Here is the old declaration that doesn't works.
>
> <extension point="org.eclipse.jem.beaninfo.registrations">
> <registration plugin="xxx.rcp.gui">
> <override package="xxx.rcp.gui.form.impl"
> path="resources/overrides/xxx/rcp/gui/form/impl" />
> <override package="xxx.rcp.gui.form"
> path="resources/overrides/xxx/rcp/gui/form" />
> <beaninfo path="beaninfo.jar">
> <searchpath package="xxx.rcp.gui.form" />
> <searchpath package="xxx.rcp.gui.form.impl" />
> </beaninfo>
> </registration>
> </extension>
>
> Here is the good one
>
> <extension point="org.eclipse.jem.beaninfo.registrations">
> <registration plugin="xxx.rcp.gui">
> <override package="xxx.rcp.gui.form"
> path="resources/overrides/xxx/rcp/gui/form" />
> <beaninfo path="beaninfo.jar">
> <searchpath package="xxx.rcp.gui.form" />
> <searchpath package="xxx.rcp.gui.form.impl" />
> </beaninfo>
> </registration>
> </extension>
>
> I don't understand how VE is able to find the Field.override file. His
> location is specified in the deleted override entry...
>
> Thanks
> Simon Lengaigne
>

--
Thanks,
Rich Kulp
Re: Cell Editor and Inheritance [message #112042 is a reply to message #111939] Thu, 01 December 2005 10:09 Go to previous message
Eclipse UserFriend
Originally posted by: SLENGAIGNE_Prestataire.cofidis.fr

Thanks for your explanations.

Simon
Re: Cell Editor and Inheritance [message #611377 is a reply to message #111589] Wed, 30 November 2005 10:22 Go to previous message
Simon Lengaigne is currently offline Simon LengaigneFriend
Messages: 9
Registered: July 2009
Junior Member
I have accidentally found a solution that seems to work but I don't
understand why...

Apparently, the problem comes from the way I register the override files
in the plugin.xml file.

Here is the old declaration that doesn't works.

<extension point="org.eclipse.jem.beaninfo.registrations">
<registration plugin="xxx.rcp.gui">
<override package="xxx.rcp.gui.form.impl"
path="resources/overrides/xxx/rcp/gui/form/impl" />
<override package="xxx.rcp.gui.form"
path="resources/overrides/xxx/rcp/gui/form" />
<beaninfo path="beaninfo.jar">
<searchpath package="xxx.rcp.gui.form" />
<searchpath package="xxx.rcp.gui.form.impl" />
</beaninfo>
</registration>
</extension>

Here is the good one

<extension point="org.eclipse.jem.beaninfo.registrations">
<registration plugin="xxx.rcp.gui">
<override package="xxx.rcp.gui.form"
path="resources/overrides/xxx/rcp/gui/form" />
<beaninfo path="beaninfo.jar">
<searchpath package="xxx.rcp.gui.form" />
<searchpath package="xxx.rcp.gui.form.impl" />
</beaninfo>
</registration>
</extension>

I don't understand how VE is able to find the Field.override file. His
location is specified in the deleted override entry...

Thanks
Simon Lengaigne
Re: Cell Editor and Inheritance [message #611382 is a reply to message #111922] Wed, 30 November 2005 14:43 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It's because impl is a subdirectory of form, so you don't need both. I
think it got confused and try to apply the Field.override twice because
it found it twice, once from the form entry and once from the form.impl
entry.

Taking your example the way the override works is if your java class is
xxx.rcp.gui.form.impl.Field.override, it does pattern matching. The
first registration was for xxx.rcp.gui.form.impl. It matches the
starting part of your package with this. It then strips this part off
and looks in the requested directory. So it strips off
xxx.rcp.gui.form.impl and looks for the file
resources/overrides/xxx/rcp/gui/form/impl/Field.override.

Then it matches your class against xxx.rcp.gui.form. So it strips this
part off (leaving impl.Field), and prepends with the path, so it looks
for resources/overridex/xxx/rcp/gui/form plus impl/Field.override,
because impl.Field was what was left over after stripping the matching
part off.

Simon Lengaigne wrote:
> I have accidentally found a solution that seems to work but I don't
> understand why...
>
> Apparently, the problem comes from the way I register the override files
> in the plugin.xml file.
>
> Here is the old declaration that doesn't works.
>
> <extension point="org.eclipse.jem.beaninfo.registrations">
> <registration plugin="xxx.rcp.gui">
> <override package="xxx.rcp.gui.form.impl"
> path="resources/overrides/xxx/rcp/gui/form/impl" />
> <override package="xxx.rcp.gui.form"
> path="resources/overrides/xxx/rcp/gui/form" />
> <beaninfo path="beaninfo.jar">
> <searchpath package="xxx.rcp.gui.form" />
> <searchpath package="xxx.rcp.gui.form.impl" />
> </beaninfo>
> </registration>
> </extension>
>
> Here is the good one
>
> <extension point="org.eclipse.jem.beaninfo.registrations">
> <registration plugin="xxx.rcp.gui">
> <override package="xxx.rcp.gui.form"
> path="resources/overrides/xxx/rcp/gui/form" />
> <beaninfo path="beaninfo.jar">
> <searchpath package="xxx.rcp.gui.form" />
> <searchpath package="xxx.rcp.gui.form.impl" />
> </beaninfo>
> </registration>
> </extension>
>
> I don't understand how VE is able to find the Field.override file. His
> location is specified in the deleted override entry...
>
> Thanks
> Simon Lengaigne
>

--
Thanks,
Rich Kulp
Re: Cell Editor and Inheritance [message #611411 is a reply to message #111939] Thu, 01 December 2005 10:09 Go to previous message
Simon Lengaigne is currently offline Simon LengaigneFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for your explanations.

Simon
Previous Topic:VE view gone
Next Topic:Extending the VE - runtime problems
Goto Forum:
  


Current Time: Thu Apr 25 20:45:21 GMT 2024

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

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

Back to the top