Class SashFactory


public final class SashFactory extends AbstractControlFactory<SashFactory,Sash>
This class provides a convenient shorthand for creating and initializing Sash. This offers several benefits over creating Sash normal way: Example usage:
 Sash sash = SashFactory.newSash(SWT.HORIZONTAL) //
                .onSelect(event -> sashSelected(event)) //
                .layoutData(gridData) //
                .create(parent);
 

The above example creates a horizontal sash, registers a SelectionListener and finally creates the sash in "parent".

 GridDataFactory gridDataFactory = GridDataFactory.swtDefaults();
 SashFactory sashFactory = SashFactory.newSash(SWT.HORIZONTAL).onSelect(event -> sashSelected(event))
                .layout(gridDataFactory::create);
 sashFactory.data("Sash 1").create(parent);
 sashFactory.data("Sash 2").create(parent);
 sashFactory.data("Sash 3").create(parent);
 

The above example creates three sashs using the same instance of SashFactory. Note the layout method. A Supplier is used to create unique GridData for every single sash.

Since:
3.21