Example usage for com.intellij.openapi.wm WindowManager findVisibleFrame

List of usage examples for com.intellij.openapi.wm WindowManager findVisibleFrame

Introduction

In this page you can find the example usage for com.intellij.openapi.wm WindowManager findVisibleFrame.

Prototype

public abstract JFrame findVisibleFrame();

Source Link

Usage

From source file:com.intellij.ui.popup.AbstractPopup.java

License:Apache License

@Override
public void showInFocusCenter() {
    final Component focused = getWndManager().getFocusedComponent(myProject);
    if (focused != null) {
        showInCenterOf(focused);//from w ww  . java 2  s  . c  o m
    } else {
        final WindowManager manager = WindowManager.getInstance();
        final JFrame frame = myProject != null ? manager.getFrame(myProject) : manager.findVisibleFrame();
        showInCenterOf(frame.getRootPane());
    }
}