How does VE decide whether to instantiate a bean in initialize? [message #145450] |
Tue, 25 November 2008 10:45 |
Eclipse User |
|
|
|
Originally posted by: eli_lato.hotmail.com
If I choose a JLabel from the Choose Bean button, and drop the JLabel on the panel, the VE instantiates the JLabel in the initialize method:
private void initialize() {
jLabel = new JLabel();
...
But if I choose a JFormattedTextField from the Choose Bean button, and drop the JFormattedTextField on the panel, the VE instantiates it in a lazy getter:
private JFormattedTextField getJFormattedTextField() (
if (jFormattedTextField == null...
How does the VE decide where to instantiate the bean?
Thanks,
Eli
|
|
|
|
Re: How does VE decide whether to instantiate a bean in initialize? [message #145510 is a reply to message #145450] |
Tue, 02 December 2008 19:58 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
A few specific widgets such as JLabel have no children and only a few
properties set and would never be referenced in an event outside of the
initialize method, so those were specifically hard-coded to not have a
lazy getter. Everything else has a lazy get.
Eli Lato wrote:
> If I choose a JLabel from the Choose Bean button, and drop the JLabel on the panel, the VE instantiates the JLabel in the initialize method:
> private void initialize() {
> jLabel = new JLabel();
> ...
>
> But if I choose a JFormattedTextField from the Choose Bean button, and drop the JFormattedTextField on the panel, the VE instantiates it in a lazy getter:
> private JFormattedTextField getJFormattedTextField() (
> if (jFormattedTextField == null...
>
> How does the VE decide where to instantiate the bean?
>
> Thanks,
> Eli
--
Thanks,
Rich Kulp
|
|
|
Re: How does VE decide whether to instantiate a bean in initialize? [message #617301 is a reply to message #145450] |
Wed, 26 November 2008 09:16 |
Konstantin Scheglov Messages: 555 Registered: July 2009 |
Senior Member |
|
|
Eli Lato wrote:
I'm not 100% sure, but AFAIK VE always uses "lazy creation" pattern.
> If I choose a JLabel from the Choose Bean button, and drop the JLabel on the panel, the VE instantiates the JLabel in the initialize method:
> private void initialize() {
> jLabel = new JLabel();
> ...
>
> But if I choose a JFormattedTextField from the Choose Bean button, and drop the JFormattedTextField on the panel, the VE instantiates it in a lazy getter:
> private JFormattedTextField getJFormattedTextField() (
> if (jFormattedTextField == null...
>
> How does the VE decide where to instantiate the bean?
>
> Thanks,
> Eli
Konstantin Scheglov,
Google, Inc.
|
|
|
Re: How does VE decide whether to instantiate a bean in initialize? [message #617306 is a reply to message #145450] |
Tue, 02 December 2008 19:58 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
A few specific widgets such as JLabel have no children and only a few
properties set and would never be referenced in an event outside of the
initialize method, so those were specifically hard-coded to not have a
lazy getter. Everything else has a lazy get.
Eli Lato wrote:
> If I choose a JLabel from the Choose Bean button, and drop the JLabel on the panel, the VE instantiates the JLabel in the initialize method:
> private void initialize() {
> jLabel = new JLabel();
> ...
>
> But if I choose a JFormattedTextField from the Choose Bean button, and drop the JFormattedTextField on the panel, the VE instantiates it in a lazy getter:
> private JFormattedTextField getJFormattedTextField() (
> if (jFormattedTextField == null...
>
> How does the VE decide where to instantiate the bean?
>
> Thanks,
> Eli
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.04629 seconds