too short override file [message #119615] |
Thu, 02 March 2006 14:33 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: markus.wawra.shark-soft.com
Hi!
I've a subclass of JPasswordField called STTextField. This STTextfield has
a field called "converter" with get and set method. converter is of the
abstract type STConverter. The property "converter" appears in the
Property Sheet and can be set there. If I set in STDateConverter (a
subclass of STConverter), the code
"stTextField.setConverter(getSTDateConverter)" and the corresponding get
method is created. Since the code becomes confusing that way, I don't want
to create a get method in this case. So I wrote a STConverter.override
where the beanLocation is set to GLOBAL_LOCAL. Nothing more is done in
this 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:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:event="event.xmi">
<event:AddMany featureName="eAnnotations">
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>
</event:AddMany>
</xmi:XMI>
Unfortunately it does not work that way. The get method is still created.
The override is registrated and in the right subdirectory (My other
overrides are processed the same way). I wonder whether the override is
"too short". I already had a similar problem with an override. It was for
a class called STLabel, which is a subclass of JLabel. First it contained
the same information as the STConverter.override
(beanLocation="GLOBAL_GLOBAL") and was not processed. Then I took a copy
of the JLabel.override, named STLabel.override, where I just altered the
beanLocation entry. That works fine.
Does my short override contain too less information to be processed???
Or is there any other kind of problem why it is not taken???
Regards,
Markus
|
|
|
Re: too short override file [message #119652 is a reply to message #119615] |
Thu, 02 March 2006 14:40 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You can't have a too short file. There must be a difference between your
original attempt and the one that you copied that made the file invalid.
Do a diff between the two and see what else is different between them.
Off the top of my head I don't see anything wrong with your file though.
--
Thanks,
Rich Kulp
|
|
|
Re: too short override file [message #119676 is a reply to message #119652] |
Thu, 02 March 2006 16:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: markus.wawra.shark-soft.com
Thanks for answering so quickly!
That the STLabel.override did not work, may have other reasons. I just
wanted to know whether there is something essential missing.
Generally, should the beanLocation handle this case?
So far I just know that it works for graphical components. My converter is
just a property of such a component. Does this make a difference?
Do I need a BeanInfo class for the converter? Or a MethodDescriptor for
the setConverter in a STTextFieldBeanInfo? Would this change anything at
all?
Maybe this are too many questions and some them stupid, but I'm a bit
confused where the VE gets the order, to create a get method in this case,
from.
Regards,
Markus
|
|
|
Re: too short override file [message #119688 is a reply to message #119676] |
Thu, 02 March 2006 16:42 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I know what's going on now. In VE1.1.x when you use the default property
editor for just a property type of a class (i.e. not one we have special
property editors for), like your STConverter, it creates a get method
and puts it on the freeform, always.
Step up to Eclipse 3.2M5a, GEF 3.2M5, EMF2.2M5, and VE1.2M2. In that
version we don't create get methods for properties of type class. We
just do:
xyz.setProperty(new MyPropertyType());
You can get rid of your override file because you don't need to say
GLOBAL_LOCAL unless you really want the converter to be in a field of
the class instead of just local to the method.
--
Thanks,
Rich Kulp
|
|
|
Re: too short override file [message #119739 is a reply to message #119688] |
Fri, 03 March 2006 12:41 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: markus.wawra.shark-soft.com
Thanks, that's good to know!
Unfortunately, VE 1.2 is no opportunity for me at the moment.
Can I do it in VE 1.1.0.1 as well?
Will I need to write a Property Editor as you mentioned?
If yes, do you know a good class that I can take as model?
Regards,
Markus
|
|
|
Re: too short override file [message #119765 is a reply to message #119739] |
Fri, 03 March 2006 15:02 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
No. Fraid not. It is hard-coded in 1.1.0.1 to do the get method unless
you write your own property editor.
Markus wrote:
> Thanks, that's good to know!
>
> Unfortunately, VE 1.2 is no opportunity for me at the moment. Can I do
> it in VE 1.1.0.1 as well?
> Will I need to write a Property Editor as you mentioned?
> If yes, do you know a good class that I can take as model?
>
> Regards,
>
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
Re: too short override file [message #612238 is a reply to message #119615] |
Thu, 02 March 2006 14:40 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You can't have a too short file. There must be a difference between your
original attempt and the one that you copied that made the file invalid.
Do a diff between the two and see what else is different between them.
Off the top of my head I don't see anything wrong with your file though.
--
Thanks,
Rich Kulp
|
|
|
|
Re: too short override file [message #612241 is a reply to message #119676] |
Thu, 02 March 2006 16:42 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I know what's going on now. In VE1.1.x when you use the default property
editor for just a property type of a class (i.e. not one we have special
property editors for), like your STConverter, it creates a get method
and puts it on the freeform, always.
Step up to Eclipse 3.2M5a, GEF 3.2M5, EMF2.2M5, and VE1.2M2. In that
version we don't create get methods for properties of type class. We
just do:
xyz.setProperty(new MyPropertyType());
You can get rid of your override file because you don't need to say
GLOBAL_LOCAL unless you really want the converter to be in a field of
the class instead of just local to the method.
--
Thanks,
Rich Kulp
|
|
|
|
Re: too short override file [message #612247 is a reply to message #119739] |
Fri, 03 March 2006 15:02 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
No. Fraid not. It is hard-coded in 1.1.0.1 to do the get method unless
you write your own property editor.
Markus wrote:
> Thanks, that's good to know!
>
> Unfortunately, VE 1.2 is no opportunity for me at the moment. Can I do
> it in VE 1.1.0.1 as well?
> Will I need to write a Property Editor as you mentioned?
> If yes, do you know a good class that I can take as model?
>
> Regards,
>
> Markus
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.04718 seconds