class MoreInfoDialog {

  private final JDialog dialog = new JDialog();
  private final String title;
  private final String message;
  private final Rule rule;
  private final URL matchUrl;
  private final ResourceBundle messages;
  private final String lang;

  public MoreInfoDialog(String title, String message, Rule rule, URL matchUrl, ResourceBundle messages, String lang) {
    this.title = title;
    this.message = message;
    this.rule = rule;
    this.matchUrl = matchUrl;
    this.messages = messages;
    this.lang = lang;
  }

  public void show() {<FILL_FUNCTION_BODY>}

  public void close() {
    dialog.setVisible(false);
  }

}

    try {
      int dialogWidth = 320;
      JTextPane textPane = new JTextPane();
      textPane.setEditable(false);
      textPane.setContentType("text/html");
      textPane.setBorder(BorderFactory.createEmptyBorder());
      textPane.setOpaque(false);
      textPane.setBackground(new Color(0, 0, 0, 0));
      Tools.addHyperlinkListener(textPane);
      textPane.setSize(dialogWidth, Short.MAX_VALUE);
      String messageWithBold = message.replaceAll("<suggestion>", "<b>").replaceAll("</suggestion>", "</b>");
      String exampleSentences = Tools.getExampleSentences(rule, messages);
      String url = "http://community.languagetool.org/rule/show/" + Tools.encodeUrl(rule)
              + "?lang=" + lang + "&amp;ref=standalone-gui";
      boolean isExternal = rule.getCategory().getLocation() == Category.Location.EXTERNAL;
      String ruleDetailLink = rule instanceof FalseFriendPatternRule || isExternal ?
              "" : "<a href='" + url + "'>" + messages.getString("ruleDetailsLink") +"</a>";
      textPane.setText("<html>"
              + messageWithBold + exampleSentences + Tools.formatURL(matchUrl)
              + "<br><br>"
              + ruleDetailLink
              + "</html>");
      JScrollPane scrollPane = new JScrollPane(textPane);
      scrollPane.setPreferredSize(
              new Dimension(dialogWidth, textPane.getPreferredSize().height));
      scrollPane.setBorder(BorderFactory.createEmptyBorder());

      String cleanTitle = title.replace("<suggestion>", "'").replace("</suggestion>", "'");

      dialog.setName(cleanTitle);
      dialog.setTitle(cleanTitle);
      dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
      Image ltImage = OfficeTools.getLtImage();
      ((Frame) dialog.getOwner()).setIconImage(ltImage);
      
      dialog.addWindowFocusListener(new WindowFocusListener() {
        @Override
        public void windowGainedFocus(WindowEvent e) {
        }

        @Override
        public void windowLostFocus(WindowEvent e) {
          close();
        }
      });
      
      JButton close = new JButton(messages.getString("guiOOoCloseButton"));
      close.addActionListener(e -> {
        close();
      });

      JPanel infoPanel = new JPanel();
      infoPanel.setLayout(new GridBagLayout());
      GridBagConstraints cons = new GridBagConstraints();
      cons.insets = new Insets(6, 0, 0, 15);
      cons.gridx = 0;
      cons.gridy = 0;
      cons.anchor = GridBagConstraints.WEST;
      cons.fill = GridBagConstraints.NONE;
      cons.weightx = 1.0f;
      cons.weighty = 1.0f;
      infoPanel.add(textPane, cons);
      
      JPanel closeButtonPanel = new JPanel();
      closeButtonPanel.setLayout(new GridBagLayout());
      cons = new GridBagConstraints();
      cons.insets = new Insets(6, 12, 0, 15);
      cons.gridx = 0;
      cons.gridy = 0;
      cons.anchor = GridBagConstraints.EAST;
      cons.fill = GridBagConstraints.NONE;
      cons.weightx = 1.0f;
      cons.weighty = 1.0f;
      closeButtonPanel.add(close, cons);
      
      JPanel panel = new JPanel();
      panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
      panel.add(infoPanel);
      panel.add(closeButtonPanel);
      Container contentPane = dialog.getContentPane();
      contentPane.setLayout(new GridBagLayout());
      cons = new GridBagConstraints();
      cons.insets = new Insets(8, 8, 8, 8);
      cons.gridx = 0;
      cons.gridy = 0;
      cons.weightx = 10.0f;
      cons.weighty = 10.0f;
      cons.fill = GridBagConstraints.BOTH;
      cons.anchor = GridBagConstraints.NORTHWEST;
      contentPane.add(panel, cons);
      dialog.pack();
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      Dimension frameSize = dialog.getSize();
      dialog.setLocation(screenSize.width / 2 - frameSize.width / 2,
          screenSize.height / 2 - frameSize.height / 2);
      dialog.setLocationByPlatform(true);
      dialog.setAutoRequestFocus(true);
      dialog.setVisible(true);
      dialog.setAlwaysOnTop(true);
      dialog.toFront();
    } catch (Throwable t) {
      MessageHandler.showError(t);
    }
  
<no_super_class>