Class PreviewHtmlPageContentProvider

    • Field Detail

      • textEditor

        protected final org.eclipse.ui.texteditor.ITextEditor textEditor
      • homeLocation

        protected final String homeLocation
    • Constructor Detail

      • PreviewHtmlPageContentProvider

        public PreviewHtmlPageContentProvider​(org.eclipse.ui.texteditor.ITextEditor textEditor,
                                              String homeLocation)
        Parameters:
        textEditor - the base text editor, can be null if no reason
        homeLocation - the default location to provide content from text editor, can be null if no reason
    • Method Detail

      • getHomePageContent

        protected Optional<String> getHomePageContent()
                                               throws IOException
        Get home page content from specified text editor
        Returns:
        string text content, never null
        Throws:
        IOException - if an I/O error occurs
      • getLocationPageContent

        protected Optional<String> getLocationPageContent​(String location)
                                                   throws IOException
        Get html page content from specified location
        Parameters:
        location - of html text to preview, cannot be null
        Returns:
        string text content, never null
        Throws:
        IOException - if an I/O error occurs
      • getPageNotFoundContent

        protected String getPageNotFoundContent()
                                         throws IOException
        Get html page not fount template text
        Returns:
        string text content, never null
        Throws:
        IOException - if an I/O error occurs
      • getHtmlBodyText

        protected String getHtmlBodyText​(String fullHtml)
        Substring html text by body tag content
        Parameters:
        fullHtml - the full html text, cannot be null
        Returns:
        text of body content, nevet null