Class OOoContainer
- java.lang.Object
-
- org.libreoffice.ide.eclipse.core.model.OOoContainer
-
public class OOoContainer extends java.lang.ObjectSingleton object containing the LibreOffice configurations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddListener(IConfigListener pListener)Add a configuration listener to the container.static voidaddOOo(IOOo pOoo)Add the OOo given in parameter to the list of the others.static voidclear()Removes all the OOo contained.static booleancontainsName(java.lang.String pName)Checks whether the corresponding LibreOffice name already exists.static voiddelOOo(IOOo pOoo)remove the given OOo from the list.static voiddispose()Dispose the vector used.static OOoContainergetInstance()static IOOogetOOo(java.lang.String pOookey)Returns the ooo that corresponds to the given ooo name and buildid.static intgetOOoCount()Returns the number of OOo in the list.static java.util.Vector<java.lang.String>getOOoKeys()Returns a vector containing the unique identifiers of the contained OOos.static IOOogetSomeOOo(java.lang.String pValue)Leniently return an OOo instance descriptor from a given value.static java.lang.StringgetUniqueName(java.lang.String pName)Computes a unique name from the given one.static voidload()Loads the LibreOffice already configured instances from the preferences.static voidremoveListener(IConfigListener pListener)Removes a configuration listener from the container.static voidsaveOOos()Saves the LibreOffice already configured instances to the preferences.static java.lang.Object[]toArray()static voidupdateOOo(java.lang.String pOookey, IOOo pOoo)Update the with OOo from the list with the given OOo.
-
-
-
Method Detail
-
addListener
public static void addListener(IConfigListener pListener)
Add a configuration listener to the container.- Parameters:
pListener- configuration listener to add
-
removeListener
public static void removeListener(IConfigListener pListener)
Removes a configuration listener from the container.- Parameters:
pListener- configuration listener to remove
-
toArray
public static java.lang.Object[] toArray()
- Returns:
- the ooos elements in an array.
-
addOOo
public static void addOOo(IOOo pOoo)
Add the OOo given in parameter to the list of the others. Do not use directly the private field to handle OOos- Parameters:
pOoo- OOo to add
-
delOOo
public static void delOOo(IOOo pOoo)
remove the given OOo from the list. Do not use directly the private field to handle OOos- Parameters:
pOoo- OOo to remove
-
clear
public static void clear()
Removes all the OOo contained.
-
getOOoKeys
public static java.util.Vector<java.lang.String> getOOoKeys()
Returns a vector containing the unique identifiers of the contained OOos.- Returns:
- names of the contained OOos
-
containsName
public static boolean containsName(java.lang.String pName)
Checks whether the corresponding LibreOffice name already exists.- Parameters:
pName- the OOo Name to check- Returns:
trueif the name is already present,falseotherwise.
-
getUniqueName
public static java.lang.String getUniqueName(java.lang.String pName)
Computes a unique name from the given one.- Parameters:
pName- the name to render unique- Returns:
- the unique name
-
updateOOo
public static void updateOOo(java.lang.String pOookey, IOOo pOoo)Update the with OOo from the list with the given OOo.- Parameters:
pOookey- position of the ooo to updatepOoo- new value for the OOo
-
getOOo
public static IOOo getOOo(java.lang.String pOookey)
Returns the ooo that corresponds to the given ooo name and buildid.- Parameters:
pOookey- unique identifier of the wanted ooo- Returns:
- OOo which name equals the one provided
-
getSomeOOo
public static IOOo getSomeOOo(java.lang.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:
- Check if there is a configured OOo with a name like
pValue - Check if there is a configured OOo at a path like
pValue - Check if there is an OOo at the given path and configure it if necessary
- Get an OOo instance from the configured ones
nullwill be returned.- Parameters:
pValue- the value helping to find the OOo instance.- Returns:
- the OOo instance or
nullif not found
- Check if there is a configured OOo with a name like
-
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
-
-