Binding bindingRow = new Binding();
topBinding.getChildren().add(bindingRow);
int count = topBinding.getChildren().size();
final Button handle;
int startColumn = 0;
if ((this.masks & BoundTable.ROW_HANDLE_MASK) > 0) {
handle = new Button((this.getActive() && (rowHandles.size() < 9))
? Integer.toString(this.rowHandles.size() + 1) : " ");
handle.setStyleName("rowHandle");
handle.addFocusListener(new FocusListener() {
public void onFocus(Widget sender) {
if (shiftDown) {
return;
}
setActive(true);
List newSelected = null;
if ((masks & BoundTable.MULTIROWSELECT_MASK) > 0) {
newSelected = new ArrayList(getSelected());
if (newSelected.contains(o)) {
newSelected.remove(o);
} else {
newSelected.add(o);
}
} else {
newSelected = new ArrayList();
newSelected.add(o);
}
setSelected(newSelected);
}
public void onLostFocus(Widget sender) {
}
});
handle.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
setActive(true);
List newSelected = null;
if ((masks & BoundTable.MULTIROWSELECT_MASK) > 0) {
newSelected = new ArrayList(getSelected());
if (newSelected.contains(o)) {
newSelected.remove(o);
} else {
newSelected.add(o);
}
} else {
newSelected = new ArrayList();
newSelected.add(o);
}
if (handle != null) {
handle.setFocus(true);
}
if (handle != null) {
handle.setFocus(true);
}
setSelected(newSelected);
}
});
startColumn++;
this.rowHandles.add(handle);
this.table.setWidget(row, 0, handle);
} else {
handle = null;
}
if (count < 10) {
SuggestedKeyBinding kb = new SuggestedKeyBinding(Integer.toString(
count).charAt(0), false, true, false);
Task task = new Task() {
public void run() {
List newSelected = new ArrayList(getSelected());
if (newSelected.contains(o)) {
newSelected.remove(o);
} else {
newSelected.add(o);
}
setSelected(newSelected);
if (handle != null) {
handle.setFocus(true);
}
}
};
this.keyBindings.put(kb, task);