net.sf.okapi.common.uidescription
Class SpinInputPart

java.lang.Object
  extended by net.sf.okapi.common.uidescription.AbstractPart
      extended by net.sf.okapi.common.uidescription.SpinInputPart
All Implemented Interfaces:
IParameterDescriptor

public class SpinInputPart
extends AbstractPart

UI part descriptor for a spin-like input field. This UI part supports the following types: Integer.


Field Summary
 
Fields inherited from class net.sf.okapi.common.uidescription.AbstractPart
container, enabledOnSelection, labelFlushed, masterPart, paramDescriptor, vertical, withLabel
 
Constructor Summary
SpinInputPart(ParameterDescriptor paramDescriptor)
          Creates a new TextInputPart object with a given parameter descriptor.
 
Method Summary
protected  void checkType()
          Checks the types supported by this UI part.
 int getMaximumValue()
          Gets the maximum value allowed (for integer input).
 int getMinimumValue()
          Gets the minimum value allowed (for integer input).
 void setRange(int minimumValue, int maximumValue)
          Sets the minimum and maximum values allowed.
 
Methods inherited from class net.sf.okapi.common.uidescription.AbstractPart
getContainer, getDisplayName, getMasterPart, getName, getParent, getReadMethod, getShortDescription, getType, getWriteMethod, isEnabledOnSelection, isLabelFlushed, isVertical, isWithLabel, setContainer, setDisplayName, setLabelFlushed, setMasterPart, setShortDescription, setVertical, setWithLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpinInputPart

public SpinInputPart(ParameterDescriptor paramDescriptor)
Creates a new TextInputPart object with a given parameter descriptor.

Parameters:
paramDescriptor - the parameter descriptor for this UI part.
Method Detail

checkType

protected void checkType()
Description copied from class: AbstractPart
Checks the types supported by this UI part.

Overrides:
checkType in class AbstractPart

getMinimumValue

public int getMinimumValue()
Gets the minimum value allowed (for integer input).

Returns:
the minimum value allowed.

getMaximumValue

public int getMaximumValue()
Gets the maximum value allowed (for integer input).

Returns:
the maximum value allowed.

setRange

public void setRange(int minimumValue,
                     int maximumValue)
Sets the minimum and maximum values allowed. If the values are lesser or greater than the minimum and maximum values allowed by an Integer, they are reset to those values. If the maximum is less than the minimum it is reset to the minimum.

Parameters:
minimumValue - the minimum value allowed.
maximumValue - the maximum value allowed.