code: public void dispatch( com.sun.star.util.URL aURL,
                             com.sun.star.beans.PropertyValue[] aArguments )
      {
           if ( aURL.Protocol.compareTo("org.cogroo.addon:") == 0 )
          {
              if ( aURL.Path.compareTo("ReportError") == 0 )
              {
                  XTextDocument xDoc = (XTextDocument) UnoRuntime.queryInterface(
                  XTextDocument.class, m_xFrame.getController().getModel());
                  SelectedTextExtractor extractor = new SelectedTextExtractor(m_xContext, xDoc);
  
                  final ErrorReportDialogThread reporterrorthread = new ErrorReportDialogThread(this.m_xContext);
                  reporterrorthread.setText(extractor.getSelectedText());
                  reporterrorthread.start();
              }
          }
      }
docs: com.sun.star.frame.XDispatch: