public AwtPopupWrapper(Popup popup) { myPopup = popup; if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel()) { final Component c = (Component) ReflectionUtil.getField(Popup.class, myPopup, Component.class, "component"); c.setBackground(UIUtil.getPanelBackground()); } }
public void dispose() { try { myVirtualMachine.dispose(); } catch (UnsupportedOperationException e) { LOG.info(e); } // Memory leak workaround, see IDEA-163334 TargetVM target = ReflectionUtil.getField( myVirtualMachine.getClass(), myVirtualMachine, TargetVM.class, "target"); if (target != null) { Thread controller = ReflectionUtil.getField(target.getClass(), target, Thread.class, "eventController"); if (controller != null) { controller.stop(); } } }
static { Class<?> aClass = null; Set<String> files = null; try { aClass = Class.forName("java.io.DeleteOnExitHook"); files = ReflectionUtil.getField(aClass, null, Set.class, "files"); } catch (Exception ignored) { } DELETE_ON_EXIT_HOOK_CLASS = aClass; DELETE_ON_EXIT_HOOK_DOT_FILES = files; }
public Window getWindow() { final Component c = (Component) ReflectionUtil.getField(Popup.class, myPopup, Component.class, "component"); return c instanceof JWindow ? (JWindow) c : null; }