void (JComponent component, StatusText emptyText) { emptyText.setText(ExecutionBundle.message("service.view.empty.tree.text")); emptyText.appendSecondaryText(ExecutionBundle.message("service.view.add.service.action.name"), SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ActionGroup addActionGroup = ObjectUtils.tryCast( ActionManager.getInstance().getAction(ADD_SERVICE_ACTION_ID), ActionGroup.class); if (addActionGroup == null) return; Point position = component.getMousePosition(); if (position == null) { Rectangle componentBounds = component.getBounds(); Rectangle textBounds = emptyText.getComponent().getBounds(); position = new Point(componentBounds.width / 2, componentBounds.height / (emptyText.isShowAboveCenter() ? 3 : 2) + textBounds.height / 4); } DataContext dataContext = DataManager.getInstance().getDataContext(component); JBPopupFactory.getInstance().createActionGroupPopup( addActionGroup.getTemplatePresentation().getText(), addActionGroup, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, null, -1, null, ActionPlaces.getActionGroupPopupPlace(ADD_SERVICE_ACTION_ID)) .show(new RelativePoint(component, position)); } }); AnAction addAction = ActionManager.getInstance().getAction(ADD_SERVICE_ACTION_ID); ShortcutSet shortcutSet = addAction == null ? null : addAction.getShortcutSet(); Shortcut shortcut = shortcutSet == null ? null : ArrayUtil.getFirstElement(shortcutSet.getShortcuts()); if (shortcut != null) { emptyText.appendSecondaryText(" (" + KeymapUtil.getShortcutText(shortcut) + ")", StatusText.DEFAULT_ATTRIBUTES, null); } }