Class OOoContainer

java.lang.Object
org.libreoffice.ide.eclipse.core.model.OOoContainer

public class OOoContainer extends Object
Singleton object containing the LibreOffice configurations.
  • Method Details

    • addListener

      public static void addListener(IConfigListener listener)
      Add a configuration listener to the container.
      Parameters:
      listener - configuration listener to add
    • removeListener

      public static void removeListener(IConfigListener listener)
      Removes a configuration listener from the container.
      Parameters:
      listener - configuration listener to remove
    • toArray

      public static Object[] toArray()
      Returns:
      the ooos elements in an array.
    • addOOo

      public static void addOOo(IOOo ooo)
      Add the OOo given in parameter to the list of the others. Do not use directly the private field to handle OOos
      Parameters:
      ooo - OOo to add
    • delOOo

      public static void delOOo(IOOo ooo)
      remove the given OOo from the list. Do not use directly the private field to handle OOos
      Parameters:
      ooo - OOo to remove
    • clear

      public static void clear()
      Removes all the OOo contained.
    • getOOoKeys

      public static Vector<String> getOOoKeys()
      Returns a vector containing the unique identifiers of the contained OOos.
      Returns:
      names of the contained OOos
    • containsName

      public static boolean containsName(String name)
      Checks whether the corresponding LibreOffice name already exists.
      Parameters:
      name - the OOo Name to check
      Returns:
      true if the name is already present, false otherwise.
    • getUniqueName

      public static String getUniqueName(String name)
      Computes a unique name from the given one.
      Parameters:
      name - the name to render unique
      Returns:
      the unique name
    • updateOOo

      public static void updateOOo(String oookey, IOOo ooo)
      Update the with OOo from the list with the given OOo.
      Parameters:
      oookey - position of the ooo to update
      ooo - new value for the OOo
    • getOOo

      public static IOOo getOOo(String oookey)
      Returns the ooo that corresponds to the given ooo name and buildid.
      Parameters:
      oookey - unique identifier of the wanted ooo
      Returns:
      OOo which name equals the one provided
    • getSomeOOo

      public static IOOo getSomeOOo(String pValue)
      Leniently return an OOo instance descriptor from a given value.

      This method will try several ways to find an OOo. These are the following:

      1. Check if there is a configured OOo with a name like pValue
      2. Check if there is a configured OOo at a path like pValue
      3. Check if there is an OOo at the given path and configure it if necessary
      4. Get an OOo instance from the configured ones
      If no OOo instance can be found using one of the previous ways, null will be returned.

      Parameters:
      pValue - the value helping to find the OOo instance.
      Returns:
      the OOo instance or null if not found
    • getOOoCount

      public static int getOOoCount()
      Returns the number of OOo in the list.
      Returns:
      number of OOo in the list
    • dispose

      public static void dispose()
      Dispose the vector used.
    • load

      public static void load()
      Loads the LibreOffice already configured instances from the preferences.
    • saveOOos

      public static void saveOOos()
      Saves the LibreOffice already configured instances to the preferences.
    • getInstance

      public static OOoContainer getInstance()
      Returns:
      the OOoContainer singleton instance