Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » How does VE decide whether to instantiate a bean in initialize?
How does VE decide whether to instantiate a bean in initialize? [message #145450] Tue, 25 November 2008 10:45 Go to next message
Eclipse UserFriend
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 #145460 is a reply to message #145450] Wed, 26 November 2008 09:16 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
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 #145510 is a reply to message #145450] Tue, 02 December 2008 19:58 Go to previous message
Eclipse UserFriend
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 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Genereta XML file with VE
Next Topic:palette Component on Visual editor
Goto Forum:
  


Current Time: Mon Dec 30 16:48:24 GMT 2024

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

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

Back to the top