DataContext () { if (myTargetComponent == null && getClientProperty(SUPPRESS_TARGET_COMPONENT_WARNING) == null && !ApplicationManager.getApplication().isUnitTestMode()) { putClientProperty(SUPPRESS_TARGET_COMPONENT_WARNING, true); LOG.warn("'" + myPlace + "' toolbar by default uses any focused component to update its actions. " + "Toolbar actions that need local UI context would be incorrectly disabled. " + "Please call toolbar.setTargetComponent() explicitly.", myCreationTrace); } Component target = myTargetComponent != null ? myTargetComponent : IJSwingUtilities.getFocusedComponentInWindowOrSelf(this); DataContext context = DataManager.getInstance().getDataContext(target); if (myAdditionalDataProvider != null) { return CustomizedDataContext.create(context, myAdditionalDataProvider); } else { return context; } }