Class CachingTreeContentProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.navigator.providers.CachingTreeContentProvider
-
- All Implemented Interfaces:
IContentProvider,IStructuredContentProvider,ITreeContentProvider
public class CachingTreeContentProvider extends Object implements ITreeContentProvider
The implementation ofITreeContentProviderfor caching children ofFilteringTreeContentProvider.Provides the following features:
- Caches the children for the specific list of
Class'es. For the specificClassinstance firstly it tries to find its children in cache and if it was successful returns the cached children, otherwise gets children fairly, caches them and returns them.- Caches the all children that were got. It is very useful for the serial calls of methods
hasChildren(Object)andgetChildren(Object).Important notes:
- The cache drops if only the input was changed. If the customer wants to drop the cache without input changes he needs to recreate
CachingTreeContentProvider.- The cache size isn't limited, so the customers should keep it in mind.
CachingTreeContentProvideris the lightweight implementation of a caching tree content provider, so it is better to use it for dialogs, and don't use it, for example, in the navigation tools.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCachingTreeContentProvider.CachingKeyProviderThe caching elements key provider.
-
Constructor Summary
Constructors Constructor Description CachingTreeContentProvider(FilteringTreeContentProvider innerTreeContentProvider, CachingTreeContentProvider.CachingKeyProvider keyProvider)Construct a new instance with the given inner tree content provider to call it methods and cache children.CachingTreeContentProvider(FilteringTreeContentProvider innerTreeContentProvider, Class<?>... classes)Construct a new instance with the given inner tree content provider to call it methods and cache children.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Object[]getChildren(Object parentElement)Object[]getElements(Object inputElement)ObjectgetParent(Object element)booleanhasChildren(Object element)voidinputChanged(Viewer viewer, Object oldInput, Object newInput)
-
-
-
Constructor Detail
-
CachingTreeContentProvider
public CachingTreeContentProvider(FilteringTreeContentProvider innerTreeContentProvider, Class<?>... classes)
Construct a new instance with the given inner tree content provider to call it methods and cache children. Providedclasseschildren will be cached.- Parameters:
innerTreeContentProvider- the given innerFilteringTreeContentProvider, can not benullclasses- the specific list ofClass'es to cache their children, can not benull
-
CachingTreeContentProvider
public CachingTreeContentProvider(FilteringTreeContentProvider innerTreeContentProvider, CachingTreeContentProvider.CachingKeyProvider keyProvider)
Construct a new instance with the given inner tree content provider to call it methods and cache children. ProvidedkeyProviderwill be used to cache children.- Parameters:
innerTreeContentProvider- the given innerFilteringTreeContentProvider, can not benullkeyProvider- the cache key provider to use to cache children, can not benull- See Also:
CachingTreeContentProvider.CachingKeyProvider
-
-
Method Detail
-
dispose
public void dispose()
- Specified by:
disposein interfaceIContentProvider
-
inputChanged
public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- Specified by:
inputChangedin interfaceIContentProvider
-
getElements
public Object[] getElements(Object inputElement)
- Specified by:
getElementsin interfaceIStructuredContentProvider- Specified by:
getElementsin interfaceITreeContentProvider
-
getChildren
public Object[] getChildren(Object parentElement)
- Specified by:
getChildrenin interfaceITreeContentProvider
-
getParent
public Object getParent(Object element)
- Specified by:
getParentin interfaceITreeContentProvider
-
hasChildren
public boolean hasChildren(Object element)
- Specified by:
hasChildrenin interfaceITreeContentProvider
-
-