Window helpWindow = windowPresentation.getHelpWindow(); helpWindow.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
protected Window newHelpWindow(final DefaultHelpBroker helpBroker) { // found bug with the javax.help // Exception in thread "main" java.lang.SecurityException: no manifiest // section for signature file entry // com/sun/java/help/impl/TagProperties.class // Solution is to remove the rsa files from the jar final WindowPresentation pres = helpBroker.getWindowPresentation(); pres.createHelpWindow(); Window helpWindow = pres.getHelpWindow(); helpWindow.setLocationRelativeTo(null); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (final Exception e) { String title = e.getLocalizedMessage(); String htmlMessage = "<html><body width='650'>" + "<h2>" + title + "</h2>" + "<p>" + e.getMessage(); JOptionPane.showMessageDialog(this.getParent(), htmlMessage, title, JOptionPane.ERROR_MESSAGE); log.log(Level.SEVERE, e.getMessage(), e); } SwingUtilities.updateComponentTreeUI(helpWindow); return helpWindow; }
/** * Disposes the application help system. */ public static void dispose() { if (isInitialized()) { Window helpWindow = helpBroker.getWindowPresentation().getHelpWindow(); if (helpWindow != null) { helpWindow.dispose(); } helpBroker = null; } }
public void run() throws HelpSetException, MalformedURLException { HelpBroker broker = Application.getInstance().getContext().getHelpBroker(); CSH.DisplayHelpFromFocus helpFromFocus = new CSH.DisplayHelpFromFocus(broker); helpFromFocus.actionPerformed(getEvent()); final Window window = ((DefaultHelpBroker) broker).getWindowPresentation().getHelpWindow(); window.setIconImage(WindowHelper.getFrame().getIconImage()); if (window instanceof JFrame) { JRootPane rootPane = ((JFrame) window).getRootPane(); rootPane.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { window.setVisible(false); } }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); } } }