类 UIBuilderDelegate<T extends JComponent>

java.lang.Object
pkg.exoad.poprock.desktop.ui.UIDelegate<T>
pkg.exoad.poprock.desktop.ui.UIBuilderDelegate<T>
所有已实现的接口:
SelfReportingMixin, UIBasicDelegate<T>

public class UIBuilderDelegate<T extends JComponent> extends UIDelegate<T>
A builder delegate that allows for the usage of a lambda Supplier inplace of a regular delegate. This is especially useful for logical delegation that a simple ternary operator cannot suffice.

Example Usage

 UIOtherDelegate().make()
 .withComponent(
 UIBuilderDelegate.make(()->
 {
 int i=fetchSomeNumber();
 return GlobalContext.at(i);
 }
 )
 )
 
You could definitely do something similar where the logic for fetchSomeNumber was handled outside of the root UIOtherDelegate's make, but most of the time this is not the case
作者:
Jack Meng
另请参阅: