int (String string) { LookupImpl lookup = (LookupImpl)LookupManager.getInstance(getProject()).showLookup( getEditor(), LookupElementBuilder.create(string) ); JList<?> list = lookup.getList(); list.setSize(1, 1); // Make it visible PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue(); int width = lookup.myCellRenderer.getLookupTextWidth(); lookup.hide(); return width; }