void (ToolbarDecorator toolbarDecorator) { AnActionButton specifyUrlButton = new DumbAwareActionButton(JavaUiBundle.messagePointer("sdk.paths.specify.url.button"), IconUtil.getAddLinkIcon()) { @Override public void actionPerformed(@NotNull AnActionEvent e) { onSpecifyUrlButtonClicked(); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } }; specifyUrlButton.setShortcut(CustomShortcutSet.fromString("alt S")); specifyUrlButton.addCustomUpdater(e -> myEnabled); toolbarDecorator.addExtraAction(specifyUrlButton); }