Class UnoTypeProvider
- java.lang.Object
-
- org.libreoffice.ide.eclipse.core.unotypebrowser.UnoTypeProvider
-
public class UnoTypeProvider extends java.lang.ObjectClass providing UNO types from a LibreOffice instance and optionally from a UNO project.
-
-
Field Summary
Fields Modifier and Type Field Description static intALL_TYPESstatic java.lang.StringBASIC_TYPES_KEY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInitListener(IInitListener pListener)Register the given listener.booleancontains(java.lang.String pScopedName, java.lang.String[] pContainers)Checks whether the list contains the given type name.static UnoTypeProvidergetInstance()TypeProviderStategetState()voidrefreshCache()Refresh the cache of Uno types.protected voidremoveAllTypes()Purge the types list.voidremoveInitListener(IInitListener pListener)Makes the given initialization listener stop listening.voidsetOOoInstance(IOOo pOOoInstance)Sets the OOo if the new one is different from the old one.voidsetProject(IUnoidlProject pProject)Set the UNO project for which to get the UNO types.protected java.lang.Object[]toArray(java.lang.String[] pContainers)Initializes the cache if needed and get the cached data.
-
-
-
Field Detail
-
ALL_TYPES
public static final int ALL_TYPES
- See Also:
- Constant Field Values
-
BASIC_TYPES_KEY
public static final java.lang.String BASIC_TYPES_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static UnoTypeProvider getInstance()
- Returns:
- the
UnoTypeProvidersingleton instance.
-
refreshCache
public void refreshCache()
Refresh the cache of Uno types.
-
contains
public boolean contains(java.lang.String pScopedName, java.lang.String[] pContainers)Checks whether the list contains the given type name.- Parameters:
pScopedName- the type name to matchpContainers- the UNO types containers to look in. These have to be either the path to a project RDB file or a LibreOffice name- Returns:
trueif the list contains a type with this name
-
setProject
public void setProject(IUnoidlProject pProject)
Set the UNO project for which to get the UNO types. This project'stypes.rdbregistry will be used as external registry for the types query.- Parameters:
pProject- the project for which to launch the type query
-
setOOoInstance
public void setOOoInstance(IOOo pOOoInstance)
Sets the OOo if the new one is different from the old one.- Parameters:
pOOoInstance- LibreOffice instance to bootstrap
-
getState
public TypeProviderState getState()
- Returns:
- the status of the UNO type provider.
-
addInitListener
public void addInitListener(IInitListener pListener)
Register the given listener.- Parameters:
pListener- the listener to add
-
removeInitListener
public void removeInitListener(IInitListener pListener)
Makes the given initialization listener stop listening.- Parameters:
pListener- the listener to remove
-
toArray
protected java.lang.Object[] toArray(java.lang.String[] pContainers)
Initializes the cache if needed and get the cached data.- Parameters:
pContainers- the container from which to get the types.- Returns:
- the types list as an array.
- See Also:
TypesGetter
-
removeAllTypes
protected void removeAllTypes()
Purge the types list.
-
-