"Somebody's email.");
cols[5] = new Field("birthDate", "Birth Date", null, "Day of Birth");
ChangeMarkedTypeFactory factory = new ChangeMarkedTypeFactory();
final BoundTable t = new BoundTable(BoundTable.HEADER_MASK +
BoundTable.SORT_MASK + BoundTable.ROW_HANDLE_MASK +
BoundTable.NO_SELECT_COL_MASK + BoundTable.NO_SELECT_CELL_MASK +
BoundTable.MULTIROWSELECT_MASK +
BoundTable.MULTI_REQUIRES_SHIFT, factory, cols);
ArrayList<MyClass> list = new ArrayList<MyClass>();
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
list.add(new MyClass());
try {
t.addKeyBinding(new SuggestedKeyBinding('N', true, false, false),
new Task() {
public void run() {
MyClass newClass = new MyClass();
t.add(newClass);
List select = new ArrayList();
select.add(newClass);
t.setSelected(select);
}
});
t.addKeyBinding(new SuggestedKeyBinding(KeyBinding.DELETE, true,
false, false),
new Task() {
public void run() {
List selected = t.getSelected();
List value = (List) t.getValue();
value.removeAll(selected);
t.setValue(value);
}
});
} catch (Exception e) {
e.printStackTrace();
}
t.setValue(list);
add(t);
Button hide = new Button("Hide",
new ClickListener() {
public void onClick(Widget sender) {
t.setVisible(!t.isVisible());
GWT.log(t.isAttached() + "", null);
}
});
add(hide);
factory.setMarking(true);