Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Looking for additional reviewers - builder classes for SWT

If I would see that code in the review, I would immediately ask to rework this. It is not maintainable, not debuggable, and the formatter will re-format the nice indents by the next possible occasion.

Am 23.10.2018 um 10:17 schrieb Stephan Aßmus:
Hi,

Am 23.10.2018 um 09:40 schrieb Eric Williams:
We have a patch in gerrit to add support for builder/factory classes into SWT: https://git.eclipse.org/r/#/c/131348/

Please take a look if you have a moment!

I think the setters should be named set*().

And perhaps it isn't as nice as it could be. There is no way to switch from one type of builder to another, and to express the layout of the UI in the code. Something like this would be nice:

void createUI(Composite parent) {
     WidgetBuilder.startVGroup(parent)
         .startHGroup()
             .addLabel()
                 .setText("Text:")
                 .end()
             .addText()
                 .setLimit(10)
                 .end()
             .end()
         .startHGroup()
             .addGlue()
             .addButton()
                 .setText("OK")
                 .end()
             .end()
         .end();
}

There are of course numerous alternative ways for the above, of which the pros and cons can be discussed. But if the end result is the possibility for such a construct, it would be nice.

Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

--
Kind regards,
Andrey Loskutov

http://google.com/+AndreyLoskutov
---------------------------------------------
Спасение утопающих - дело рук самих утопающих
---------------------------------------------


Back to the top