Preventing the generation of default constructor [message #131833] |
Thu, 05 October 2006 13:34 |
Eclipse User |
|
|
|
Originally posted by: nsat28.yahoo.com
Hi,
How to prevent the default constructor from getting generated, when
"Constructors from superclass"
is checked in the new visual class wizard.
This is for my custom widget written using swing.
Since this is already done for SWT widgets, how to achieve the same in
Swing.
Thanks,
Anand
|
|
|
Re: Preventing the generation of default constructor [message #131851 is a reply to message #131833] |
Thu, 05 October 2006 15:20 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
This is a function of JDT, not of the VE. The reason it is not done for
SWT widgets is because SWT widgets do not have a default ctor. Since
they don't have one, then one is not generated for the subclass. The
algorithm is simply duplicate any constructor the super class has.
Anand wrote:
> Hi,
>
> How to prevent the default constructor from getting generated, when
> "Constructors from superclass"
> is checked in the new visual class wizard.
>
> This is for my custom widget written using swing.
> Since this is already done for SWT widgets, how to achieve the same in
> Swing.
>
> Thanks,
> Anand
>
--
Thanks,
Rich Kulp
|
|
|
Re: Preventing the generation of default constructor [message #131899 is a reply to message #131851] |
Fri, 06 October 2006 12:17 |
Eclipse User |
|
|
|
Originally posted by: nsat28.yahoo.com
Hi Rich,
By removing the default constructor I started getting
NoSuchMethodException.
When I checked the code for SWT widgets found that,
actually SWT widgets does have a default constructor but without any
access specifiers.
Doing the same to my CustomWidget works, but gave rise to a new problem.
VE executes the code present only in the default constructor and not the
one that is custom generated using JET template.
Is there any workaround for this.
Thanks,
Anand
Rich Kulp wrote:
> This is a function of JDT, not of the VE. The reason it is not done for
> SWT widgets is because SWT widgets do not have a default ctor. Since
> they don't have one, then one is not generated for the subclass. The
> algorithm is simply duplicate any constructor the super class has.
> Anand wrote:
>> Hi,
>>
>> How to prevent the default constructor from getting generated, when
>> "Constructors from superclass"
>> is checked in the new visual class wizard.
>>
>> This is for my custom widget written using swing.
>> Since this is already done for SWT widgets, how to achieve the same in
>> Swing.
>>
>> Thanks,
>> Anand
>>
|
|
|
|
Re: Preventing the generation of default constructor [message #132150 is a reply to message #131950] |
Wed, 11 October 2006 11:58 |
Eclipse User |
|
|
|
Originally posted by: nsat28.yahoo.com
Hi Rich,
I managed to make VE use the constructor with arguments.
This was done by providing a seperate xmi file to my widget similar to the
xmi file used for SWT label.
Now I dont need to use JET templates as VE uses and generates the
constructor I want.
Now there is one problem , upon changing the values in the constructor,
the new values do not get reflected. Is there any solution for this?
Thanks,
Anand
|
|
|
Re: Preventing the generation of default constructor [message #132299 is a reply to message #132150] |
Wed, 18 October 2006 16:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I don't know what:
> Now there is one problem , upon changing the values in the constructor,
> the new values do not get reflected. Is there any solution for this?
>
means. Is this where you are using the class somewhere else and you
changed the settings on the using constructor (i.e. say I had a class
XYZ(String arg1). If I had dropped XYZ on some other class and in the
code the usage of the ctor is
new XYZ("abc");
And then later I typed in
new XYZ("cde");
And you don't see any change?
Or is it something else?
--
Thanks,
Rich Kulp
|
|
|
Re: Preventing the generation of default constructor [message #614682 is a reply to message #131833] |
Thu, 05 October 2006 15:20 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
This is a function of JDT, not of the VE. The reason it is not done for
SWT widgets is because SWT widgets do not have a default ctor. Since
they don't have one, then one is not generated for the subclass. The
algorithm is simply duplicate any constructor the super class has.
Anand wrote:
> Hi,
>
> How to prevent the default constructor from getting generated, when
> "Constructors from superclass"
> is checked in the new visual class wizard.
>
> This is for my custom widget written using swing.
> Since this is already done for SWT widgets, how to achieve the same in
> Swing.
>
> Thanks,
> Anand
>
--
Thanks,
Rich Kulp
|
|
|
Re: Preventing the generation of default constructor [message #614689 is a reply to message #131851] |
Fri, 06 October 2006 12:17 |
Anand Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi Rich,
By removing the default constructor I started getting
NoSuchMethodException.
When I checked the code for SWT widgets found that,
actually SWT widgets does have a default constructor but without any
access specifiers.
Doing the same to my CustomWidget works, but gave rise to a new problem.
VE executes the code present only in the default constructor and not the
one that is custom generated using JET template.
Is there any workaround for this.
Thanks,
Anand
Rich Kulp wrote:
> This is a function of JDT, not of the VE. The reason it is not done for
> SWT widgets is because SWT widgets do not have a default ctor. Since
> they don't have one, then one is not generated for the subclass. The
> algorithm is simply duplicate any constructor the super class has.
> Anand wrote:
>> Hi,
>>
>> How to prevent the default constructor from getting generated, when
>> "Constructors from superclass"
>> is checked in the new visual class wizard.
>>
>> This is for my custom widget written using swing.
>> Since this is already done for SWT widgets, how to achieve the same in
>> Swing.
>>
>> Thanks,
>> Anand
>>
|
|
|
|
|
Re: Preventing the generation of default constructor [message #614716 is a reply to message #132150] |
Wed, 18 October 2006 16:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I don't know what:
> Now there is one problem , upon changing the values in the constructor,
> the new values do not get reflected. Is there any solution for this?
>
means. Is this where you are using the class somewhere else and you
changed the settings on the using constructor (i.e. say I had a class
XYZ(String arg1). If I had dropped XYZ on some other class and in the
code the usage of the ctor is
new XYZ("abc");
And then later I typed in
new XYZ("cde");
And you don't see any change?
Or is it something else?
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.02726 seconds