Class BasicDetailViewCache

    • Constructor Summary

      Constructors 
      Constructor Description
      BasicDetailViewCache()
      Creates a cache with maximal 5 entries.
      BasicDetailViewCache​(int maxEntries)
      Creates a cache with a custom number of maximal entries.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cacheView​(ECPSWTView ecpView)
      Caches the provided ECPSWTView to allow it to be reused later, if there is room for it the cache.
      void clear()
      Dispose all cached views, emptying the cache.
      ECPSWTView getCachedView​(org.eclipse.emf.ecore.EObject selection)
      Returns the previously cached view for the provided selection.
      boolean isCached​(org.eclipse.emf.ecore.EObject selection)
      Checks whether there is already a cached view available.
      • Methods inherited from class java.lang.Object

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

      • BasicDetailViewCache

        public BasicDetailViewCache()
        Creates a cache with maximal 5 entries.
      • BasicDetailViewCache

        public BasicDetailViewCache​(int maxEntries)
        Creates a cache with a custom number of maximal entries.
        Parameters:
        maxEntries - The number of maximal entries to cache
    • Method Detail

      • isCached

        public boolean isCached​(org.eclipse.emf.ecore.EObject selection)
        Description copied from interface: DetailViewCache
        Checks whether there is already a cached view available.
        Specified by:
        isCached in interface DetailViewCache
        Parameters:
        selection - The new master object selection
        Returns:
        true if there is a cached view for the provided selection; false otherwise
      • cacheView

        public boolean cacheView​(ECPSWTView ecpView)
        Description copied from interface: DetailViewCache

        Caches the provided ECPSWTView to allow it to be reused later, if there is room for it the cache.

        Note that a view is cached when it is no longer required, usually because another detail view is taking its place in the editor. Consequently, if the cache is size-limited and cannot actually cache the view, it must dispose that view.

        Specified by:
        cacheView in interface DetailViewCache
        Parameters:
        ecpView - the ECPSWTView to cache
        Returns:
        true if the view was added to the cache; false otherwise (in which case it would be disposed)
      • clear

        public void clear()
        Description copied from interface: DetailViewCache
        Dispose all cached views, emptying the cache. The cache must still be in a state to be used (this is not a "dispose" operation).
        Specified by:
        clear in interface DetailViewCache