Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Nice to have getJLabel()
Nice to have getJLabel() [message #50577] Fri, 16 July 2004 14:20 Go to next message
winni is currently offline winniFriend
Messages: 12
Registered: July 2009
Junior Member
Hi,

I used VE M1 (with Eclipse 3.0.0 M8) and I enjoyed the methods getJLabel
for each Label, because I have to set several properties (f.e. the
Dimension, Color, Textstyle..)

In S20040628 there is no method like getJLabel and the Label are only
local in the method initialize() :-((

How can I create this getJLabel()-methods?
How can I use them as member-Variables without editing the source?

Thanks and have a nice Weekend

Winni
Re: Nice to have getJLabel() [message #50630 is a reply to message #50577] Fri, 16 July 2004 14:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.us.ibm.com

Hi Winni,

We've fixed this so that labels will have global fields rather than get
methods (to cut down on source bloat as labels don't need to be changed
in 90% of the cases).

This fix hasn't made it into a stable build yet. If you'd like to
change the behavior yourself before a new build comes out, you can
follow these instructions (from an earlier newsgroup post)

Go to the eclipse\plugins\org.eclipse.ve.jfc_1.0.0\overrides\javax\swi ng
directory and edit the JLabel.override file in a text editor, and remove
this line:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="LOCAL"/>
The same goes for the Label.override in the awt directory.

For the fix we compromised by making Labels have a global field, but not
a get method (will be initialized in the parent's method.) For
manipulation of labels after the construction, in events, etc, you can
change the global field directly, rather than the usual get methods
employed by the VE code pattern. e.g. label1.setText("foo"); rather than
getLabel1().setText("foo");

Eventually we hope to have a refactoring so that any given bean can be
promoted to having its own field and get method, or demoted to being
initialized in its parent's method.

- Jeff

Winni P. wrote:

> Hi,
>
> I used VE M1 (with Eclipse 3.0.0 M8) and I enjoyed the methods getJLabel
> for each Label, because I have to set several properties (f.e. the
> Dimension, Color, Textstyle..)
>
> In S20040628 there is no method like getJLabel and the Label are only
> local in the method initialize() :-((
>
> How can I create this getJLabel()-methods?
> How can I use them as member-Variables without editing the source?
>
> Thanks and have a nice Weekend
>
> Winni
>
Re: Nice to have getJLabel() [message #50713 is a reply to message #50577] Fri, 16 July 2004 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

You still don't need a getLabel() to change the properties. You can
either change them at design time through the property sheet, or at
runtime you can change them in the initialize method. The only time you
need a getLabel() is if you want to change at some time AFTER it has
been initialized.

--
Thanks, Rich Kulp

Re: Nice to have getJLabel() [message #65720 is a reply to message #50713] Fri, 08 October 2004 19:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mb.thomas-daily.de

Rich Kulp schrieb:

> You still don't need a getLabel() to change the properties. You can
> either change them at design time through the property sheet, or at
> runtime you can change them in the initialize method. The only time you
> need a getLabel() is if you want to change at some time AFTER it has
> been initialized.

For my taste the code just look cleaner with getLabel(). I still achieve
getLabel() doing this workaround: I drop a new label on the "empty
background". Hope that helps. Although I don't know how 1.0 behaves.

I would like to see a global switch for that issue.

Marcus
Re: Nice to have getJLabel() [message #65764 is a reply to message #65720] Fri, 08 October 2004 20:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.gmail.com

Marcus,

There's an easier way to prevent this behavior from occuring. Open the
file
eclipse/plugins/org.eclipse.ve.jfc_1.0.1/overrides/javax/swi ng/JLabel.override
in a text editor and delete the following line from that file:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>

You can also remove the same line from overrides/java/awt/Label.override

The issue with customizable source patterns and flexibility of whether
get methods are generated for each member is still being worked on.
Hopefully this feature will be addressed in the next major release of
the VE.

- Jeff

Marcus Beyer wrote:
> Rich Kulp schrieb:
>
>> You still don't need a getLabel() to change the properties. You can
>> either change them at design time through the property sheet, or at
>> runtime you can change them in the initialize method. The only time
>> you need a getLabel() is if you want to change at some time AFTER it
>> has been initialized.
>
>
> For my taste the code just look cleaner with getLabel(). I still achieve
> getLabel() doing this workaround: I drop a new label on the "empty
> background". Hope that helps. Although I don't know how 1.0 behaves.
>
> I would like to see a global switch for that issue.
>
> Marcus
Re: Nice to have getJLabel() [message #65929 is a reply to message #65764] Sun, 10 October 2004 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mb.thomas-daily.de

Jeff Myers schrieb:

> Marcus,
>
> There's an easier way to prevent this behavior from occuring. Open the
> file
> eclipse/plugins/org.eclipse.ve.jfc_1.0.1/overrides/javax/swi ng/JLabel.override
> in a text editor and delete the following line from that file:
> <addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>

Thank you!! That did the trick :)

> The issue with customizable source patterns and flexibility of whether
> get methods are generated for each member is still being worked on.
> Hopefully this feature will be addressed in the next major release of
> the VE.

Cool!

thanx!
Marcus
Re: Nice to have getJLabel() [message #65951 is a reply to message #65764] Sun, 10 October 2004 10:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mb.thomas-daily.de

Jeff Myers schrieb:

>> For my taste the code just look cleaner with getLabel(). I still
>> achieve getLabel() doing this workaround: I drop a new label on the
>> "empty background". Hope that helps. Although I don't know how 1.0
>> behaves.

BTW: this procedure is still nice to create non-GUI beans (e.g.
DefaultListModel etc.) with VE-styled get methods.

Marcus
Re: Nice to have getJLabel() [message #66005 is a reply to message #65929] Mon, 11 October 2004 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

But remember this change will be wiped out whenever an update to the VE
has been applied.



--
Thanks,
Rich Kulp
Re: Nice to have getJLabel() [message #595394 is a reply to message #50577] Fri, 16 July 2004 14:28 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
Hi Winni,

We've fixed this so that labels will have global fields rather than get
methods (to cut down on source bloat as labels don't need to be changed
in 90% of the cases).

This fix hasn't made it into a stable build yet. If you'd like to
change the behavior yourself before a new build comes out, you can
follow these instructions (from an earlier newsgroup post)

Go to the eclipse\plugins\org.eclipse.ve.jfc_1.0.0\overrides\javax\swi ng
directory and edit the JLabel.override file in a text editor, and remove
this line:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="LOCAL"/>
The same goes for the Label.override in the awt directory.

For the fix we compromised by making Labels have a global field, but not
a get method (will be initialized in the parent's method.) For
manipulation of labels after the construction, in events, etc, you can
change the global field directly, rather than the usual get methods
employed by the VE code pattern. e.g. label1.setText("foo"); rather than
getLabel1().setText("foo");

Eventually we hope to have a refactoring so that any given bean can be
promoted to having its own field and get method, or demoted to being
initialized in its parent's method.

- Jeff

Winni P. wrote:

> Hi,
>
> I used VE M1 (with Eclipse 3.0.0 M8) and I enjoyed the methods getJLabel
> for each Label, because I have to set several properties (f.e. the
> Dimension, Color, Textstyle..)
>
> In S20040628 there is no method like getJLabel and the Label are only
> local in the method initialize() :-((
>
> How can I create this getJLabel()-methods?
> How can I use them as member-Variables without editing the source?
>
> Thanks and have a nice Weekend
>
> Winni
>
Re: Nice to have getJLabel() [message #595420 is a reply to message #50577] Fri, 16 July 2004 14:35 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

You still don't need a getLabel() to change the properties. You can
either change them at design time through the property sheet, or at
runtime you can change them in the initialize method. The only time you
need a getLabel() is if you want to change at some time AFTER it has
been initialized.

--
Thanks, Rich Kulp

Re: Nice to have getJLabel() [message #601082 is a reply to message #50713] Fri, 08 October 2004 19:40 Go to previous message
Marcus Beyer is currently offline Marcus BeyerFriend
Messages: 37
Registered: July 2009
Member
Rich Kulp schrieb:

> You still don't need a getLabel() to change the properties. You can
> either change them at design time through the property sheet, or at
> runtime you can change them in the initialize method. The only time you
> need a getLabel() is if you want to change at some time AFTER it has
> been initialized.

For my taste the code just look cleaner with getLabel(). I still achieve
getLabel() doing this workaround: I drop a new label on the "empty
background". Hope that helps. Although I don't know how 1.0 behaves.

I would like to see a global switch for that issue.

Marcus
Re: Nice to have getJLabel() [message #601091 is a reply to message #65720] Fri, 08 October 2004 20:06 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
Marcus,

There's an easier way to prevent this behavior from occuring. Open the
file
eclipse/plugins/org.eclipse.ve.jfc_1.0.1/overrides/javax/swi ng/JLabel.override
in a text editor and delete the following line from that file:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>

You can also remove the same line from overrides/java/awt/Label.override

The issue with customizable source patterns and flexibility of whether
get methods are generated for each member is still being worked on.
Hopefully this feature will be addressed in the next major release of
the VE.

- Jeff

Marcus Beyer wrote:
> Rich Kulp schrieb:
>
>> You still don't need a getLabel() to change the properties. You can
>> either change them at design time through the property sheet, or at
>> runtime you can change them in the initialize method. The only time
>> you need a getLabel() is if you want to change at some time AFTER it
>> has been initialized.
>
>
> For my taste the code just look cleaner with getLabel(). I still achieve
> getLabel() doing this workaround: I drop a new label on the "empty
> background". Hope that helps. Although I don't know how 1.0 behaves.
>
> I would like to see a global switch for that issue.
>
> Marcus
Re: Nice to have getJLabel() [message #601182 is a reply to message #65764] Sun, 10 October 2004 10:12 Go to previous message
Marcus Beyer is currently offline Marcus BeyerFriend
Messages: 37
Registered: July 2009
Member
Jeff Myers schrieb:

> Marcus,
>
> There's an easier way to prevent this behavior from occuring. Open the
> file
> eclipse/plugins/org.eclipse.ve.jfc_1.0.1/overrides/javax/swi ng/JLabel.override
> in a text editor and delete the following line from that file:
> <addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>

Thank you!! That did the trick :)

> The issue with customizable source patterns and flexibility of whether
> get methods are generated for each member is still being worked on.
> Hopefully this feature will be addressed in the next major release of
> the VE.

Cool!

thanx!
Marcus
Re: Nice to have getJLabel() [message #601187 is a reply to message #65764] Sun, 10 October 2004 10:28 Go to previous message
Marcus Beyer is currently offline Marcus BeyerFriend
Messages: 37
Registered: July 2009
Member
Jeff Myers schrieb:

>> For my taste the code just look cleaner with getLabel(). I still
>> achieve getLabel() doing this workaround: I drop a new label on the
>> "empty background". Hope that helps. Although I don't know how 1.0
>> behaves.

BTW: this procedure is still nice to create non-GUI beans (e.g.
DefaultListModel etc.) with VE-styled get methods.

Marcus
Re: Nice to have getJLabel() [message #601212 is a reply to message #65929] Mon, 11 October 2004 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

But remember this change will be wiped out whenever an update to the VE
has been applied.



--
Thanks,
Rich Kulp
Previous Topic:null pointer exception when opening custom-made composites
Next Topic:null pointer exception when opening custom-made composites
Goto Forum:
  


Current Time: Sat Nov 09 05:24:40 GMT 2024

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

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

Back to the top