Change in formatting for Windowbuilder? [message #1842926] |
Tue, 06 July 2021 10:57  |
Eclipse User |
|
|
|
So I recently downloaded eclipse and windowbuilder on a new machine and for some reason window builder creates different code on the new machine compared to the old one.
I use the same JDK and Eclipse version (JDK16 and Eclipse 2021-06) on both machines.
Is there a way to change the way the windowbuilder addon creates/formats code?
Here is an example of how code is generated on the old machine vs the new one.
Here is the code for a created jButton:
Old machine:
private JButton getBtnNewButton(){
if(btnNewButton == null){
btnNewButton = new JButton("New Button");
btnNewButton.addActionListener(new BtnNewButtonActionListener());
btnNewButton.setBound(178, 63, 85, 21);
}
return btnNewButton;
}
new machine:
JButton btnNewButton_1 = new JButton("New button");
btnNewButton_1.setBounds(25, 186, 89, 23);
contentPane.add(btnNewButton_1);
Is there a way to change the way windowbuilder creates/formats the code or do I have to get used to the way windowbuilder does it on my new machine
|
|
|
Re: Change in formatting for Windowbuilder? [message #1842958 is a reply to message #1842926] |
Wed, 07 July 2021 15:01  |
Eclipse User |
|
|
|
Hi
Your snippet does not substantiate any criticism of WindowBuilder
Since the new snippet avoids an "if", it is quite possible that the WindowBuilder code generation has got smarter and so probably better, but clearly different.
If indentation has changed that is probably down to some save / formatting preferences rather than WindowBuilder.
Bottom line: newer tools often have changes, usually improvements, but sadly occasionally regressions. If you have a clear regression, please provide a full repro and submit a Bugzilla.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.06096 seconds