speedscheduler
Class IntegerInput

java.lang.Object
  extended by speedscheduler.IntegerInput

public class IntegerInput
extends java.lang.Object

A convenient widget input box for inputting integers. Users cannot input anything but 0-9 into this baby.


Nested Class Summary
private  class IntegerInput.IntegerVerifyListener
           
 
Field Summary
private  org.eclipse.swt.widgets.Text input
           
private  IntegerInput.IntegerVerifyListener listener
           
 
Constructor Summary
IntegerInput(org.eclipse.swt.widgets.Composite parent, int style)
          Creates a new IntegerInput widget, embedded in the specified parent Composite, with the specified style.
 
Method Summary
 void addListener(int type, org.eclipse.swt.widgets.Listener listener)
           
 void addModifyListener(org.eclipse.swt.events.ModifyListener listener)
          Adds a ModifyListener to this inptu box, such that every time a new character is inputted, this event will fire.
 int getValue()
          Gets the value entered by the user
 void setEnabled(boolean enabled)
          Enables/disables this widget.
 void setLayoutData(java.lang.Object layoutData)
          Sets the layoutData for this widget.
 void setSize(int width, int height)
          Sets the width and height of the widget (only if your layout manager respects this).
 void setValue(int newValue)
          Sets the displayed value for the widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

private org.eclipse.swt.widgets.Text input

listener

private IntegerInput.IntegerVerifyListener listener
Constructor Detail

IntegerInput

public IntegerInput(org.eclipse.swt.widgets.Composite parent,
                    int style)
Creates a new IntegerInput widget, embedded in the specified parent Composite, with the specified style.

Parameters:
parent - The composite to put this widget in.
style - The style with which to draw this widget
See Also:
SWT
Method Detail

getValue

public int getValue()
Gets the value entered by the user

Returns:
The integer value entered by the user.

setValue

public void setValue(int newValue)
Sets the displayed value for the widget.

Parameters:
newValue - The value to display.

addModifyListener

public void addModifyListener(org.eclipse.swt.events.ModifyListener listener)
Adds a ModifyListener to this inptu box, such that every time a new character is inputted, this event will fire.

Parameters:
listener - The ModifyListener to notify when the event happens.
See Also:
ModifyListener

setLayoutData

public void setLayoutData(java.lang.Object layoutData)
Sets the layoutData for this widget.

Parameters:
layoutData - The layoutData to set.
See Also:
org.eclipse.swt.widgets.Control.setLayoutData

setEnabled

public void setEnabled(boolean enabled)
Enables/disables this widget.

Parameters:
enabled - Specify true to enable this widget (allow input), and false to disalbe this widget (disallow input, and turn it gray).

setSize

public void setSize(int width,
                    int height)
Sets the width and height of the widget (only if your layout manager respects this).

Parameters:
width - The new width.
height - The new height.

addListener

public void addListener(int type,
                        org.eclipse.swt.widgets.Listener listener)