Class SourceCodeBrowser


  • public class SourceCodeBrowser
    extends java.lang.Object
    Browses source code. The source code URI is resolved with respect to a root URI. The source code is expected to be in HTML format. The actual rendering of the source code can be either through an internal or an external browser.
    Author:
    Pinaki Poddar
    • Constructor Summary

      Constructors 
      Constructor Description
      SourceCodeBrowser​(java.lang.String root, boolean useDesktop)
      Construct a browser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPage​(java.lang.String key, java.lang.String path)  
      java.io.File getRootDirectory()
      Gets the root source directory if the sources are being serverd from a local file system directory.
      java.net.URI getRootURI()  
      SourceCodeViewer getViewer()  
      void showPage​(java.lang.String key, java.lang.String page)
      Shows the given page.
      void showPage​(java.lang.String key, java.net.URI uri)
      Shows the given page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SourceCodeBrowser

        public SourceCodeBrowser​(java.lang.String root,
                                 boolean useDesktop)
        Construct a browser.
        Parameters:
        root - a path to be resolved as an URI to root of source tree.
        useDesktop - flags to use external or internal browser.
    • Method Detail

      • getRootURI

        public java.net.URI getRootURI()
      • getRootDirectory

        public java.io.File getRootDirectory()
        Gets the root source directory if the sources are being serverd from a local file system directory.
      • showPage

        public void showPage​(java.lang.String key,
                             java.lang.String page)
        Shows the given page.
        Parameters:
        key - key a user visible moniker for the page.
        page - the path of the page content w.r.t the root URI of this browser.
      • addPage

        public void addPage​(java.lang.String key,
                            java.lang.String path)
      • showPage

        public void showPage​(java.lang.String key,
                             java.net.URI uri)
        Shows the given page.
        Parameters:
        key - a user visible moniker for the page.
        uri - the URI of the page content.