Class WidgetBuilder<T extends org.eclipse.swt.widgets.Control>

java.lang.Object
org.pentaho.di.ui.core.widget.WidgetBuilder<T>

public class WidgetBuilder<T extends org.eclipse.swt.widgets.Control> extends Object
Builder class to simplify creation and layout of SWT controls.

To create a radio button inside of a composite and below a label, for example:

Button radioBtn = new WidgetBuilder

  • Constructor Details

    • WidgetBuilder

      public WidgetBuilder()
  • Method Details

    • below

      public WidgetBuilder<T> below(org.eclipse.swt.widgets.Control controlAbove, int margin)
    • rightOf

      public WidgetBuilder<T> rightOf(org.eclipse.swt.widgets.Control controlToLeft, int margin)
    • container

      public WidgetBuilder<T> container(org.eclipse.swt.widgets.Composite container)
    • left

      public WidgetBuilder<T> left(int percentageOfParent, int marginPixels)
    • right

      public WidgetBuilder<T> right(int percentageOfParent, int marginPixels)
    • bottom

      public WidgetBuilder<T> bottom(int percentageOfParent, int marginPixels)
    • top

      public WidgetBuilder<T> top(int percentageOfParent, int marginPixels)
    • height

      public WidgetBuilder<T> height(int height)
    • width

      public WidgetBuilder<T> width(int width)
    • margin

      public WidgetBuilder<T> margin(int width, int height)
    • style

      public WidgetBuilder<T> style(int style)
    • text

      public WidgetBuilder<T> text(String text)
    • image

      public WidgetBuilder<T> image(org.eclipse.swt.graphics.Image image)
    • items

      public WidgetBuilder<T> items(String... items)
    • props

      public WidgetBuilder<T> props(PropsUI props)
    • space

      public WidgetBuilder<T> space(org.pentaho.di.core.variables.VariableSpace space)
    • swtControlFactory

      public WidgetBuilder<T> swtControlFactory(WidgetBuilder.SWTControlFactory<T> swtControlFactory)
      Parameters:
      swtControlFactory - , typically the constructor for the desired swt control. E.g. Button::new swtControlFactory OR pdiVarControlFactory must be set, but not both.
    • pdiVarControlFactory

      public WidgetBuilder<T> pdiVarControlFactory(WidgetBuilder.PDIVarControlFactory<T> pdiVarControlFactory)
      Parameters:
      pdiVarControlFactory - , typically the construtor for the desired pdi var control. E.g. ComboVar::new swtControlFactory OR pdiVarControlFactory must be set, but not both.
    • build

      public T build()