org.openoffice.ide.eclipse.core.unotypebrowser
Class UnoTypeProvider

java.lang.Object
  extended by org.openoffice.ide.eclipse.core.unotypebrowser.UnoTypeProvider

public class UnoTypeProvider
extends java.lang.Object

Class providing UNO types from an OpenOffice.org instance and optionally from a UNO project.

Author:
cedricbosdo

Field Summary
static int ALL_TYPES
           
static java.lang.String BASIC_TYPES_KEY
           
 
Method Summary
 void addInitListener(IInitListener pListener)
          Register the given listener.
 boolean contains(java.lang.String pScopedName, java.lang.String[] pContainers)
          Checks whether the list contains the given type name.
static UnoTypeProvider getInstance()
           
 TypeProviderState getState()
           
 void refreshCache()
          Refresh the cache of Uno types.
protected  void removeAllTypes()
          Purge the types list.
 void removeInitListener(IInitListener pListener)
          Makes the given initialization listener stop listening.
 void setOOoInstance(IOOo pOOoInstance)
          Sets the OOo if the new one is different from the old one.
 void setProject(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 UnoTypeProvider singleton 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 match
pContainers - the UNO types containers to look in. These have to be either the path to a project RDB file or an OpenOffice.org name
Returns:
true if 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's types.rdb registry 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 - OpenOffice.org 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:
org.openoffice.ide.eclipse.core.internal.office.TypesGetter

removeAllTypes

protected void removeAllTypes()
Purge the types list.