Widget ww = _getWidget(row, 0);
int left = ww.getAbsoluteLeft();
int top = ww.getAbsoluteTop();
MenuBar menu = new MenuBar(true);
final PopupPanel menuPopup = new PopupPanel(true);
if ( row >= FIRST_REGULAR_ROW ) {
menu.addItem(new MenuItem("Insert row above", new Command() {
public void execute() {
_insertRow(row, flexTable.getCellCount(row));
menuPopup.hide();
}
}));
}
menu.addItem(new MenuItem("Insert row below", new Command() {
public void execute() {
_insertRow(row + 1, flexTable.getCellCount(row));
menuPopup.hide();
}
}));
if ( row >= FIRST_REGULAR_ROW ) {
menu.addSeparator();
menu.addItem(new MenuItem("Delete row", new Command() {
public void execute() {
_deleteRow(row);
menuPopup.hide();
}
}));
}
menuPopup.setWidget(menu);
menuPopup.setPopupPosition(left, top);
menuPopup.show();
}