@Override
protected void execInitPage() throws ProcessingException {
ArrayList<IMenu> menus = new ArrayList<>();
menus.addAll(Arrays.asList(getTable().getMenus()));
SomeLookupCall call = new SomeLookupCall();
call.setText("A7* - ");
LookupRow[] rows = null;
try {
rows = call.getDataByText();
}
catch (ProcessingException e) {
// do nothing
}
if (rows != null) {
for (LookupRow row : rows) {
final String s = row.getText();
IMenu menu = new AbstractMenu() {
@Override
public String getText() {
return s;
}
@Override
protected void execAction() throws ProcessingException {
doSomethingAwesomeWith(s);
}
};
menus.add(menu);
}
getTable().setMenus(menus.toArray(new IMenu[0]));
}
}