1 package com.calipso.reportgenerator.userinterface; 2 3 import com.calipso.reportgenerator.reportcalculator.SharedInteger; 4 5 import javax.swing.text.Document ; 6 7 12 13 public class UPIntegerTextField extends UPTextField { 14 15 public UPIntegerTextField() { 16 } 17 18 public UPIntegerTextField(String text) { 19 super(text); 20 } 21 22 public UPIntegerTextField(int columns) { 23 super(columns); 24 } 25 26 public UPIntegerTextField(String text, int columns) { 27 super(text, columns); 28 } 29 30 public UPIntegerTextField(Document doc, String text, int columns) { 31 super(doc, text, columns); 32 } 33 34 public boolean isLessThan(UPTextField upTextField) { 35 SharedInteger integer = (SharedInteger) getComponentValue(); 36 int result = integer.compareTo(upTextField.getComponentValue()); 37 if(result > 0) { 38 return false; 39 } else { 40 return true; 41 } 42 } 43 44 public Object getComponentValue() { 45 String text = super.getText(); 46 return SharedInteger.newFrom(Integer.valueOf(text)); 47 } 48 } 49 | Popular Tags |