protected boolean isLookupWindow(WindowInfo winInfo) { Element element = screenXmlLoader.load(winInfo.getTemplate(), winInfo.getId(), ParamsMap.empty()); String screenClassName = element.attributeValue("class"); try { Class<?> screenClass = Class.forName(screenClassName); if (AbstractLookup.class.isAssignableFrom(screenClass)) { return true; } } catch (NullPointerException | ClassNotFoundException e) { return false; } return false; }
/** * Open input parameters dialog if report has parameters otherwise print report * * @param report - target report * @param screen - caller window */ public void runReport(Report report, FrameOwner screen) { if (report == null) { throw new IllegalArgumentException("Can not run null report"); } if (report.getInputParameters() != null && report.getInputParameters().size() > 0 || inputParametersRequiredByTemplates(report)) { openReportParamsDialog(screen, report, null, null, null); } else { printReport(report, ParamsMap.empty(), screen); } }
@Override public void actionPerform(Component component) { if (substitutionsDs.getItem() != null) { Window editor = openEditor(substitutionsDs.getItem(), OpenType.DIALOG, ParamsMap.empty(), substitutionsDs); editor.addCloseListener(actionId -> { substTable.focus(); }); } } }
@Override public void actionPerform(Component component) { UserSubstitution substitution = metadata.create(UserSubstitution.class); substitution.setUser(userDs.getItem()); Window editor = openEditor(substitution, OpenType.DIALOG, ParamsMap.empty(), substitutionsDs); editor.addCloseListener(actionId -> { substTable.focus(); }); } }