/** @return The top-most panel of the window this toolbar belongs to. */ public Component getMainComponent() { // if this is the general toolbar the main component is the application // main // component (not true for toolbars in EV) if (dockPanel == null) { return app.wrapGetMainComponent(); } // this toolbar belongs to a dock panel // in frame? if (dockPanel.isOpenInFrame()) { return dockPanel; } // otherwise use the application main component return app.wrapGetMainComponent(); }