|
|
Re: Inserting an argument after instantiating a class [message #85696 is a reply to message #85681] |
Tue, 05 April 2005 18:46 |
Eclipse User |
|
|
|
Originally posted by: myersj.gmail.com
Elena,
Do you have write access to the classes you're trying to use? It'd be
much preferred to have the constructor arguments declared as properties
(with getter/setter methods) and have your class use a no-argument
constructor. This makes your class follow the JavaBean spec, which is
what the VE was designed to handle.
If you cannot modify the classes, you could provide wrapper classes to
the target class that provides a no argument facade.
Hope this helps,
- Jeff
Sri Gunturi wrote:
> Hello,
> Currently VE's codegen decoders handle one sturctural feature /
> property per expression. If you want the constructor to do many things
> all at once you will need to implement your own constructor decoder -
> please look at classes ConstructorDecoderHelper and
> SWTConstructorDecoderHelper to determine how you can extend them.
> Regards,
> Sri.
>
> Elena wrote:
>
>> Hello,
>>
>> I would like to make it possible for a user to select arguments for
>> the instantiating a class from the �Property Sheet� after a dropping a
>> component from the palette.
>>
>>
>>
>> For example:
>>
>>
>>
>> 1. I drop a MyJButton on the JFrame. The following code will be
>> generated:
>>
>>
>>
>> myJButton = new MyJButton();
>>
>>
>>
>> 2. I change the property (e.g. "arguments") from <none> to �en�, the
>> text �english� will be inserted
>>
>>
>> myJButton = new MyJButton(�english�);
>>
>>
>>
>>
>> Could you give me a tip how I can implement it :-)
>>
>>
>>
>> Thank you in advance
>>
>> Elena
>>
>>
>>
>>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03191 seconds