Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.util
Class NumberInput

java.lang.Object
  extended by Composite
      extended by ch.elexis.util.NumberInput

public class NumberInput
extends Composite

A class to display and let the user change or enter numbers. It will also display a spinner besides the input field to let the user increment or decrement the value by a specific count between a given mi and max value.

Author:
gerry

Constructor Summary
NumberInput(Composite parent, java.lang.String label)
          Create an empty number input with a default increment of 5, a minimum of 5 and a maximum of 1440 (which happens to be the number of minutes in a day)
 
Method Summary
 Spinner getControl()
           
 int getValue()
          Get the actually displayed value of the input field
 void setMinMaxInc(int min, int max, int inc)
          set the spinner's minimum, maximum and increment values
 void setValue(int val)
          Set the value to display
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberInput

public NumberInput(Composite parent,
                   java.lang.String label)
Create an empty number input with a default increment of 5, a minimum of 5 and a maximum of 1440 (which happens to be the number of minutes in a day)

Parameters:
parent -
label - the label to display on top of the input field
Method Detail

setMinMaxInc

public void setMinMaxInc(int min,
                         int max,
                         int inc)
set the spinner's minimum, maximum and increment values

Parameters:
min - the spinner can not reduce the number lower than min
max - the spinner can not increase the num,ber higher than max
inc - the spinner will increase or decrease every time by inc

getValue

public int getValue()
Get the actually displayed value of the input field

Returns:
a value that is not necessarily between min and max

getControl

public Spinner getControl()

setValue

public void setValue(int val)
Set the value to display

Parameters:
val - an integer that has not necessarily to be between min and max

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis