Class UnoTypeProvider

java.lang.Object
org.libreoffice.ide.eclipse.core.unotypebrowser.UnoTypeProvider

public class UnoTypeProvider extends Object
Class providing UNO types from a LibreOffice instance and optionally from a UNO project.
  • Field Details

  • Method Details

    • getInstance

      public static UnoTypeProvider getInstance()
      Returns:
      the UnoTypeProvider singleton instance.
    • refreshCache

      public void refreshCache()
      Refresh the cache of Uno types.
    • contains

      public boolean contains(String pScopedName, String[] containers)
      Checks whether the list contains the given type name.
      Parameters:
      pScopedName - the type name to match
      containers - the UNO types containers to look in. These have to be either the path to a project RDB file or a LibreOffice 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 instance)
      Sets the OOo if the new one is different from the old one.
      Parameters:
      instance - LibreOffice instance to bootstrap
    • getState

      public TypeProviderState getState()
      Returns:
      the status of the UNO type provider.
    • addInitListener

      public void addInitListener(IInitListener listener)
      Register the given listener.
      Parameters:
      listener - the listener to add
    • removeInitListener

      public void removeInitListener(IInitListener listener)
      Makes the given initialization listener stop listening.
      Parameters:
      listener - the listener to remove
    • toArray

      protected Object[] toArray(String[] containers)
      Initializes the cache if needed and get the cached data.
      Parameters:
      containers - 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.