Example usage for com.intellij.openapi.wm IdeFrame KEY

List of usage examples for com.intellij.openapi.wm IdeFrame KEY

Introduction

In this page you can find the example usage for com.intellij.openapi.wm IdeFrame KEY.

Prototype

DataKey KEY

To view the source code for com.intellij.openapi.wm IdeFrame KEY.

Click Source Link

Usage

From source file:com.intellij.ide.navigationToolbar.SelectInNavBarTarget.java

License:Apache License

private static void selectInNavBar() {
    DataManager.getInstance().getDataContextFromFocus().doWhenDone(new AsyncResult.Handler<DataContext>() {
        @Override/*  ww w.j a  v  a2  s. c om*/
        public void run(DataContext context) {
            final IdeFrame frame = IdeFrame.KEY.getData(context);
            if (frame != null) {
                final IdeRootPaneNorthExtension navBarExt = frame
                        .getNorthExtension(NavBarRootPaneExtension.NAV_BAR);
                if (navBarExt != null) {
                    final JComponent c = navBarExt.getComponent();
                    final NavBarPanel panel = (NavBarPanel) c.getClientProperty("NavBarPanel");
                    panel.rebuildAndSelectTail(true);
                }
            }
        }
    });
}