Install annotation = annotatedMethod.getAnnotation(); Frame frame = UiControllerUtils.getFrame(frameOwner);
Class<?> eventType = parameter.getType(); Frame frame = UiControllerUtils.getFrame(frameOwner); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner);
@Nullable protected Object getInjectedInstance(Class<?> type, String name, Class annotationClass, AnnotatedElement element) { Frame frame = UiControllerUtils.getFrame(frameOwner);
public Filter createFakeFilter() { if (filter != null) { return filter; } Filter fakeFilter = AppBeans.get(ComponentsFactory.NAME, ComponentsFactory.class).createComponent(Filter.class); ((HasXmlDescriptor) fakeFilter).setXmlDescriptor(Dom4j.readDocument("<filter/>").getRootElement()); CollectionDatasourceImpl fakeDatasource = new CollectionDatasourceImpl(); LegacyFrame legacyFrame = (LegacyFrame) this.frameOwner; DsContextImpl fakeDsContext = new DsContextImpl(legacyFrame.getDsContext().getDataSupplier()); FrameContextImpl fakeFrameContext = new FrameContextImpl((Frame) legacyFrame); fakeDsContext.setFrameContext(fakeFrameContext); fakeDatasource.setDsContext(fakeDsContext); //Attention: this query should match the logic in com.haulmont.reports.wizard.ReportingWizardBean.createJpqlDataSet() fakeDatasource.setQuery("select queryEntity from " + metaClass.getName() + " queryEntity"); fakeDatasource.setMetaClass(metaClass); fakeFilter.setDatasource(fakeDatasource); fakeFilter.setFrame(UiControllerUtils.getFrame(frameOwner)); return fakeFilter; }
/** * Shows standard unsaved changes dialog with Discard and Cancel actions. * * @param origin screen controller * @param closeAction close action * @return result */ public UnsavedChangesDialogResult showUnsavedChangesDialog(FrameOwner origin, @SuppressWarnings("unused") CloseAction closeAction) { UnsavedChangesDialogResult result = new UnsavedChangesDialogResult(); Dialogs dialogs = getScreenContext(origin).getDialogs(); dialogs.createOptionDialog() .withCaption(messages.getMainMessage("closeUnsaved.caption")) .withMessage(messages.getMainMessage("closeUnsaved")) .withType(Dialogs.MessageType.WARNING) .withActions( new DialogAction(DialogAction.Type.YES) .withHandler(e -> { result.discard(); }), new DialogAction(DialogAction.Type.NO, Action.Status.PRIMARY) .withHandler(e -> { Frame frame = UiControllerUtils.getFrame(origin); ComponentsHelper.focusChildComponent(frame); result.cancel(); }) ) .show(); return result; }
Frame parentFrame = getFrame(parent);
.withIcon(null) .withHandler(e -> { Frame frame = UiControllerUtils.getFrame(origin); ComponentsHelper.focusChildComponent(frame);