Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » parsing factory call
parsing factory call [message #105295] Tue, 06 September 2005 07:13 Go to next message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

We have some generated code that for the most part is parsed well by VE, but
one rather important piece does not work. We use factory instance calls for
a lot of things and it seems that doing something like
ctrl.setProp(ivjFactory1Inst.getPropValue("propName")) works fine, but ctrl
= ivjFactory2Inst.getTextField("propName") is not recognized. The first
assigns a value to a property of a control and the second creates a control
through a factory.

Is this as expected or am I doing something else wrong?

Regards,

Hans
Re: parsing factory call [message #105344 is a reply to message #105295] Tue, 06 September 2005 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What is ctrl. Is it SWT or Swing? If it is SWT, we don't yet support
factories because we need to know who the parent is, and the factory
call doesn't tell us that.

If it is Swing, then somewhere you must be doing an panel.add(ctrl) and
that should of worked. But I'm not sure. We have special code in for
visuals because they are so special compared to simple properties.

Hans Boerstra wrote:
> We have some generated code that for the most part is parsed well by VE, but
> one rather important piece does not work. We use factory instance calls for
> a lot of things and it seems that doing something like
> ctrl.setProp(ivjFactory1Inst.getPropValue("propName")) works fine, but ctrl
> = ivjFactory2Inst.getTextField("propName") is not recognized. The first
> assigns a value to a property of a control and the second creates a control
> through a factory.
>
> Is this as expected or am I doing something else wrong?
>
> Regards,
>
> Hans
>
>

--
Thanks,
Rich Kulp
Re: parsing factory call [message #105357 is a reply to message #105344] Tue, 06 September 2005 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

The ctrl is Swing (JComponent child, often JTextField and the likes).
We do the panel.add(ctr) too and if I replace the
ivjFactory2Inst.getTextField("propName") with a standard no-arg constructor
all goes well.

It looks like the factory call does not get parsed well because if I replace
it with a static call (internally doing the same thing) like this:
utilityClass.getTextField(ivjFactory2Inst, "propName"), which is a sort of
OO to functional transformation of the original, the component shows up
again in the VE view.

Could anyone give any pointers on how to work around this or the java source
file to inspect to see if it is currently possible to use factory instances
creating JComponents? Replacing all factory instance calls with the static
equivalents is not an option because of the very large codebase.

Regards,

Hans

----- Original Message -----
From: "Rich Kulp" <richkulp@us.NO_SPAM.ibm.com>
Newsgroups: eclipse.tools.ve
Sent: Tuesday, September 06, 2005 6:51 PM
Subject: Re: parsing factory call


> What is ctrl. Is it SWT or Swing? If it is SWT, we don't yet support
> factories because we need to know who the parent is, and the factory call
> doesn't tell us that.
>
> If it is Swing, then somewhere you must be doing an panel.add(ctrl) and
> that should of worked. But I'm not sure. We have special code in for
> visuals because they are so special compared to simple properties.
>
> Hans Boerstra wrote:
>> We have some generated code that for the most part is parsed well by VE,
>> but one rather important piece does not work. We use factory instance
>> calls for a lot of things and it seems that doing something like
>> ctrl.setProp(ivjFactory1Inst.getPropValue("propName")) works fine, but
>> ctrl = ivjFactory2Inst.getTextField("propName") is not recognized. The
>> first assigns a value to a property of a control and the second creates a
>> control through a factory.
>>
>> Is this as expected or am I doing something else wrong?
>>
>> Regards,
>>
>> Hans
>
> --
> Thanks,
> Rich Kulp
Re: parsing factory call [message #105397 is a reply to message #105357] Tue, 06 September 2005 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Can I see your pattern exactly? Because this factory pattern works for
us in VE 1.1.0.

package test;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTextField;

public class Test extends JFrame {

private JPanel jContentPane = null;

private Factory factory = new Factory();

/**
* This is the default constructor
*/
public Test() {
super();
initialize();
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
JTextField ctrl = factory.getTextField("text");
jContentPane.add(ctrl, BorderLayout.SOUTH);
}
return jContentPane;
}

}

--
Thanks,
Rich Kulp
Re: parsing factory call [message #105409 is a reply to message #105397] Tue, 06 September 2005 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

Your class does not work in my setup, but I am using VE 1.0.1 with Eclipse
3.0.1 instead of VE 1.1.0 with Eclipse 3.1. Another reason to upgrade to
3.1 I guess. I will try that first to see if it solves my problem.

Thanks,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfknah$rbc$1@news.eclipse.org...
> Can I see your pattern exactly? Because this factory pattern works for us
> in VE 1.1.0.
>
> package test;
>
> import java.awt.BorderLayout;
> import javax.swing.JPanel;
> import javax.swing.JFrame;
> import javax.swing.JTextField;
>
> public class Test extends JFrame {
>
> private JPanel jContentPane = null;
>
> private Factory factory = new Factory();
>
> /**
> * This is the default constructor
> */
> public Test() {
> super();
> initialize();
> }
>
> /**
> * This method initializes this
> *
> * @return void
> */
> private void initialize() {
> this.setSize(300, 200);
> this.setContentPane(getJContentPane());
> this.setTitle("JFrame");
> }
>
> /**
> * This method initializes jContentPane
> *
> * @return javax.swing.JPanel
> */
> private JPanel getJContentPane() {
> if (jContentPane == null) {
> jContentPane = new JPanel();
> jContentPane.setLayout(new BorderLayout());
> JTextField ctrl = factory.getTextField("text");
> jContentPane.add(ctrl, BorderLayout.SOUTH);
> }
> return jContentPane;
> }
>
> }
>
> --
> Thanks,
> Rich Kulp
Re: parsing factory call [message #105422 is a reply to message #105409] Tue, 06 September 2005 23:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

Rich,

Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now noticed
the difference between the no-arg factory in your example and our factory
that takes a domain class as argument: factory = new Factory(Car.class); In
VE 1.1 all goes well if the factory has a no-arg constructor, but one of the
important parts of our factory/builder is you can store state in them that
is used in later calls so we need either arguments with the factory
constructor or the parser recognizing setters on the factory. In your
example class I could not make it work with VE 1.1 using something like
Factory factory = new Factory("text") and then later calling
label.setText(factory.getText()) to get "text" back. Would you expect that
to work in your example?

Is there any way to achieve this?

Thanks,

Hans

"Hans Boerstra" <hansboerstra@hotmail.com> wrote in message
news:dfkop0$tag$1@news.eclipse.org...
> Your class does not work in my setup, but I am using VE 1.0.1 with Eclipse
> 3.0.1 instead of VE 1.1.0 with Eclipse 3.1. Another reason to upgrade to
> 3.1 I guess. I will try that first to see if it solves my problem.
>
> Thanks,
>
> Hans
>
> "Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
> news:dfknah$rbc$1@news.eclipse.org...
>> Can I see your pattern exactly? Because this factory pattern works for us
>> in VE 1.1.0.
>>
>> package test;
>>
>> import java.awt.BorderLayout;
>> import javax.swing.JPanel;
>> import javax.swing.JFrame;
>> import javax.swing.JTextField;
>>
>> public class Test extends JFrame {
>>
>> private JPanel jContentPane = null;
>>
>> private Factory factory = new Factory();
>>
>> /**
>> * This is the default constructor
>> */
>> public Test() {
>> super();
>> initialize();
>> }
>>
>> /**
>> * This method initializes this
>> *
>> * @return void
>> */
>> private void initialize() {
>> this.setSize(300, 200);
>> this.setContentPane(getJContentPane());
>> this.setTitle("JFrame");
>> }
>>
>> /**
>> * This method initializes jContentPane
>> *
>> * @return javax.swing.JPanel
>> */
>> private JPanel getJContentPane() {
>> if (jContentPane == null) {
>> jContentPane = new JPanel();
>> jContentPane.setLayout(new BorderLayout());
>> JTextField ctrl = factory.getTextField("text");
>> jContentPane.add(ctrl, BorderLayout.SOUTH);
>> }
>> return jContentPane;
>> }
>>
>> }
>>
>> --
>> Thanks,
>> Rich Kulp
>
>
Re: parsing factory call [message #105472 is a reply to message #105422] Wed, 07 September 2005 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Yes, I would expect that to work too.

Does it fail on the factory.getText() (i.e. say "text - too complicated"
or something like that)? Or does it fail int eh Factory construction?

Also, try our maintenance 1.1.0.1 driver. I just tried new
Factory(String.class) as an example and it worked fine.

Hans Boerstra wrote:
> Rich,
>
> Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now noticed
> the difference between the no-arg factory in your example and our factory
> that takes a domain class as argument: factory = new Factory(Car.class); In
> VE 1.1 all goes well if the factory has a no-arg constructor, but one of the
> important parts of our factory/builder is you can store state in them that
> is used in later calls so we need either arguments with the factory
> constructor or the parser recognizing setters on the factory. In your
> example class I could not make it work with VE 1.1 using something like
> Factory factory = new Factory("text") and then later calling
> label.setText(factory.getText()) to get "text" back. Would you expect that

--
Thanks,
Rich Kulp
Re: parsing factory call [message #105540 is a reply to message #105472] Wed, 07 September 2005 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

Rich,

I think I got it nailed down now (see attached testcase). The problem was
not in the factory call, but in the initialization. The factory class
Factory that gets i18n property values has to be initialized and that's were
I don't know how to proceed. I have attached a self contained testcase where
you can see that the factory for the JTextfield and JLabel work fine except
for the text of the label. That text is retrieved through the factory
instance and the static initialize method of the factory class has to be
called.
Is there a hook where I can get initialization code called? This would be
code that during run-time gets called by application initialization.

Regards,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfmpos$emq$1@news.eclipse.org...
> Yes, I would expect that to work too.
>
> Does it fail on the factory.getText() (i.e. say "text - too complicated"
> or something like that)? Or does it fail int eh Factory construction?
>
> Also, try our maintenance 1.1.0.1 driver. I just tried new
> Factory(String.class) as an example and it worked fine.
>
> Hans Boerstra wrote:
>> Rich,
>>
>> Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now
>> noticed
>> the difference between the no-arg factory in your example and our factory
>> that takes a domain class as argument: factory = new Factory(Car.class);
>> In
>> VE 1.1 all goes well if the factory has a no-arg constructor, but one of
>> the
>> important parts of our factory/builder is you can store state in them
>> that
>> is used in later calls so we need either arguments with the factory
>> constructor or the parser recognizing setters on the factory. In your
>> example class I could not make it work with VE 1.1 using something like
>> Factory factory = new Factory("text") and then later calling
>> label.setText(factory.getText()) to get "text" back. Would you expect
>> that
>
> --
> Thanks,
> Rich Kulp


Re: parsing factory call [message #105551 is a reply to message #105540] Wed, 07 September 2005 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The only thing I can think of is in the Factory class put:

static {
if (Beans.isDesignTime()) {
initialize(...);
}
}

That way when in runtime this will execute and do nothing but in design
time (i.e. loaded by the VE) it will run and call your initialize.


--
Thanks,
Rich Kulp
Re: parsing factory call [message #105615 is a reply to message #105551] Wed, 07 September 2005 20:04 Go to previous message
Eclipse UserFriend
Originally posted by: hansboerstra.hotmail.com

Thanks Rich. This will work for now. I will put it in the generated screens.
Much less work ;-)
Maybe this can be solved without code adaption through a new VE feature
using a VE setting for a given project specifying the initialization class
to call for each VE VM that is started? This way all application
initialization code needed for the screens to display correctly can be
executed at the right time.

Thanks again for the support,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfnc28$b39$1@news.eclipse.org...
> The only thing I can think of is in the Factory class put:
>
> static {
> if (Beans.isDesignTime()) {
> initialize(...);
> }
> }
>
> That way when in runtime this will execute and do nothing but in design
> time (i.e. loaded by the VE) it will run and call your initialize.
>
>
> --
> Thanks,
> Rich Kulp
Re: parsing factory call [message #610673 is a reply to message #105295] Tue, 06 September 2005 16:51 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What is ctrl. Is it SWT or Swing? If it is SWT, we don't yet support
factories because we need to know who the parent is, and the factory
call doesn't tell us that.

If it is Swing, then somewhere you must be doing an panel.add(ctrl) and
that should of worked. But I'm not sure. We have special code in for
visuals because they are so special compared to simple properties.

Hans Boerstra wrote:
> We have some generated code that for the most part is parsed well by VE, but
> one rather important piece does not work. We use factory instance calls for
> a lot of things and it seems that doing something like
> ctrl.setProp(ivjFactory1Inst.getPropValue("propName")) works fine, but ctrl
> = ivjFactory2Inst.getTextField("propName") is not recognized. The first
> assigns a value to a property of a control and the second creates a control
> through a factory.
>
> Is this as expected or am I doing something else wrong?
>
> Regards,
>
> Hans
>
>

--
Thanks,
Rich Kulp
Re: parsing factory call [message #610674 is a reply to message #105344] Tue, 06 September 2005 18:13 Go to previous message
Hans Boerstra is currently offline Hans BoerstraFriend
Messages: 48
Registered: July 2009
Member
The ctrl is Swing (JComponent child, often JTextField and the likes).
We do the panel.add(ctr) too and if I replace the
ivjFactory2Inst.getTextField("propName") with a standard no-arg constructor
all goes well.

It looks like the factory call does not get parsed well because if I replace
it with a static call (internally doing the same thing) like this:
utilityClass.getTextField(ivjFactory2Inst, "propName"), which is a sort of
OO to functional transformation of the original, the component shows up
again in the VE view.

Could anyone give any pointers on how to work around this or the java source
file to inspect to see if it is currently possible to use factory instances
creating JComponents? Replacing all factory instance calls with the static
equivalents is not an option because of the very large codebase.

Regards,

Hans

----- Original Message -----
From: "Rich Kulp" <richkulp@us.NO_SPAM.ibm.com>
Newsgroups: eclipse.tools.ve
Sent: Tuesday, September 06, 2005 6:51 PM
Subject: Re: parsing factory call


> What is ctrl. Is it SWT or Swing? If it is SWT, we don't yet support
> factories because we need to know who the parent is, and the factory call
> doesn't tell us that.
>
> If it is Swing, then somewhere you must be doing an panel.add(ctrl) and
> that should of worked. But I'm not sure. We have special code in for
> visuals because they are so special compared to simple properties.
>
> Hans Boerstra wrote:
>> We have some generated code that for the most part is parsed well by VE,
>> but one rather important piece does not work. We use factory instance
>> calls for a lot of things and it seems that doing something like
>> ctrl.setProp(ivjFactory1Inst.getPropValue("propName")) works fine, but
>> ctrl = ivjFactory2Inst.getTextField("propName") is not recognized. The
>> first assigns a value to a property of a control and the second creates a
>> control through a factory.
>>
>> Is this as expected or am I doing something else wrong?
>>
>> Regards,
>>
>> Hans
>
> --
> Thanks,
> Rich Kulp
Re: parsing factory call [message #610677 is a reply to message #105357] Tue, 06 September 2005 18:31 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Can I see your pattern exactly? Because this factory pattern works for
us in VE 1.1.0.

package test;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTextField;

public class Test extends JFrame {

private JPanel jContentPane = null;

private Factory factory = new Factory();

/**
* This is the default constructor
*/
public Test() {
super();
initialize();
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
JTextField ctrl = factory.getTextField("text");
jContentPane.add(ctrl, BorderLayout.SOUTH);
}
return jContentPane;
}

}

--
Thanks,
Rich Kulp
Re: parsing factory call [message #610678 is a reply to message #105397] Tue, 06 September 2005 18:56 Go to previous message
Hans Boerstra is currently offline Hans BoerstraFriend
Messages: 48
Registered: July 2009
Member
Your class does not work in my setup, but I am using VE 1.0.1 with Eclipse
3.0.1 instead of VE 1.1.0 with Eclipse 3.1. Another reason to upgrade to
3.1 I guess. I will try that first to see if it solves my problem.

Thanks,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfknah$rbc$1@news.eclipse.org...
> Can I see your pattern exactly? Because this factory pattern works for us
> in VE 1.1.0.
>
> package test;
>
> import java.awt.BorderLayout;
> import javax.swing.JPanel;
> import javax.swing.JFrame;
> import javax.swing.JTextField;
>
> public class Test extends JFrame {
>
> private JPanel jContentPane = null;
>
> private Factory factory = new Factory();
>
> /**
> * This is the default constructor
> */
> public Test() {
> super();
> initialize();
> }
>
> /**
> * This method initializes this
> *
> * @return void
> */
> private void initialize() {
> this.setSize(300, 200);
> this.setContentPane(getJContentPane());
> this.setTitle("JFrame");
> }
>
> /**
> * This method initializes jContentPane
> *
> * @return javax.swing.JPanel
> */
> private JPanel getJContentPane() {
> if (jContentPane == null) {
> jContentPane = new JPanel();
> jContentPane.setLayout(new BorderLayout());
> JTextField ctrl = factory.getTextField("text");
> jContentPane.add(ctrl, BorderLayout.SOUTH);
> }
> return jContentPane;
> }
>
> }
>
> --
> Thanks,
> Rich Kulp
Re: parsing factory call [message #610679 is a reply to message #105409] Tue, 06 September 2005 23:26 Go to previous message
Hans Boerstra is currently offline Hans BoerstraFriend
Messages: 48
Registered: July 2009
Member
Rich,

Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now noticed
the difference between the no-arg factory in your example and our factory
that takes a domain class as argument: factory = new Factory(Car.class); In
VE 1.1 all goes well if the factory has a no-arg constructor, but one of the
important parts of our factory/builder is you can store state in them that
is used in later calls so we need either arguments with the factory
constructor or the parser recognizing setters on the factory. In your
example class I could not make it work with VE 1.1 using something like
Factory factory = new Factory("text") and then later calling
label.setText(factory.getText()) to get "text" back. Would you expect that
to work in your example?

Is there any way to achieve this?

Thanks,

Hans

"Hans Boerstra" <hansboerstra@hotmail.com> wrote in message
news:dfkop0$tag$1@news.eclipse.org...
> Your class does not work in my setup, but I am using VE 1.0.1 with Eclipse
> 3.0.1 instead of VE 1.1.0 with Eclipse 3.1. Another reason to upgrade to
> 3.1 I guess. I will try that first to see if it solves my problem.
>
> Thanks,
>
> Hans
>
> "Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
> news:dfknah$rbc$1@news.eclipse.org...
>> Can I see your pattern exactly? Because this factory pattern works for us
>> in VE 1.1.0.
>>
>> package test;
>>
>> import java.awt.BorderLayout;
>> import javax.swing.JPanel;
>> import javax.swing.JFrame;
>> import javax.swing.JTextField;
>>
>> public class Test extends JFrame {
>>
>> private JPanel jContentPane = null;
>>
>> private Factory factory = new Factory();
>>
>> /**
>> * This is the default constructor
>> */
>> public Test() {
>> super();
>> initialize();
>> }
>>
>> /**
>> * This method initializes this
>> *
>> * @return void
>> */
>> private void initialize() {
>> this.setSize(300, 200);
>> this.setContentPane(getJContentPane());
>> this.setTitle("JFrame");
>> }
>>
>> /**
>> * This method initializes jContentPane
>> *
>> * @return javax.swing.JPanel
>> */
>> private JPanel getJContentPane() {
>> if (jContentPane == null) {
>> jContentPane = new JPanel();
>> jContentPane.setLayout(new BorderLayout());
>> JTextField ctrl = factory.getTextField("text");
>> jContentPane.add(ctrl, BorderLayout.SOUTH);
>> }
>> return jContentPane;
>> }
>>
>> }
>>
>> --
>> Thanks,
>> Rich Kulp
>
>
Re: parsing factory call [message #610682 is a reply to message #105422] Wed, 07 September 2005 13:25 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Yes, I would expect that to work too.

Does it fail on the factory.getText() (i.e. say "text - too complicated"
or something like that)? Or does it fail int eh Factory construction?

Also, try our maintenance 1.1.0.1 driver. I just tried new
Factory(String.class) as an example and it worked fine.

Hans Boerstra wrote:
> Rich,
>
> Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now noticed
> the difference between the no-arg factory in your example and our factory
> that takes a domain class as argument: factory = new Factory(Car.class); In
> VE 1.1 all goes well if the factory has a no-arg constructor, but one of the
> important parts of our factory/builder is you can store state in them that
> is used in later calls so we need either arguments with the factory
> constructor or the parser recognizing setters on the factory. In your
> example class I could not make it work with VE 1.1 using something like
> Factory factory = new Factory("text") and then later calling
> label.setText(factory.getText()) to get "text" back. Would you expect that

--
Thanks,
Rich Kulp
Re: parsing factory call [message #610687 is a reply to message #105472] Wed, 07 September 2005 18:04 Go to previous message
Hans Boerstra is currently offline Hans BoerstraFriend
Messages: 48
Registered: July 2009
Member
Rich,

I think I got it nailed down now (see attached testcase). The problem was
not in the factory call, but in the initialization. The factory class
Factory that gets i18n property values has to be initialized and that's were
I don't know how to proceed. I have attached a self contained testcase where
you can see that the factory for the JTextfield and JLabel work fine except
for the text of the label. That text is retrieved through the factory
instance and the static initialize method of the factory class has to be
called.
Is there a hook where I can get initialization code called? This would be
code that during run-time gets called by application initialization.

Regards,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfmpos$emq$1@news.eclipse.org...
> Yes, I would expect that to work too.
>
> Does it fail on the factory.getText() (i.e. say "text - too complicated"
> or something like that)? Or does it fail int eh Factory construction?
>
> Also, try our maintenance 1.1.0.1 driver. I just tried new
> Factory(String.class) as an example and it worked fine.
>
> Hans Boerstra wrote:
>> Rich,
>>
>> Using Eclipse 3.1 and VE 1.1.0 your class worked for me too. I now
>> noticed
>> the difference between the no-arg factory in your example and our factory
>> that takes a domain class as argument: factory = new Factory(Car.class);
>> In
>> VE 1.1 all goes well if the factory has a no-arg constructor, but one of
>> the
>> important parts of our factory/builder is you can store state in them
>> that
>> is used in later calls so we need either arguments with the factory
>> constructor or the parser recognizing setters on the factory. In your
>> example class I could not make it work with VE 1.1 using something like
>> Factory factory = new Factory("text") and then later calling
>> label.setText(factory.getText()) to get "text" back. Would you expect
>> that
>
> --
> Thanks,
> Rich Kulp


Re: parsing factory call [message #610688 is a reply to message #105540] Wed, 07 September 2005 18:38 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The only thing I can think of is in the Factory class put:

static {
if (Beans.isDesignTime()) {
initialize(...);
}
}

That way when in runtime this will execute and do nothing but in design
time (i.e. loaded by the VE) it will run and call your initialize.


--
Thanks,
Rich Kulp
Re: parsing factory call [message #610693 is a reply to message #105551] Wed, 07 September 2005 20:04 Go to previous message
Hans Boerstra is currently offline Hans BoerstraFriend
Messages: 48
Registered: July 2009
Member
Thanks Rich. This will work for now. I will put it in the generated screens.
Much less work ;-)
Maybe this can be solved without code adaption through a new VE feature
using a VE setting for a given project specifying the initialization class
to call for each VE VM that is started? This way all application
initialization code needed for the screens to display correctly can be
executed at the right time.

Thanks again for the support,

Hans

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:dfnc28$b39$1@news.eclipse.org...
> The only thing I can think of is in the Factory class put:
>
> static {
> if (Beans.isDesignTime()) {
> initialize(...);
> }
> }
>
> That way when in runtime this will execute and do nothing but in design
> time (i.e. loaded by the VE) it will run and call your initialize.
>
>
> --
> Thanks,
> Rich Kulp
Previous Topic:Error Message whenever i close Visual Editor
Next Topic:Error Message whenever i close Visual Editor
Goto Forum:
  


Current Time: Sat Apr 27 04:20:48 GMT 2024

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

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

Back to the top