Class ElementLocalHistoryPageSource

  • All Implemented Interfaces:
    IHistoryPageSource

    public abstract class ElementLocalHistoryPageSource
    extends HistoryPageSource
    A history page source that can create history pages for a sub-element of a file.
    Since:
    3.3
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canShowHistoryFor​(java.lang.Object object)
      Returns true if this history page source can show a history for the given object, false if it cannot
      Page createPage​(java.lang.Object object)
      Called by the history view to create the page for this IFileHistoryProvider.
      protected abstract IFile getFile​(java.lang.Object element)
      Return the file that contains the given element of null if this page source can not show history for the given element.
      static ITypedElement getPreviousEdition​(IFile file, java.lang.Object element)
      Return the previous edition from the local history of the given element located in the given file.
      IFile internalGetFile​(java.lang.Object element)
      Return the file that contains the given element of null if this page source can not show history for the given element.
      • Methods inherited from class java.lang.Object

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

      • ElementLocalHistoryPageSource

        public ElementLocalHistoryPageSource()
        Create an instance of the page source.
    • Method Detail

      • getPreviousEdition

        public static ITypedElement getPreviousEdition​(IFile file,
                                                       java.lang.Object element)
                                                throws TeamException
        Return the previous edition from the local history of the given element located in the given file. A null is returned if a previous edition could not be found.
        Parameters:
        file - the file containing the element
        element - the element
        Returns:
        the previous edition of the element from the local history or null
        Throws:
        TeamException - if an error occurs
      • canShowHistoryFor

        public final boolean canShowHistoryFor​(java.lang.Object object)
        Description copied from interface: IHistoryPageSource
        Returns true if this history page source can show a history for the given object, false if it cannot
        Parameters:
        object - the object that is to have history shown
        Returns:
        boolean
      • createPage

        public final Page createPage​(java.lang.Object object)
        Description copied from interface: IHistoryPageSource
        Called by the history view to create the page for this IFileHistoryProvider. The page must implement IHistoryPage.
        Parameters:
        object - the object whose history is to be shown
        Returns:
        a Page that implements IHistoryPage (should return either an IPage, IPageBookViewPage or an IHistoryPage
        See Also:
        IHistoryPage
      • getFile

        protected abstract IFile getFile​(java.lang.Object element)
        Return the file that contains the given element of null if this page source can not show history for the given element.
        Parameters:
        element - the element
        Returns:
        the file that contains the given element of null
      • internalGetFile

        public final IFile internalGetFile​(java.lang.Object element)
        Return the file that contains the given element of null if this page source can not show history for the given element.
        Parameters:
        element - the element
        Returns:
        the file that contains the given element of null
        Restriction:
        This method is not intended to be referenced by clients.