アクションセルを GWT データグリッドに追加しようとしていますが、うまくいきません。GWT ショーケースを調べたところ、アクションセルをセルテーブルに追加する例が見つかりました。
// ActionCell.
addColumn(new ActionCell<ContactInfo>(
"Click Me", new ActionCell.Delegate<ContactInfo>() {
public void execute(ContactInfo contact) {
Window.alert("You clicked " + contact.getFullName());
}
}), "Action", new GetValue<ContactInfo>() {
public ContactInfo getValue(ContactInfo contact) {
return contact;
}
}, null);
ここに私の試みがありますが、これが構文的にどのように見えるべきかわかりません。どのように機能しますか?
Column<OpInventory, ActionCell<OpInventory>> checkColumn = new Column<OpInventory,
//I get an error on instantiating the Delegate
ActionCell<OpInventory>>(new ActionCell("x", new ActionCell.Delegate<OpInventory>())) {
//this is wrong here
@Override
public ActionCell getValue(OpInventory object) {
// TODO Auto-generated method stub
return null;
}
};
table.addColumn(checkColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
table.setColumnWidth(checkColumn, 40, Unit.PX);