org.openoffice.ide.eclipse.core.model
Class OOoContainer

java.lang.Object
  extended by org.openoffice.ide.eclipse.core.model.OOoContainer

public class OOoContainer
extends java.lang.Object

Singleton object containing the OOo configurations.

Author:
cedricbosdo

Method Summary
static void addListener(IConfigListener pListener)
          Add a configuration listener to the container.
static void addOOo(IOOo pOoo)
          Add the OOo given in parameter to the list of the others.
static void clear()
          Removes all the OOo contained.
static boolean containsName(java.lang.String pName)
          Checks whether the corresponding OOo name already exists.
static void delOOo(IOOo pOoo)
          remove the given OOo from the list.
static void dispose()
          Dispose the vector used.
static OOoContainer getInstance()
           
static IOOo getOOo(java.lang.String pOookey)
          Returns the ooo that corresponds to the given ooo name and buildid.
static int getOOoCount()
          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 IOOo getSomeOOo(java.lang.String pValue)
          Leniently return an OOo instance descriptor from a given value.
static java.lang.String getUniqueName(java.lang.String pName)
          Computes a unique name from the given one.
static void load()
          Loads the OpenOffice.org already configured instances from the preferences.
static void removeListener(IConfigListener pListener)
          Removes a configuration listener from the container.
static void saveOOos()
          Saves the OpenOffice.org already configured instances to the preferences.
static java.lang.Object[] toArray()
           
static void updateOOo(java.lang.String pOookey, IOOo pOoo)
          Update the with OOo from the list with the given OOo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 OOo name already exists.

Parameters:
pName - the OOo Name to check
Returns:
true if the name is already present, false otherwise.

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 update
pOoo - 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:

  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 OpenOffice.org already configured instances from the preferences.


saveOOos

public static void saveOOos()
Saves the OpenOffice.org already configured instances to the preferences.


getInstance

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