Interface DetailViewCache
-
- All Known Subinterfaces:
TreeMasterDetailCache
- All Known Implementing Classes:
BasicDetailViewCache
,DefaultTreeMasterDetailCache
,DetailViewManager
public interface DetailViewCache
A cache for the Master-Detail renderers that caches renderedECPSWTView
s and reuses them when switching between elements in the master viewer. Whether the cache is size-limited is implementation-dependent.- Since:
- 1.22
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DETAIL_VIEW_CACHE_SIZE
Name of ancontext value
specifying the view cache to instantiate in the editor, for master-detail renderers that support caching.static DetailViewCache
EMPTY
A cache implementation that does not cache anything.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cacheView(ECPSWTView ecpView)
Caches the providedECPSWTView
to allow it to be reused later, if there is room for it the cache.void
clear()
Dispose all cached views, emptying the cache.static DetailViewCache
createCache(ViewModelContext context)
Create a standard cache as indicated by theDETAIL_VIEW_CACHE_SIZE
value in the givencontext
.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.
-
-
-
Field Detail
-
DETAIL_VIEW_CACHE_SIZE
static final java.lang.String DETAIL_VIEW_CACHE_SIZE
Name of ancontext value
specifying the view cache to instantiate in the editor, for master-detail renderers that support caching. May be a positiveInteger
value to specify the cache size, orBoolean
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 providedselection
;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
- theECPSWTView
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 theDETAIL_VIEW_CACHE_SIZE
value in the givencontext
.- Parameters:
context
- the master view model context- Returns:
- the detail view cache (never
null
)
-
-