Class OOoContainer
java.lang.Object
org.libreoffice.ide.eclipse.core.model.OOoContainer
Singleton object containing the LibreOffice configurations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddListener(IConfigListener listener) Add a configuration listener to the container.static voidAdd the OOo given in parameter to the list of the others.static voidclear()Removes all the OOo contained.static booleancontainsName(String name) Checks whether the corresponding LibreOffice name already exists.static voidremove the given OOo from the list.static voiddispose()Dispose the vector used.static OOoContainerstatic IOOoReturns the ooo that corresponds to the given ooo name and buildid.static intReturns the number of OOo in the list.Returns a vector containing the unique identifiers of the contained OOos.static IOOogetSomeOOo(String pValue) Leniently return an OOo instance descriptor from a given value.static StringgetUniqueName(String name) Computes a unique name from the given one.static voidload()Loads the LibreOffice already configured instances from the preferences.static voidremoveListener(IConfigListener listener) Removes a configuration listener from the container.static voidsaveOOos()Saves the LibreOffice already configured instances to the preferences.static Object[]toArray()static voidUpdate the with OOo from the list with the given OOo.
-
Method Details
-
addListener
Add a configuration listener to the container.- Parameters:
listener- configuration listener to add
-
removeListener
Removes a configuration listener from the container.- Parameters:
listener- configuration listener to remove
-
toArray
- Returns:
- the ooos elements in an array.
-
addOOo
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
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
Returns a vector containing the unique identifiers of the contained OOos.- Returns:
- names of the contained OOos
-
containsName
Checks whether the corresponding LibreOffice name already exists.- Parameters:
name- the OOo Name to check- Returns:
trueif the name is already present,falseotherwise.
-
getUniqueName
Computes a unique name from the given one.- Parameters:
name- the name to render unique- Returns:
- the unique name
-
updateOOo
Update the with OOo from the list with the given OOo.- Parameters:
oookey- position of the ooo to updateooo- new value for the OOo
-
getOOo
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
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
- Returns:
- the OOoContainer singleton instance
-