org.pentaho.di.ui.core.widget
Class FormInput<C extends Control>

java.lang.Object
  extended by org.pentaho.di.ui.core.widget.FormInput<C>

public class FormInput<C extends 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

Nested Class Summary
static class FormInput.Position
          enumeration of available positioning elements
static class FormInput.Widget
          enumeration of the contained widgets
 
Field Summary
static String vc_id
           
 
Constructor Summary
FormInput(Label label, C input)
          Constructor.
 
Method Summary
 C getInput()
          getter for the input
 FormData getInputFD()
          getter for the inputFD
 Label getLabel()
          getter for the label
 FormData getLabelFD()
          getter for the labelFD
 String getText(FormInput.Widget widget)
          getter for the widget text
 void setInput(C input)
          setter for the input
 void setInputFD(FormData inputFD)
          setter for the inputFD
 void setLabel(Label label)
          setter for the label
 void setLabelFD(FormData labelFD)
          setter for the labelFD
 void setPosition(Control control, int offset, FormInput.Widget widget, FormInput.Position side)
          setter for the element position
 void setPosition(FormAttachment position, FormInput.Widget widget, FormInput.Position side)
          setter for the element position
 void setPosition(int numerator, int offset, FormInput.Widget widget, FormInput.Position side)
          setter for the element position
 void setText(String text, FormInput.Widget widget)
          setter for the widget text
 void setToolTip(String text, FormInput.Widget widget)
          setter for the tooltip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vc_id

public static final String vc_id
See Also:
Constant Field Values
Constructor Detail

FormInput

public FormInput(Label label,
                 C input)
Constructor.

Parameters:
label -
control - input
Method Detail

getLabel

public Label getLabel()
getter for the label

Returns:
label

setLabel

public void setLabel(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 FormData getLabelFD()
getter for the labelFD

Returns:
labelFD

setLabelFD

public void setLabelFD(FormData labelFD)
setter for the labelFD

Parameters:
labelFD -

getInputFD

public FormData getInputFD()
getter for the inputFD

Returns:
inputFD

setInputFD

public void setInputFD(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(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(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