OwnerOptional (Consumer<? super Frame> consumer) { if (myPermanentOwner instanceof Frame) { if (myPermanentOwner instanceof IdeFrame.Child ideFrameChild) { myPermanentOwner = WindowManager.getInstance().getFrame(ideFrameChild.getProject()); } consumer.accept((Frame)this.myPermanentOwner); } return this; }