for (int i = 1; i <= fraction; i++) {
sb.append("0");
}
DecimalFormat df = new DecimalFormat(sb.toString());
NumberFormatter nf = new NumberFormatter(df);
DefaultFormatterFactory factory = new DefaultFormatterFactory(nf);
((JFormattedTextField)component).setFormatterFactory(factory);
} else if (childColumn.getInputType() == 12) {
JComponent component = childComponentExt.getComponent();
CurrencyPlugin cp = CurrencyPlugin.getInstance();
UomPlugin up = UomPlugin.getInstance();
if (column.getPControls() != null) {
StringTokenizer st = new StringTokenizer(column.getPControls(), ".");
String tableName = (String)st.nextElement();
String columnName = (String)st.nextElement();
ComponentExt pComponentExt = relationManager.findComponentExt(tableName, columnName);
Object pValue = ComponentManager.getValue(pComponentExt.getComponent());
StringBuffer sb = new StringBuffer("###" + cp.getSepor() + "###");
int fraction = Integer.parseInt(GlobalValueManager.getValue("APPLIATION.DEFFRACTION"));
if (pValue != null)
fraction = up.getFraction(pValue.toString());
if (fraction > 0) {
sb.append(".");
}
for (int i = 1; i <= fraction; i++) {
sb.append("0");
}
DecimalFormat df = new DecimalFormat(sb.toString());
NumberFormatter nf = new NumberFormatter(df);
DefaultFormatterFactory factory = new DefaultFormatterFactory(nf);
((JFormattedTextField)component).setFormatterFactory(factory);
}
}
}
}