Skip to main content



      Home
Home » Archived » Visual Editor (VE) » initialize() vs. initComponents()
initialize() vs. initComponents() [message #18418] Wed, 11 February 2004 17:40 Go to next message
Eclipse UserFriend
Originally posted by: mzach.ifmc.sdps.org

I see in the preferences that it gives me some options for perfered
method names. If I remove all method names except initComponents, it
still generates the form with an initialize() method.

How can I get VE to use initComponents?

Thanks.
Re: initialize() vs. initComponents() [message #19066 is a reply to message #18418] Thu, 12 February 2004 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

mzach wrote:
> I see in the preferences that it gives me some options for perfered
> method names. If I remove all method names except initComponents, it
> still generates the form with an initialize() method.
>
> How can I get VE to use initComponents?
>
> Thanks.
>

The (default) getter style VE provides always generates the Initialize()
method (vs. a getter method) when you set properties to the class you
are editing ( i.e., this.setXXX()).

It will generate an instance variable for every component that you drop,
and instantiate it inside a getter method. This getter method would be
the initialization method; where VE will parse for settings on this
component.

JButton button = null ;

// This is the init method
private JButton getButton() {
button = new JButton() ; <--------------
button.setXX() // will be parsed
:
return button ;
}
// This is not the init method
private JButton getCoolButton {
:
button.setYY() ; // will not be parsed
return button;
}

=============================



On the parsing side if you have the following pattern


JButton button = new JButton() ; <----------------


private void someInitMethod() {
button.setXX();
}

private void someOtherMethod() {
button.setYY();
}


VE has no way to know which method is the (Design) initialization
method, as the button's construction is in its declaration.
If "someInitMethod" is listed in the pref. page, then VE will parse the
button.setXX();
Re: initialize() vs. initComponents() [message #19072 is a reply to message #19066] Thu, 12 February 2004 10:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mzach.ifmc.sdps.org

So the preferences alloy you to add in some user-defined methods for
dropped components only? What I'd like to customize is the initialze
method that was generated for the parent form (JPanel). We are porting
several classes over from NetBeans. NetBeans uses initComponents as its
'initialize' method. I'd like to have VE follow the same pattern to
minimize the amount of code we have to change. Maybe it's not possible.

Gili Mendel wrote:

> mzach wrote:
>
>> I see in the preferences that it gives me some options for perfered
>> method names. If I remove all method names except initComponents, it
>> still generates the form with an initialize() method.
>>
>> How can I get VE to use initComponents?
>>
>> Thanks.
>>
>
> The (default) getter style VE provides always generates the Initialize()
> method (vs. a getter method) when you set properties to the class you
> are editing ( i.e., this.setXXX()).
>
> It will generate an instance variable for every component that you drop,
> and instantiate it inside a getter method. This getter method would be
> the initialization method; where VE will parse for settings on this
> component.
>
> JButton button = null ;
>
> // This is the init method
> private JButton getButton() {
> button = new JButton() ; <--------------
> button.setXX() // will be parsed
> :
> return button ;
> }
> // This is not the init method
> private JButton getCoolButton {
> :
> button.setYY() ; // will not be parsed
> return button;
> }
>
> =============================
>
>
>
> On the parsing side if you have the following pattern
>
>
> JButton button = new JButton() ; <----------------
>
>
> private void someInitMethod() {
> button.setXX();
> }
>
> private void someOtherMethod() {
> button.setYY();
> }
>
>
> VE has no way to know which method is the (Design) initialization
> method, as the button's construction is in its declaration.
> If "someInitMethod" is listed in the pref. page, then VE will parse the
> button.setXX();
>
Re: initialize() vs. initComponents() [message #19118 is a reply to message #19072] Fri, 13 February 2004 09:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

mzach wrote:
> So the preferences alloy you to add in some user-defined methods for
> dropped components only? What I'd like to customize is the initialze
> method that was generated for the parent form (JPanel). We are porting
> several classes over from NetBeans. NetBeans uses initComponents as its
> 'initialize' method. I'd like to have VE follow the same pattern to
> minimize the amount of code we have to change. Maybe it's not possible.
>


The current style will parse the initComponents, and will continue to
use it for existing beans. It will generate a getter() only for new
components that you drop.

VE can be extended with a "single initialization method" style
contribution.

Open a bugzilla request.
Re: initialize() vs. initComponents() [message #20184 is a reply to message #19118] Thu, 19 February 2004 09:25 Go to previous message
Eclipse UserFriend
Originally posted by: mzach.ifmc.sdps.org

For others interested, my workaround was to rename initialize() to
init(). Apparently VE treats them the same.

This was all I needed, but I just wish I didn't have to go through trial
and error to find out something simple like thie.

Gili Mendel wrote:

> mzach wrote:
>
>> So the preferences alloy you to add in some user-defined methods for
>> dropped components only? What I'd like to customize is the initialze
>> method that was generated for the parent form (JPanel). We are porting
>> several classes over from NetBeans. NetBeans uses initComponents as
>> its 'initialize' method. I'd like to have VE follow the same pattern
>> to minimize the amount of code we have to change. Maybe it's not
>> possible.
>>
>
>
> The current style will parse the initComponents, and will continue to
> use it for existing beans. It will generate a getter() only for new
> components that you drop.
>
> VE can be extended with a "single initialization method" style
> contribution.
>
> Open a bugzilla request.
>
Re: initialize() vs. initComponents() [message #580835 is a reply to message #18418] Thu, 12 February 2004 09:42 Go to previous message
Eclipse UserFriend
mzach wrote:
> I see in the preferences that it gives me some options for perfered
> method names. If I remove all method names except initComponents, it
> still generates the form with an initialize() method.
>
> How can I get VE to use initComponents?
>
> Thanks.
>

The (default) getter style VE provides always generates the Initialize()
method (vs. a getter method) when you set properties to the class you
are editing ( i.e., this.setXXX()).

It will generate an instance variable for every component that you drop,
and instantiate it inside a getter method. This getter method would be
the initialization method; where VE will parse for settings on this
component.

JButton button = null ;

// This is the init method
private JButton getButton() {
button = new JButton() ; <--------------
button.setXX() // will be parsed
:
return button ;
}
// This is not the init method
private JButton getCoolButton {
:
button.setYY() ; // will not be parsed
return button;
}

=============================



On the parsing side if you have the following pattern


JButton button = new JButton() ; <----------------


private void someInitMethod() {
button.setXX();
}

private void someOtherMethod() {
button.setYY();
}


VE has no way to know which method is the (Design) initialization
method, as the button's construction is in its declaration.
If "someInitMethod" is listed in the pref. page, then VE will parse the
button.setXX();
Re: initialize() vs. initComponents() [message #580865 is a reply to message #19066] Thu, 12 February 2004 10:21 Go to previous message
Eclipse UserFriend
Originally posted by: mzach.ifmc.sdps.org

So the preferences alloy you to add in some user-defined methods for
dropped components only? What I'd like to customize is the initialze
method that was generated for the parent form (JPanel). We are porting
several classes over from NetBeans. NetBeans uses initComponents as its
'initialize' method. I'd like to have VE follow the same pattern to
minimize the amount of code we have to change. Maybe it's not possible.

Gili Mendel wrote:

> mzach wrote:
>
>> I see in the preferences that it gives me some options for perfered
>> method names. If I remove all method names except initComponents, it
>> still generates the form with an initialize() method.
>>
>> How can I get VE to use initComponents?
>>
>> Thanks.
>>
>
> The (default) getter style VE provides always generates the Initialize()
> method (vs. a getter method) when you set properties to the class you
> are editing ( i.e., this.setXXX()).
>
> It will generate an instance variable for every component that you drop,
> and instantiate it inside a getter method. This getter method would be
> the initialization method; where VE will parse for settings on this
> component.
>
> JButton button = null ;
>
> // This is the init method
> private JButton getButton() {
> button = new JButton() ; <--------------
> button.setXX() // will be parsed
> :
> return button ;
> }
> // This is not the init method
> private JButton getCoolButton {
> :
> button.setYY() ; // will not be parsed
> return button;
> }
>
> =============================
>
>
>
> On the parsing side if you have the following pattern
>
>
> JButton button = new JButton() ; <----------------
>
>
> private void someInitMethod() {
> button.setXX();
> }
>
> private void someOtherMethod() {
> button.setYY();
> }
>
>
> VE has no way to know which method is the (Design) initialization
> method, as the button's construction is in its declaration.
> If "someInitMethod" is listed in the pref. page, then VE will parse the
> button.setXX();
>
Re: initialize() vs. initComponents() [message #581140 is a reply to message #19072] Fri, 13 February 2004 09:54 Go to previous message
Eclipse UserFriend
mzach wrote:
> So the preferences alloy you to add in some user-defined methods for
> dropped components only? What I'd like to customize is the initialze
> method that was generated for the parent form (JPanel). We are porting
> several classes over from NetBeans. NetBeans uses initComponents as its
> 'initialize' method. I'd like to have VE follow the same pattern to
> minimize the amount of code we have to change. Maybe it's not possible.
>


The current style will parse the initComponents, and will continue to
use it for existing beans. It will generate a getter() only for new
components that you drop.

VE can be extended with a "single initialization method" style
contribution.

Open a bugzilla request.
Re: initialize() vs. initComponents() [message #581863 is a reply to message #19118] Thu, 19 February 2004 09:25 Go to previous message
Eclipse UserFriend
Originally posted by: mzach.ifmc.sdps.org

For others interested, my workaround was to rename initialize() to
init(). Apparently VE treats them the same.

This was all I needed, but I just wish I didn't have to go through trial
and error to find out something simple like thie.

Gili Mendel wrote:

> mzach wrote:
>
>> So the preferences alloy you to add in some user-defined methods for
>> dropped components only? What I'd like to customize is the initialze
>> method that was generated for the parent form (JPanel). We are porting
>> several classes over from NetBeans. NetBeans uses initComponents as
>> its 'initialize' method. I'd like to have VE follow the same pattern
>> to minimize the amount of code we have to change. Maybe it's not
>> possible.
>>
>
>
> The current style will parse the initComponents, and will continue to
> use it for existing beans. It will generate a getter() only for new
> components that you drop.
>
> VE can be extended with a "single initialization method" style
> contribution.
>
> Open a bugzilla request.
>
Previous Topic:visual editor disappeared
Next Topic:VE 1.0: Possible Code Generation Mistake
Goto Forum:
  


Current Time: Tue May 13 10:34:44 EDT 2025

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

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

Back to the top