@Override public void update(@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); OpenInBrowserRequest result = BaseOpenInBrowserAction.doUpdate(e); if (result == null) { return; } String description = getTemplatePresentation().getDescription(); if (HtmlUtil.isHtmlFile(result.getFile())) { description += " (hold Shift to open URL of local file)"; } presentation.setText(getTemplatePresentation().getText()); presentation.setDescription(description); WebBrowser browser = findUsingBrowser(); if (browser != null) { presentation.setIcon(browser.getIcon()); } if (ActionPlaces.isPopupPlace(e.getPlace())) { presentation.setVisible(presentation.isEnabled()); } }
@Override public boolean canHandleElement(OpenInBrowserRequest request) { if (request.getFile().getFileType() instanceof AsciiDocFileType) { return true; } return super.canHandleElement(request); }