public interface DetailViewCache
ECPSWTView
s
and reuses them when switching between elements in the master viewer. Whether the cache
is size-limited is implementation-dependent.Modifier and Type | Field and Description |
---|---|
static 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. |
static DetailViewCache |
EMPTY
A cache implementation that does not cache anything.
|
Modifier and Type | Method and 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.
|
static DetailViewCache |
createCache(ViewModelContext context)
Create a standard cache as indicated by the
DETAIL_VIEW_CACHE_SIZE value
in the given context . |
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.
|
static final String DETAIL_VIEW_CACHE_SIZE
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.static final DetailViewCache EMPTY
boolean isCached(org.eclipse.emf.ecore.EObject selection)
selection
- The new master object selectiontrue
if there is a cached view for the provided selection
; false
otherwiseECPSWTView getCachedView(org.eclipse.emf.ecore.EObject selection)
selection
- The new master object selectionnull
if none is cachedisCached(EObject)
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.
ecpView
- the ECPSWTView
to cachetrue
if the view was added to the cache; false
otherwise (in which
case it would be disposed)void clear()
static DetailViewCache createCache(ViewModelContext context)
DETAIL_VIEW_CACHE_SIZE
value
in the given context
.context
- the master view model contextnull
)Copyright © 2019. All rights reserved.