Class LabeledControl


  • public class LabeledControl
    extends Object
    Creates a label paired with an swt control immediately below it. Call .attachBelow() to place the paired label/control below another control in a form.

    The LabeledControl.Series inner class allows creating a series of labeled controls, each automatically attached the its preceding control. E.g. +--------+ |Label1 | +--------+ |Control1| +--------+ |Label2 | +--------+ |Control2| +--------+ |Label3 | +--------+ |Control3| +--------+

    or if using LabeledControl.Series.layout(int height, int width, int numcols), labeled controls will be layed out top down / left right with mechanics similar to GridLayout. E.g.

    +--------+--------+--------+ |Wide Label1 |Label4 | +--------+--------+--------+ |Wide Control |Control4| +--------+--------+--------+ |Label2 |Label3 |Label5 | +--------+--------+--------+ |Control2|Control3|Control5| +--------+--------+--------+

    LabeledControl.Series.hideAll() and LabeledControl.Series.show(Control) will update attachments automatically to shift paired labels/controls up when preceding controls are hidden.

    • Method Detail

      • labeledControl

        public static LabeledControl labeledControl​(org.eclipse.swt.widgets.Composite parentComp,
                                                    String labelText,
                                                    org.eclipse.swt.widgets.Control control,
                                                    int controlWidth,
                                                    PropsUI props)
      • attachBelow

        public void attachBelow​(org.eclipse.swt.widgets.Control control)
        Attaches this LabeledControl below control. If null, attaches to the top of the container.
      • attachBelow

        public void attachBelow​(org.eclipse.swt.widgets.Control control,
                                int left)