Example usage for com.intellij.openapi.wm IdeFocusManager getFocusedDescendantFor

List of usage examples for com.intellij.openapi.wm IdeFocusManager getFocusedDescendantFor

Introduction

In this page you can find the example usage for com.intellij.openapi.wm IdeFocusManager getFocusedDescendantFor.

Prototype

@Nullable
public abstract Component getFocusedDescendantFor(@NotNull Component comp);

Source Link

Document

Finds focused component among descendants of the given component.

Usage

From source file:com.intellij.designer.LightToolWindow.java

License:Apache License

private boolean isActive() {
    IdeFocusManager fm = IdeFocusManager.getInstance(myProject);
    Component component = fm.getFocusedDescendantFor(this);
    if (component != null) {
        return true;
    }//from   w w w .ja  v  a  2s .  c  o m
    Component owner = fm.getLastFocusedFor(WindowManager.getInstance().getIdeFrame(myProject));
    return owner != null && SwingUtilities.isDescendingFrom(owner, this);
}