private void showHelpIfPresent() { plugin.getHelpLink().ifPresent(l -> { try { Desktop.getDesktop().browse(l); } catch (IOException e1) { logger.warn("An error occurred whilst navigating to the help for the {} view. URL: {}", plugin.getLabel(), l); } }); }
private void addViewManipulationActions() { // View manipulation toolbar ViewBanner viewBanner = viewBarComponent.getViewBar().getViewBanner(); plugin.getHelpLink().ifPresent(u -> viewBanner.addAction("Help", HelpIcon.get(), this::showHelpIfPresent)); viewBanner.addAction("Split vertically", SplitVerticallyIcon.get(), this::splitVertically); viewBanner.addAction("Split horizontally", SplitHorizontallyIcon.get(), this::splitHorizontally); viewBanner.addAction("Float", FloatIcon.get(), this::copyAndFloatView); viewBanner.addAction("Close", CloseIcon.get(), this::closeView); }