void (@NotNull Component component, int x, int y) { if (!component.isShowing()) { throw new IllegalArgumentException("component must be shown on the screen (" + component + ")"); } int x2 = Math.max(0, Math.min(x, component.getWidth() - 1)); // fit x into [0, width-1] int y2 = Math.max(0, Math.min(y, component.getHeight() - 1)); // fit y into [0, height-1] myContext = Utils.createAsyncDataContext( myDataContextProvider != null ? myDataContextProvider.get() : DataManager.getInstance().getDataContext(component, x2, y2)); updateChildren(new RelativePoint(component, new Point(x, y))); if (getComponentCount() == 0) { LOG.warn("'" + myPlace + "' popup menu fails to show: no menu items"); return; } if (!component.isShowing()) { LOG.warn("'" + myPlace + "' popup menu fails to show: component is not showing (" + component.getClass().getName() + ")"); return; } Application application = ApplicationManager.getApplication(); if (application != null && application.isActive()) { Component parent = ComponentUtil.findUltimateParent(component); myFrame = parent instanceof IdeFrame ? (IdeFrame)parent : null; if (myConnection == null) { myConnection = application.getMessageBus().connect(); myConnection.subscribe(ApplicationActivationListener.TOPIC, ActionPopupMenuImpl.this); } } myListener.targetComponent = component; super.show(component, x, y); }