Interface DetailViewCache

    • Field Detail

      • DETAIL_VIEW_CACHE_SIZE

        static final java.lang.String DETAIL_VIEW_CACHE_SIZE
        Name of an context value specifying the view cache to instantiate in the editor, for master-detail renderers that support caching. May be a positive Integer value to specify the cache size, or Boolean to enable (or not) a cache of the default size.
        See Also:
        Constant Field Values
      • EMPTY

        static final DetailViewCache EMPTY
        A cache implementation that does not cache anything. It is always empty.
    • Method Detail

      • isCached

        boolean isCached​(org.eclipse.emf.ecore.EObject selection)
        Checks whether there is already a cached view available.
        Parameters:
        selection - The new master object selection
        Returns:
        true if there is a cached view for the provided selection; false otherwise
      • getCachedView

        ECPSWTView getCachedView​(org.eclipse.emf.ecore.EObject selection)
        Returns the previously cached view for the provided selection.
        Parameters:
        selection - The new master object selection
        Returns:
        the cached view, or null if none is cached
        See Also:
        isCached(EObject)
      • cacheView

        boolean cacheView​(ECPSWTView ecpView)

        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.

        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

        void clear()
        Dispose all cached views, emptying the cache. The cache must still be in a state to be used (this is not a "dispose" operation).
      • createCache

        static DetailViewCache createCache​(ViewModelContext context)
        Create a standard cache as indicated by the DETAIL_VIEW_CACHE_SIZE value in the given context.
        Parameters:
        context - the master view model context
        Returns:
        the detail view cache (never null)