buildHeaderModel();
columns.setModel(availableColumns);
rows.setModel(availableRows);
final Rect visibleRect = getWorkbookCtrl().getVisibleRect();
columns.addEventListener("onAfterRender", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
int width = ((visibleRect.getRight() - visibleRect.getLeft() + 1) / 4);
columns.setSelectedIndex(visibleRect.getLeft() + width);
}
});
rows.addEventListener("onAfterRender", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
int height = ((visibleRect.getBottom() - visibleRect.getTop() + 1) / 4);
rows.setSelectedIndex(visibleRect.getTop() + height);
}
});
}