我在列中有一个 TextInputCell,如下所示:
TextInputCell textCell = new TextInputCell();
Column<EffortCost, String> hourColumn = new Column<EffortCost, String>(textCell) {
public String getValue(EffortCost object) {
String formatted = NumberFormat.getFormat("0.00").format(object.getHours());
return formatted;
}
};
我的字符串返回:“1.00”,如果我写“1”。我想要相同的结果,但我不想格式化字符串,我希望我的小部件立即执行此操作我将文本放入 TextInputCell,换句话说,我希望在我将文本写入我的文本时自动格式化字符串文本输入单元。这就像一个“MaskedTextInputCell”。我怎样才能做到这一点?我可以看一些例子吗?
感谢关注。