Class FormInput<C extends org.eclipse.swt.widgets.Control>


  • public class FormInput<C extends org.eclipse.swt.widgets.Control>
    extends Object
    This class defines the fairly generic FormInput. This class is simply a convenience utility, containing the primary information required to build an input for a FormLayout. This template requires one to define the type of contained control. ex: FormInput input = new FormInput( new Label( shell, SWT.NONE ), new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER) ); input.setText( "Hello", FormInput.Widget.LABEL ); input.setText( "World", FormInput.Widget.INPUT ); input.setToolTip( "To whom do you want to send a shout out?", FormInput.Widget.INPUT ); input.setPosition( 0, 47, FormInput.Widget.LABEL, FormInput.Position.LEFT ); input.setPosition( 0, 130, FormInput.Widget.LABEL, FormInput.Position.RIGHT ); input.setPosition( input.getLabel( ), 10, FormInput.Widget.INPUT, FormInput.Position.LEFT );
    Author:
    Robert D. Rice
    • Field Detail

      • label

        protected org.eclipse.swt.widgets.Label label
        attributes
      • input

        protected C extends org.eclipse.swt.widgets.Control input
      • labelFD

        protected org.eclipse.swt.layout.FormData labelFD
      • inputFD

        protected org.eclipse.swt.layout.FormData inputFD
    • Constructor Detail

      • FormInput

        public FormInput​(org.eclipse.swt.widgets.Label label,
                         C input)
        Constructor.
        Parameters:
        label -
        control - input
    • Method Detail

      • getLabel

        public org.eclipse.swt.widgets.Label getLabel()
        getter for the label
        Returns:
        label
      • setLabel

        public void setLabel​(org.eclipse.swt.widgets.Label label)
        setter for the label
        Parameters:
        label -
      • getInput

        public C getInput()
        getter for the input
        Returns:
        input
      • setInput

        public void setInput​(C input)
        setter for the input
        Parameters:
        input -
      • getLabelFD

        public org.eclipse.swt.layout.FormData getLabelFD()
        getter for the labelFD
        Returns:
        labelFD
      • setLabelFD

        public void setLabelFD​(org.eclipse.swt.layout.FormData labelFD)
        setter for the labelFD
        Parameters:
        labelFD -
      • getInputFD

        public org.eclipse.swt.layout.FormData getInputFD()
        getter for the inputFD
        Returns:
        inputFD
      • setInputFD

        public void setInputFD​(org.eclipse.swt.layout.FormData inputFD)
        setter for the inputFD
        Parameters:
        inputFD -
      • setPosition

        public void setPosition​(int numerator,
                                int offset,
                                FormInput.Widget widget,
                                FormInput.Position side)
        setter for the element position
        Parameters:
        numerator -
        offset -
        widget - to set position, [ lable, input ]
        position - side, [ left, right, top, bottom ]
      • setPosition

        public void setPosition​(org.eclipse.swt.widgets.Control control,
                                int offset,
                                FormInput.Widget widget,
                                FormInput.Position side)
        setter for the element position
        Parameters:
        Control -
        offset -
        widget - to set position, [ lable, input ]
        position - side, [ left, right, top, bottom ]
      • setPosition

        public void setPosition​(org.eclipse.swt.layout.FormAttachment position,
                                FormInput.Widget widget,
                                FormInput.Position side)
        setter for the element position
        Parameters:
        FormAttachment - position
        widget - to set position, [ lable, input ]
        position - side, [ left, right, top, bottom ]
      • setText

        public void setText​(String text,
                            FormInput.Widget widget)
        setter for the widget text
        Parameters:
        string - text
        widget - to set text on
      • getText

        public String getText​(FormInput.Widget widget)
        getter for the widget text
        Parameters:
        widget - to retrieve the text from
        Returns:
        string text
      • setToolTip

        public void setToolTip​(String text,
                               FormInput.Widget widget)
        setter for the tooltip
        Parameters:
        string - text