summaryrefslogtreecommitdiff
path: root/javaunohelper/com/sun/star/lib/uno/helper
diff options
context:
space:
mode:
Diffstat (limited to 'javaunohelper/com/sun/star/lib/uno/helper')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java24
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/Factory.java24
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java130
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java30
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java346
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java2
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java36
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java26
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java18
9 files changed, 318 insertions, 318 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java b/javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java
index 41cf01d81661..2833918322f4 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,15 +42,15 @@ public class ComponentBase extends WeakBase implements XComponent
protected boolean bDisposed= false;
static final Type EVT_LISTENER_TYPE= new Type(XEventListener.class);
-
+
/** Creates a new instance of CompBase */
public ComponentBase()
{
super();
listenerContainer= new MultiTypeInterfaceContainer();
}
-
- /** Override to perform extra clean-up work. Provided for subclasses. It is
+
+ /** Override to perform extra clean-up work. Provided for subclasses. It is
called during dispose()
*/
protected void preDisposing()
@@ -61,9 +61,9 @@ public class ComponentBase extends WeakBase implements XComponent
protected void postDisposing()
{
}
-
-
- /** Method of XComponent. It is called by the owning client when the component is not needed
+
+
+ /** Method of XComponent. It is called by the owning client when the component is not needed
* anymore. The registered listeners are notified that this method has been called.
*/
public void dispose()
@@ -108,14 +108,14 @@ public class ComponentBase extends WeakBase implements XComponent
System.out.println("OComponentHelper::dispose() - dispose called twice" );
}
}
-
+
/** Method of XComponent.
*/
public void removeEventListener(XEventListener xEventListener)
- {
+ {
listenerContainer.removeInterface( EVT_LISTENER_TYPE, xEventListener);
}
-
+
public void addEventListener(XEventListener listener)
{
boolean bDoDispose= false;
@@ -130,8 +130,8 @@ public class ComponentBase extends WeakBase implements XComponent
{
listener.disposing( new EventObject(this));
}
- }
-
+ }
+
protected void finalize() throws Throwable
{
if ( ! bInDispose && ! bDisposed)
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
index 33d107279633..0d3759f74d6d 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@ import com.sun.star.uno.UnoRuntime;
/** Factory helper class supporting com.sun.star.lang.XServiceInfo and
com.sun.star.lang.XSingleComponentFactory.
-
+
@attention
This factory implementation does not support lang.XSingleServiceFactory.
*/
@@ -46,11 +46,11 @@ public class Factory
implements XSingleComponentFactory, XServiceInfo
{
private static final boolean DEBUG = false;
-
+
/** Creates an object factory supporting interfaces
com.sun.star.lang.XSingleComponentFactory and
com.sun.star.lang.XServiceInfo
-
+
@param impl_class
implementation class
@param supported_services
@@ -65,7 +65,7 @@ public class Factory
return new Factory( impl_class, supported_services );
}
/** Writes component's implementation info to given registry key.
-
+
@param impl_name
name of implementation
@param supported_services
@@ -98,14 +98,14 @@ public class Factory
}
return false;
}
-
+
//==============================================================================================
private String m_impl_name;
private String [] m_supported_services;
private Class m_impl_class;
private java.lang.reflect.Method m_method;
private java.lang.reflect.Constructor m_ctor;
-
+
// ctor
private Factory( Class impl_class, String supported_services [] )
throws com.sun.star.uno.RuntimeException
@@ -115,9 +115,9 @@ public class Factory
m_impl_class = impl_class;
m_method = null;
m_ctor = null;
-
+
Class params [] = new Class [] { XComponentContext.class };
-
+
try
{
// seeking for "public static Object __create( XComponentContext )"
@@ -133,7 +133,7 @@ public class Factory
catch (Exception exc)
{
}
-
+
if (null == m_method)
{
try
@@ -147,7 +147,7 @@ public class Factory
}
}
}
-
+
//______________________________________________________________________________________________
private final Object instantiate( XComponentContext xContext )
throws com.sun.star.uno.Exception
@@ -218,7 +218,7 @@ public class Factory
xInit.initialize( arguments );
return inst;
}
-
+
// XServiceInfo impl
//______________________________________________________________________________________________
public final String getImplementationName()
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
index 404c5a5e3f3a..710141a17c70 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -102,15 +102,15 @@ public class InterfaceContainer implements Cloneable
* The capacity of the ArrayList is the length of this array buffer.
*/
Object elementData[];
-
+
/**
* The size of the ArrayList (the number of elements it contains).
*
* @serial
*/
private int size;
-
-
+
+
//private ArrayList data= new ArrayList();
/** Creates a new instance of InterfaceContainer */
public InterfaceContainer()
@@ -131,7 +131,7 @@ public class InterfaceContainer implements Cloneable
initialCapacity);
this.elementData = new Object[initialCapacity];
}
-
+
/**
* Trims the capacity of this <tt>ArrayList</tt> instance to be the
* list's current size. An application can use this operation to minimize
@@ -147,7 +147,7 @@ public class InterfaceContainer implements Cloneable
System.arraycopy(oldData, 0, elementData, 0, size);
}
}
-
+
/**
* Increases the capacity of this <tt>ArrayList</tt> instance, if
* necessary, to ensure that it can hold at least the number of elements
@@ -168,7 +168,7 @@ public class InterfaceContainer implements Cloneable
System.arraycopy(oldData, 0, elementData, 0, size);
}
}
-
+
/**
* Appends the specified element to the end of this list.
*
@@ -186,7 +186,7 @@ public class InterfaceContainer implements Cloneable
}
return ret;
}
-
+
/**
* Inserts the specified element at the specified position in this
* list. Shifts the element currently at that position (if any) and
@@ -195,7 +195,7 @@ public class InterfaceContainer implements Cloneable
* @param index index at which the specified element is to be inserted.
* @param element element to be inserted.
* @throws IndexOutOfBoundsException if index is out of range
- * <tt>(index &lt; 0 || index &gt; size())</tt>.
+ * <tt>(index &lt; 0 || index &gt; size())</tt>.
*/
synchronized public void add(int index, Object element)
{
@@ -204,7 +204,7 @@ public class InterfaceContainer implements Cloneable
if (index > size || index < 0)
throw new IndexOutOfBoundsException(
"Index: "+index+", Size: "+size);
-
+
ensureCapacity(size+1);
System.arraycopy(elementData, index, elementData, index + 1,
size - index);
@@ -212,8 +212,8 @@ public class InterfaceContainer implements Cloneable
size++;
}
}
-
-
+
+
/**
* Appends all of the elements in the specified Collection to the end of
* this list, in the order that they are returned by the
@@ -225,13 +225,13 @@ public class InterfaceContainer implements Cloneable
*
* @param c the elements to be inserted into this list.
* @throws IndexOutOfBoundsException if index out of range <tt>(index
- * &lt; 0 || index &gt; size())</tt>.
+ * &lt; 0 || index &gt; size())</tt>.
*/
synchronized public boolean addAll(Collection c)
{
int numNew = c.size();
ensureCapacity(size + numNew);
-
+
Iterator e = c.iterator();
for (int i=0; i<numNew; i++)
{
@@ -250,10 +250,10 @@ public class InterfaceContainer implements Cloneable
* specified Collection's iterator.
*
* @param index index at which to insert first element
- * from the specified collection.
+ * from the specified collection.
* @param c elements to be inserted into this list.
* @throws IndexOutOfBoundsException if index out of range <tt>(index
- * &lt; 0 || index &gt; size())</tt>.
+ * &lt; 0 || index &gt; size())</tt>.
*/
synchronized public boolean addAll(int index, Collection c)
{
@@ -276,12 +276,12 @@ public class InterfaceContainer implements Cloneable
}
int numNew = curIndex;
ensureCapacity(size + numNew); // Increments modCount!!
-
+
int numMoved = size - index;
if (numMoved > 0)
System.arraycopy(elementData, index, elementData, index + numNew,
numMoved);
-
+
for (int i=0; i<numNew; i++)
{
elementData[index++]= arColl[i];
@@ -291,7 +291,7 @@ public class InterfaceContainer implements Cloneable
}
return ret;
}
-
+
/**
* Removes all of the elements from this list. The list will
* be empty after this call returns.
@@ -303,7 +303,7 @@ public class InterfaceContainer implements Cloneable
// Let gc do its work
for (int i = 0; i < size; i++)
elementData[i] = null;
-
+
size = 0;
}
}
@@ -316,7 +316,7 @@ public class InterfaceContainer implements Cloneable
{
return indexOf(elem) >= 0;
}
-
+
synchronized public boolean containsAll(Collection collection)
{
boolean retVal= true;
@@ -341,7 +341,7 @@ public class InterfaceContainer implements Cloneable
* @param index index of element to return.
* @return the element at the specified position in this list.
* @throws IndexOutOfBoundsException if index is out of range <tt>(index
- * &lt; 0 || index &gt;= size())</tt>.
+ * &lt; 0 || index &gt;= size())</tt>.
*/
synchronized public Object get(int index)
{
@@ -352,7 +352,7 @@ public class InterfaceContainer implements Cloneable
}
return null;
}
-
+
/**
* Searches for the first occurence of the given argument, testing
* for equality using the <tt>equals</tt> method.
@@ -375,7 +375,7 @@ public class InterfaceContainer implements Cloneable
break;
}
}
-
+
if (index == -1)
{
for (int i = 0; i < size; i++)
@@ -400,7 +400,7 @@ public class InterfaceContainer implements Cloneable
{
return size == 0;
}
-
+
synchronized public Iterator iterator()
{
if (elementData != null)
@@ -445,9 +445,9 @@ public class InterfaceContainer implements Cloneable
}
return index;
}
-
+
/**
- * Returns a shallow copy of this <tt>ArrayList</tt> instance. The contained
+ * Returns a shallow copy of this <tt>ArrayList</tt> instance. The contained
* references are copied but the objects not.
*
* @return a clone of this <tt>List</tt> instance.
@@ -469,7 +469,7 @@ public class InterfaceContainer implements Cloneable
{
return listIterator(0);
}
-
+
/** The iterator keeps a copy of the list. Changes to InterfaceContainer do not
* affect the data of the iterator. Conversly, changes to the iterator are effect
* InterfaceContainer.
@@ -491,7 +491,7 @@ public class InterfaceContainer implements Cloneable
* @param index the index of the element to removed.
* @return the element that was removed from the list.
* @throws IndexOutOfBoundsException if index out of range <tt>(index
- * &lt; 0 || index &gt;= size())</tt>.
+ * &lt; 0 || index &gt;= size())</tt>.
*/
synchronized public Object remove(int index)
{
@@ -500,7 +500,7 @@ public class InterfaceContainer implements Cloneable
{
RangeCheck(index);
ret= elementData[index];
-
+
int numMoved = size - index - 1;
if (numMoved > 0)
System.arraycopy(elementData, index+1, elementData, index,
@@ -509,8 +509,8 @@ public class InterfaceContainer implements Cloneable
}
return ret;
}
-
-
+
+
/** Parameter obj may */
synchronized public boolean remove(Object obj)
{
@@ -526,7 +526,7 @@ public class InterfaceContainer implements Cloneable
}
return ret;
}
-
+
synchronized public boolean removeAll(Collection collection)
{
boolean retVal= false;
@@ -543,7 +543,7 @@ public class InterfaceContainer implements Cloneable
}
return retVal;
}
-
+
synchronized public boolean retainAll(Collection collection)
{
boolean retVal= false;
@@ -595,14 +595,14 @@ public class InterfaceContainer implements Cloneable
}
return retVal;
}
-
-
- /** Not supported.
+
+
+ /** Not supported.
* @param index index of element to replace.
* @param element element to be stored at the specified position.
* @return the element previously at the specified position.
* @throws IndexOutOfBoundsException if index out of range
- * <tt>(index &lt; 0 || index &gt;= size())</tt>.
+ * <tt>(index &lt; 0 || index &gt;= size())</tt>.
*/
synchronized public Object set(int index, Object element)
{
@@ -615,7 +615,7 @@ public class InterfaceContainer implements Cloneable
}
return ret;
}
-
+
/**
* Returns the number of elements in this list.
*
@@ -627,14 +627,14 @@ public class InterfaceContainer implements Cloneable
return size;
return 0;
}
-
+
/**
* Returns an array containing all of the elements in this list
* in the correct order.
*
* @return an array containing all of the elements in this list
- * in the correct order.
+ * in the correct order.
*/
synchronized public Object[] toArray()
{
@@ -662,8 +662,8 @@ public class InterfaceContainer implements Cloneable
* <tt>null</tt> elements.
*
* @param a the array into which the elements of the list are to
- * be stored, if it is big enough; otherwise, a new array of the
- * same runtime type is allocated for this purpose.
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose.
* @return an array containing the elements of the list.
* @throws ArrayStoreException if the runtime type of a is not a supertype
* of the runtime type of every element in this list.
@@ -675,13 +675,13 @@ public class InterfaceContainer implements Cloneable
a.getClass().getComponentType(), size);
if (elementData != null)
System.arraycopy(elementData, 0, a, 0, size);
-
+
if (a.length > size)
a[size] = null;
-
+
return a;
}
-
+
/**
* Check if the given index is in range. If not, throw an appropriate
* runtime exception.
@@ -692,7 +692,7 @@ public class InterfaceContainer implements Cloneable
throw new IndexOutOfBoundsException(
"Index: "+index+", Size: "+size);
}
-
+
public void disposeAndClear(EventObject evt)
{
Iterator aIt;
@@ -725,8 +725,8 @@ public class InterfaceContainer implements Cloneable
}
}
}
-
-
+
+
private class Itr implements Iterator
{
InterfaceContainer dataIt;
@@ -740,23 +740,23 @@ public class InterfaceContainer implements Cloneable
* to remove.
*/
int lastRet = -1;
-
+
/** The object that has been returned by most recent call to next
* or previous. Reset to null if this element is deleted by a call
* to remove.
*/
Object lastRetObj= null;
-
+
Itr(InterfaceContainer _data)
{
dataIt= _data;
}
-
+
synchronized public boolean hasNext()
{
return cursor !=dataIt.size();
}
-
+
public synchronized Object next()
{
try
@@ -771,7 +771,7 @@ public class InterfaceContainer implements Cloneable
throw new java.util.NoSuchElementException();
}
}
-
+
/** Removes the interface from the list, that has been last returned by a
* call to next(). This is done according to the specification of the interface
* method. The element is also removed from InterfaceContainer but independent
@@ -785,23 +785,23 @@ public class InterfaceContainer implements Cloneable
// Remove the entry from InterfaceContainer.
InterfaceContainer.this.remove(lastRetObj);
dataIt.remove(lastRet);
-
+
if (lastRet < cursor)
cursor--;
lastRet = -1;
lastRetObj= null;
}
}
-
+
private class LstItr extends Itr implements ListIterator
{
-
+
LstItr(InterfaceContainer _data, int _index)
{
super(_data);
cursor= _index;
}
-
+
/** Inserts an element to the iterators list according to the specification
* of this interface method. The element is also added to InterfaceContainer
* but its location within the list cannot be guaranteed.
@@ -813,17 +813,17 @@ public class InterfaceContainer implements Cloneable
lastRet = -1;
lastRetObj= null;
}
-
+
synchronized public boolean hasPrevious()
{
return cursor != 0;
}
-
+
synchronized public int nextIndex()
{
return cursor;
}
-
+
public synchronized Object previous()
{
try
@@ -837,20 +837,20 @@ public class InterfaceContainer implements Cloneable
throw new NoSuchElementException();
}
}
-
+
synchronized public int previousIndex()
{
return cursor-1;
}
-
+
/** This is not possible since several iterators can modify InterfaceContainer
*/
public synchronized void set(Object o)
{
throw new UnsupportedOperationException();
}
-
-
+
+
} // class LstItr
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
index c324345a27d8..e61362b2bc3c 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,14 +34,14 @@ import java.util.Iterator;
public class MultiTypeInterfaceContainer
{
-
+
private Map map= new HashMap();
-
+
/** Creates a new instance of MultiTypeInterfaceContainer */
public MultiTypeInterfaceContainer()
{
}
-
+
/** only returns types which have at least one value in InterfaceContainer
* return value can contain an element null, if someone called
* addInterface (null, interf)
@@ -50,12 +50,12 @@ public class MultiTypeInterfaceContainer
{
int size;
Type[] retVal= null;
-
+
if ( (size=map.size()) > 0)
{
Type [] arTypes= new Type[size];
Iterator it= map.keySet().iterator();
-
+
int countTypes= 0;
while (it.hasNext())
{
@@ -73,7 +73,7 @@ public class MultiTypeInterfaceContainer
arTypes[countTypes++]= new Type(key.getClass());
}
}
-
+
if (countTypes != size)
{
retVal= new Type[countTypes];
@@ -86,7 +86,7 @@ public class MultiTypeInterfaceContainer
retVal= new Type[0];
return retVal;
}
-
+
/** param key can be null */
synchronized public InterfaceContainer getContainer(Object key)
{
@@ -108,12 +108,12 @@ public class MultiTypeInterfaceContainer
}
return retVal;
}
-
-
+
+
synchronized public int addInterface(Object ckey, Object iface)
{
//If the key is a Type then it does not matter if the objects are different
- // if they represent the same type. This is because Types overrides hashCode and
+ // if they represent the same type. This is because Types overrides hashCode and
// equals. For example:
// Type a= new Type(XInterface.class);
// Type b= new Type(XInterface.class);
@@ -131,8 +131,8 @@ public class MultiTypeInterfaceContainer
}
return cont.size();
}
-
-
+
+
synchronized public int removeInterface(Object key, Object iface)
{
int retVal= 0;
@@ -144,7 +144,7 @@ public class MultiTypeInterfaceContainer
}
return retVal;
}
-
+
public void disposeAndClear(EventObject evt)
{
Iterator it= null;
@@ -155,7 +155,7 @@ public class MultiTypeInterfaceContainer
while (it.hasNext() )
((InterfaceContainer) it.next()).disposeAndClear(evt);
}
-
+
synchronized public void clear()
{
Iterator it= map.values().iterator();
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index ad2c8c7bcf88..0f18ac78154b 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,18 +54,18 @@ import com.sun.star.lang.DisposedException;
/** This class is an implementation of the interfaces com.sun.star.beans.XPropertySet,
- * com.sun.star.beans.XFastPropertySet and com.sun.star.beans.XMultiPropertySet. This
- * class has to be inherited to be used. The values of properties are stored in member
- * variables of the inheriting class. By overriding the methods
+ * com.sun.star.beans.XFastPropertySet and com.sun.star.beans.XMultiPropertySet. This
+ * class has to be inherited to be used. The values of properties are stored in member
+ * variables of the inheriting class. By overriding the methods
* {@link #convertPropertyValue convertPropertyValue},
- * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and
- * {@link #getPropertyValue(Property)} one can determine how
+ * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and
+ * {@link #getPropertyValue(Property)} one can determine how
* property values are stored.
- * When using the supplied implementations of this class then the member variables which
+ * When using the supplied implementations of this class then the member variables which
* hold property values have to be declared in the class which inherits last in the inheriting
* chain and they have to be public<p>
- * Properties have to be registered by one of the registerProperty methods. They take among other
- * arguments an Object named <em>id</em> which has to be a String that represents the name of
+ * Properties have to be registered by one of the registerProperty methods. They take among other
+ * arguments an Object named <em>id</em> which has to be a String that represents the name of
* the member variable. The registering has to occur in the constructor of the inheriting class.
* It is no allowed to add or change properties later on.<p>
* Example:
@@ -89,9 +89,9 @@ XMultiPropertySet
private HashMap _handleToPropertyMap;
private HashMap _propertyToIdMap;
private Property[] arProperties;
-
+
private int lastHandle= 1;
-
+
protected XPropertySetInfo propertySetInfo;
protected MultiTypeInterfaceContainer aBoundLC= new MultiTypeInterfaceContainer();
protected MultiTypeInterfaceContainer aVetoableLC= new MultiTypeInterfaceContainer();
@@ -101,14 +101,14 @@ XMultiPropertySet
initMappings();
}
- /** Registers a property with this helper class and associates the argument <em>id</em> with it.
+ /** Registers a property with this helper class and associates the argument <em>id</em> with it.
* <em>id</em> is used to identify the storage of the property value. How property values are stored
- * and retrieved is determined by the methods {@link #convertPropertyValue convertPropertyValue},
- * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and {@link #getPropertyValue(Property) getPropertyValue}
+ * and retrieved is determined by the methods {@link #convertPropertyValue convertPropertyValue},
+ * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and {@link #getPropertyValue(Property) getPropertyValue}
* These methods expect <em>id</em> to be a java.lang.String which represents the name of a member variable
* which holds the property value.
* Only properties which are registered can be accessed. Registration has to occur during
- * initialization of the inheriting class (i.e. within the contructor).
+ * initialization of the inheriting class (i.e. within the contructor).
* @param prop The property to be registered.
* @param id Identifies the properties storage.
* @see #getPropertyId
@@ -118,9 +118,9 @@ XMultiPropertySet
putProperty(prop);
assignPropertyId(prop, id);
}
-
+
/** Registers a property with this helper class and associates the argument id with it.
- * It does the same as {@link #registerProperty(Property, Object)}. The first four
+ * It does the same as {@link #registerProperty(Property, Object)}. The first four
* arguments are used to construct a Property object.
* Registration has to occur during
* initialization of the inheriting class (i.e. within the contructor)
@@ -137,7 +137,7 @@ XMultiPropertySet
}
/** Registers a property with this class and associates the argument id with it.
- * It does the same as {@link #registerProperty(Property, Object)}. The first three
+ * It does the same as {@link #registerProperty(Property, Object)}. The first three
* arguments are used to construct a Property object. The value for the Property.Handle
* is generated and does not have to be specified here. Use this method for registering
* a property if you do not care about the Property's handles.
@@ -154,12 +154,12 @@ XMultiPropertySet
Property p= new Property(name, lastHandle++, type, attributes);
registerProperty(p, id);
}
-
- /** Registers a property with this class. This method expects that property values
+
+ /** Registers a property with this class. This method expects that property values
* are stored in member variables as is the case if the methods convertPropertyValue,
* setPropertyValueNoBroadcast and getPropertyValue(Property) are not overridden.
* It is presumed that the type of the member variable
- * corresponds Property.Type. For example, if the TypeClass of Property.Type is to be
+ * corresponds Property.Type. For example, if the TypeClass of Property.Type is to be
* a TypeClass.SHORT then the member must be a short or java.lang.Short.
* The handle for the property is generated.<br>
* If there is no member with the specified name or if the member has an incompatible type
@@ -171,7 +171,7 @@ XMultiPropertySet
protected void registerProperty(String propertyName, String memberName, short attributes)
{
Field propField= null;
- try
+ try
{
propField= getClass().getDeclaredField(memberName);
}
@@ -190,9 +190,9 @@ XMultiPropertySet
throw new com.sun.star.uno.RuntimeException("the member has an unknown type: " + memberName);
}
- /** Registers a property with this class.
+ /** Registers a property with this class.
* It is presumed that the name of property is equal to the name of the member variable
- * that holds the property value.
+ * that holds the property value.
* @param propertyName The name of the property and the member variable that holds the property's value.
* @param attributes The property attributes.
* @see #registerProperty(String, String, short)
@@ -201,13 +201,13 @@ XMultiPropertySet
{
registerProperty(propertyName, propertyName, attributes);
}
+
+
-
-
- /** Returns the Property object for a given property name or null if that property does
- * not exists (i.e. it has not been registered). Override this method
+ /** Returns the Property object for a given property name or null if that property does
+ * not exists (i.e. it has not been registered). Override this method
* if you want to implement your own mapping from property names to Property objects.
- * Then you also have to override {@link #initMappings}, {@link #getProperties()} and
+ * Then you also have to override {@link #initMappings}, {@link #getProperties()} and
* {@link #putProperty(Property)}.
* @param propertyName The name of the property (Property.Name)
* @return The Property object with the name <em>propertyName</em>.
@@ -216,10 +216,10 @@ XMultiPropertySet
{
return (Property) _nameToPropertyMap.get(propertyName);
}
-
+
/** Returns the Property object with a handle (Property.Handle) as specified by the argument
- * <em>nHandle</em>. The method returns null if there is no such property (i.e. it has not
- * been registered). Override this method if you want to implement your own mapping from handles
+ * <em>nHandle</em>. The method returns null if there is no such property (i.e. it has not
+ * been registered). Override this method if you want to implement your own mapping from handles
* to Property objects. Then you also have to override {@link #initMappings}, {@link #putProperty(Property)}.
* @param nHandle The handle of the property (Property.Handle).
* @return The Property object with the handle <em>nHandle</em>
@@ -228,10 +228,10 @@ XMultiPropertySet
{
return (Property) _handleToPropertyMap.get(new Integer(nHandle));
}
-
+
/** Returns an array of all Property objects or an array of length null if there
- * are no properties. Override this method if you want to implement your own mapping from names
- * to Property objects. Then you also have to override {@link #initMappings}, {@link #getProperty(String)} and
+ * are no properties. Override this method if you want to implement your own mapping from names
+ * to Property objects. Then you also have to override {@link #initMappings}, {@link #getProperty(String)} and
* {@link #putProperty}.
* @return Array of all Property objects.
*/
@@ -244,12 +244,12 @@ XMultiPropertySet
}
return arProperties;
}
-
- /** Stores a Property object so that it can be retrieved subsequently by
+
+ /** Stores a Property object so that it can be retrieved subsequently by
* {@link #getProperty(String)},{@link #getProperties()},{@link #getPropertyByHandle(int)}.
- * Override this method if you want to implement your own mapping from handles
+ * Override this method if you want to implement your own mapping from handles
* to Property objects and names to Property objects. Then you also need to override {@link #initMappings},
- * {@link #getProperty(String)},{@link #getProperties()},{@link #getPropertyByHandle(int)}.
+ * {@link #getProperty(String)},{@link #getProperties()},{@link #getPropertyByHandle(int)}.
* @param prop The Property object that is to be stored.
*/
protected void putProperty(Property prop)
@@ -258,16 +258,16 @@ XMultiPropertySet
if (prop.Handle != -1)
_handleToPropertyMap.put(new Integer(prop.Handle), prop);
}
-
- /** Assigns an identifyer object to a Property object so that the identifyer
+
+ /** Assigns an identifyer object to a Property object so that the identifyer
* can be obtained by {@link #getPropertyId getPropertyId} later on. The identifyer
* is used to specify a certain storage for the property's value. If you do not
* override {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} or {@link #getPropertyValue(Property)}
- * then the argument <em>id</em> has to be a java.lang.String that equals the name of
+ * then the argument <em>id</em> has to be a java.lang.String that equals the name of
* the member variable that holds the Property's value.
- * Override this method if you want to implement your own mapping from Property objects to ids or
+ * Override this method if you want to implement your own mapping from Property objects to ids or
* if you need ids of a type other then java.lang.String.
- * Then you also need to override {@link #initMappings initMappings} and {@link #getPropertyId getPropertyId}.
+ * Then you also need to override {@link #initMappings initMappings} and {@link #getPropertyId getPropertyId}.
* @param prop The Property object that is being assigned an id.
* @param id The object which identifies the storage used for the property's value.
* @see #registerProperty(Property, Object)
@@ -277,11 +277,11 @@ XMultiPropertySet
if (id instanceof String && ((String) id).equals("") == false)
_propertyToIdMap.put(prop, id);
}
-
- /** Returns the identifyer object for a certain Property. The object must have been
+
+ /** Returns the identifyer object for a certain Property. The object must have been
* previously assigned to the Property object by {@link #assignPropertyId assignPropertyId}.
* Override this method if you want to implement your own mapping from Property objects to ids.
- * Then you also need to override {@link #initMappings initMappings} and {@link #assignPropertyId assignPropertyId}.
+ * Then you also need to override {@link #initMappings initMappings} and {@link #assignPropertyId assignPropertyId}.
* @param prop The property for which the id is to be retrieved.
* @return The id object that identifies the storage used for the property's value.
* @see #registerProperty(Property, Object)
@@ -293,7 +293,7 @@ XMultiPropertySet
/** Initializes data structures used for mappings of property names to property object,
* property handles to property objects and property objects to id objects.
- * Override this method if you want to implement your own mappings. Then you also need to
+ * Override this method if you want to implement your own mappings. Then you also need to
* override {@link #putProperty putProperty},{@link #getProperty getProperty}, {@link #getPropertyByHandle},
* {@link #assignPropertyId assignPropertyId} and {@link #getPropertyId getPropertyId}.
*/
@@ -311,14 +311,14 @@ XMultiPropertySet
{
// Create an event with this as sender
EventObject aEvt= new EventObject(this);
-
+
// inform all listeners to reelease this object
aBoundLC.disposeAndClear(aEvt);
aVetoableLC.disposeAndClear(aEvt);
- }
+ }
//XPropertySet ----------------------------------------------------
- synchronized public void addPropertyChangeListener(String str, XPropertyChangeListener xPropertyChangeListener)
+ synchronized public void addPropertyChangeListener(String str, XPropertyChangeListener xPropertyChangeListener)
throws UnknownPropertyException, WrappedTargetException
{
// only add listeners if you are not disposed
@@ -381,16 +381,16 @@ XMultiPropertySet
}
//XPropertySet ----------------------------------------------------
public Object getPropertyValue(String name) throws UnknownPropertyException, WrappedTargetException
- {
+ {
Object ret= null;
if (bInDispose || bDisposed)
throw new com.sun.star.lang.DisposedException("The component has been disposed already");
-
+
Property prop= getProperty(name);
if (prop == null)
throw new UnknownPropertyException("The property " + name + " is unknown");
-
- synchronized (this)
+
+ synchronized (this)
{
ret= getPropertyValue(prop);
}
@@ -405,10 +405,10 @@ XMultiPropertySet
}
return ret;
}
-
+
//XPropertySet ----------------------------------------------------
synchronized public void removePropertyChangeListener(String propName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException
- { // all listeners are automaticly released in a dispose call
+ { // all listeners are automaticly released in a dispose call
if (!bInDispose && !bDisposed)
{
if (propName.length() > 0)
@@ -439,12 +439,12 @@ XMultiPropertySet
listenerContainer.removeInterface(XVetoableChangeListener.class, listener);
}
}
-
+
//XPropertySet ----------------------------------------------------
- /** Sets the value of a property.
+ /** Sets the value of a property.
* The idl description for this interfaces, stipulates that the argument value is an Any. Since a java.lang.Object
* reference has the same meaning as an Any this function accepts
- * java anys (com.sun.star.uno.Any) and all other appropriate objects as arguments. The value argument can be one
+ * java anys (com.sun.star.uno.Any) and all other appropriate objects as arguments. The value argument can be one
* of these:
* <ul>
* <li>java.lang.Boolean</li>
@@ -461,23 +461,23 @@ XMultiPropertySet
* <li><em>arrays which contain elements of the types above</em></li>
* <li>com.sun.star.uno.Any containing an instance of one of the above types</li>
* </ul>
- *
- * Properties can have the attribute com.sun.star.beans.PropertyAttribute.MAYBEVOID, which means that the value
+ *
+ * Properties can have the attribute com.sun.star.beans.PropertyAttribute.MAYBEVOID, which means that the value
* (not the type) can be void. In order to assign a void value to a property one can either pass an Any which
- * contains a null reference or pass null directly. In bothe cases the null reference is only accepted if
+ * contains a null reference or pass null directly. In bothe cases the null reference is only accepted if
* the PropertyAttribute.MAYBEVOID attribute is set for the property.
- *
- * Properties which have the attribute MAYBEVOID set (Property.Attributes) can have a void value. The following
+ *
+ * Properties which have the attribute MAYBEVOID set (Property.Attributes) can have a void value. The following
* considerations presume that the Property has that attribute set. Further, when mentioning an Any's value we
- * actually refer to the object returned by Any.getObject.
+ * actually refer to the object returned by Any.getObject.
* If the argument <em>value</em> is null, or it is an Any whose value is null (but with a valid Type)
- * then the member variable used for storing the property's value is set to null.
+ * then the member variable used for storing the property's value is set to null.
* Therefore those properties can only be stored in objects
* and primitive types are not allowed (one can use the wrapper classes instead,e.g. java.lang.Byte) .
* If a property's value is kept in a member variable of type Any and that reference is still null
* then when setPropertyValue is called with
* <em>value</em> = null then the member variable is assigned an Any with type void and a null value.
- * Or if the argument is an Any with a null value then it is assigned to the member variable.
+ * Or if the argument is an Any with a null value then it is assigned to the member variable.
* Further, if the variable already
* references an Any and setPropertyValue is called with <em>value</em> = null, then the variable is assigned
* a new Any with the same type as the previously referenced Any and with a null value.
@@ -493,8 +493,8 @@ XMultiPropertySet
setPropertyValue(prop, value);
}
- /** Sets the value of a property. It checks if the property's attributes (READONLY,MAYBEVOID), allow that the
- * new value can be set. It also causes the notification of listeners.
+ /** Sets the value of a property. It checks if the property's attributes (READONLY,MAYBEVOID), allow that the
+ * new value can be set. It also causes the notification of listeners.
* @param prop The property whose value is to be set.
* @param value The new value for the property.
*/
@@ -503,17 +503,17 @@ XMultiPropertySet
{
if ((prop.Attributes & PropertyAttribute.READONLY) == PropertyAttribute.READONLY)
throw new com.sun.star.beans.PropertyVetoException();
- // The value may be null only if MAYBEVOID attribute is set
+ // The value may be null only if MAYBEVOID attribute is set
boolean bVoidValue= false;
if (value instanceof Any)
bVoidValue= ((Any) value).getObject() == null;
else
bVoidValue= value == null;
- if (bVoidValue && (prop.Attributes & PropertyAttribute.MAYBEVOID) == 0)
+ if (bVoidValue && (prop.Attributes & PropertyAttribute.MAYBEVOID) == 0)
throw new com.sun.star.lang.IllegalArgumentException("The property must have a value; the MAYBEVOID attribute is not set!");
if (bInDispose || bDisposed)
throw new DisposedException("Component is already disposed");
-
+
//Check if the argument is allowed
boolean bValueOk= false;
if (value instanceof Any)
@@ -522,16 +522,16 @@ XMultiPropertySet
bValueOk= checkType(value);
if (! bValueOk)
throw new com.sun.star.lang.IllegalArgumentException("No valid UNO type");
-
-
+
+
boolean bConversionOk= false;
Object[] outConvertedVal= new Object[1];
Object[] outOldValue= new Object[1];
- synchronized (this)
+ synchronized (this)
{
bConversionOk= convertPropertyValue(prop, outConvertedVal, outOldValue, value);
}
-
+
//The next step following the conversion is to set the new value of the property. Prior to this
// the XVetoableChangeListener s have to be notified.
if (bConversionOk)
@@ -548,76 +548,76 @@ XMultiPropertySet
fire( new Property[]{prop}, outConvertedVal, outOldValue, false);
}
}
-
- /** Converts a value in a way so that it is appropriate for storing as a property value, that is
- * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} can process the value without any further
+
+ /** Converts a value in a way so that it is appropriate for storing as a property value, that is
+ * {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} can process the value without any further
* conversion. This implementation presumes that
- * the values are stored in member variables of the furthest inheriting class. For example,
+ * the values are stored in member variables of the furthest inheriting class. For example,
* class A inherits this class then members of class A
* can hold property values. If there is a class B which inherits A then only members of B can hold
- * property values. The variables must be public. A property must have been registered (e.g. by
+ * property values. The variables must be public. A property must have been registered (e.g. by
* {@link #registerProperty(Property, Object)} in order for this method to work. The identifyer argument (type Object)
- * used in the registerProperty methods must
+ * used in the registerProperty methods must
* be a java.lang.String, which is, the name of the member variable that holds the property value.
* If one opts to store values differently then one may override
- * this method, as well as {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and
+ * this method, as well as {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} and
* {@link #getPropertyValue(Property) getPropertyValue(Property)}.
- * This method is always called as a result of a call to one of the setter methods, such as
- * {@link #setPropertyValue(String,Object) XPropertySet.setPropertyValue},
+ * This method is always called as a result of a call to one of the setter methods, such as
+ * {@link #setPropertyValue(String,Object) XPropertySet.setPropertyValue},
* {@link #setFastPropertyValue XFastPropertySet.setFastPropertyValue}
- * and {@link #setPropertyValues XMultiPropertySet.setPropertyValues}.
- * If this method fails, that is, it returns false or throws an exception, then no listeners are notified and the
+ * and {@link #setPropertyValues XMultiPropertySet.setPropertyValues}.
+ * If this method fails, that is, it returns false or throws an exception, then no listeners are notified and the
* property value, that was intended to be changed, remains untouched.<br /> This method does not have to deal with property attributes, such as
* PropertyAttribute.READONLY or PropertyAttribute.MAYBEVOID. The processing of these attributes occurs
* in the calling methods.<br />
- * Only if this method returns successfully further processing, such
+ * Only if this method returns successfully further processing, such
* as listener notification and finally the modifiction of the property's value, will occur.<br />
*
- * The actual modification of a property's value is done by {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast}
- * which is called subsequent to convertPropertyValue.
+ * The actual modification of a property's value is done by {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast}
+ * which is called subsequent to convertPropertyValue.
*<p>
* This method converts values by help of the com.sun.star.uno.AnyConverter which only does a few widening
- * conversions on integer types and floating point types. For example, there is the property PropA with a Type equivalent
- * to int.class and the
- * value of the property is to be stored in a member variable of type int with name intProp. Then setPropertyValue is
+ * conversions on integer types and floating point types. For example, there is the property PropA with a Type equivalent
+ * to int.class and the
+ * value of the property is to be stored in a member variable of type int with name intProp. Then setPropertyValue is
* called:
* <pre>
* set.setPropertyValue( "PropA", new Byte( (byte)111));
* </pre>
* At some point setPropertyValue will call convertPropertyValue and pass in the Byte object. Since we allow
- * that Byte values can be used with the property and know that the value is to be stored in intProp (type int)
- * we convert the Byte object into an Integer object which is then returned in the out-parameter <em>newVal</em>. This
+ * that Byte values can be used with the property and know that the value is to be stored in intProp (type int)
+ * we convert the Byte object into an Integer object which is then returned in the out-parameter <em>newVal</em>. This
* conversion is actually performed by the AnyConverter. Later
* the setPropertyValueNoBroadcast is called with that Integer object and the int value can be easily extracted
- * from the object and be assigned to the member intProp.
+ * from the object and be assigned to the member intProp.
* <p>
- * The method handles Any arguments the same as Object arguments. That is, the <em>setVal</em> argument can
- * be a java.lang.Boolean or a com.sun.star.uno.Any containing a java.lang.Boolean. Likewise, a member
- * containing a property value can be a com.sun.star.uno.Any or an java.lang.Object.
- * Then, no conversion is necessary, since they can hold all possible values. However, if
+ * The method handles Any arguments the same as Object arguments. That is, the <em>setVal</em> argument can
+ * be a java.lang.Boolean or a com.sun.star.uno.Any containing a java.lang.Boolean. Likewise, a member
+ * containing a property value can be a com.sun.star.uno.Any or an java.lang.Object.
+ * Then, no conversion is necessary, since they can hold all possible values. However, if
* the member is an Object and <em>setVal</em> is an Any then the object contained in the any is assigned to
- * the member. The extra type information which exists as Type object in the Any will get lost. If this is not
+ * the member. The extra type information which exists as Type object in the Any will get lost. If this is not
* intended then use an Any variable rather then an Object.<br />
- * If a member is an Object or Any and the argument <em>setVal</em> is an Object, other than String or array,
+ * If a member is an Object or Any and the argument <em>setVal</em> is an Object, other than String or array,
* then it is presumed to be an UNO object and queried for XInterface. If successful, the out-param <em>newVal</em>
* returns the XInterface.<br />
* If a member is an UNO interface, then <em>setVal</em> is queried for this interface and the result is returned.
* If <em>setVal</em> is null then <em>newVal</em> will be null too after return.
* <p>
- * If a property value is stored using a primitive type the the out-parameters
+ * If a property value is stored using a primitive type the the out-parameters
* <em>curVal</em> and <em>newVal</em> contain the respective wrapper class (e.g.java.lang.Byte, etc.).
* curVal is used in calls to the XVetoableChangeListener and XPropertyChangeListener.
*
* @param property - in-param property for which the data is to be converted.
* @param newVal - out-param which contains the converted value on return.
- * @param curVal - out-param the current value of the property. It is used in calls to the
+ * @param curVal - out-param the current value of the property. It is used in calls to the
* XVetoableChangeListener and XPropertyChangeListener.
- * @param setVal - in-param. The value that is to be converted so that it matches Property and the internally used
- * dataformat for that property.
- * @return true - Conversion was successful. <em>newVal</em> contains a valid value for the property. false -
+ * @param setVal - in-param. The value that is to be converted so that it matches Property and the internally used
+ * dataformat for that property.
+ * @return true - Conversion was successful. <em>newVal</em> contains a valid value for the property. false -
* conversion failed for some reason.
* @throws com.sun.star.lang.IllegalArgumentException The value provided is unfit for the property.
- * @throws com.sun.star.lang.WrappedTargetException - An exception occured during the conversion, that is to be made known
+ * @throws com.sun.star.lang.WrappedTargetException - An exception occured during the conversion, that is to be made known
* to the caller.
*/
protected boolean convertPropertyValue(Property property, Object[] newVal, Object[]curVal, Object setVal)
@@ -635,10 +635,10 @@ XMultiPropertySet
// also get inherited fields, but only those which are public.
Field propField= getClass().getDeclaredField(sMember);
if (propField != null)
- {
+ {
curVal[0]= propField.get(this);
Class memberClass= propField.getType();
-
+
// MAYBEVOID: if setVal == null or it is an Any and getObject returns null, then a void value is to be set
// This works only if there are no primitive types. For those we use the respective wrapper classes.
// In this implementation, a null reference means void value.
@@ -650,7 +650,7 @@ XMultiPropertySet
bVoidValue= setVal == null;
if (bVoidValue && memberClass.isPrimitive())
throw new com.sun.star.lang.IllegalArgumentException("The implementation does not support the MAYBEVOID attribute for this property");
-
+
Object convObj= null;
//The member that keeps the value of the Property is an Any. It can contain all possible
//types, therefore a conversion is not necessary.
@@ -661,12 +661,12 @@ XMultiPropertySet
convObj= setVal;
else
{
- // Parameter setVal is not an Any. We need to construct an Any that contains
+ // Parameter setVal is not an Any. We need to construct an Any that contains
// the argument setVal.
- // If setVal is an interface implementation then, we cannot constuct the
+ // If setVal is an interface implementation then, we cannot constuct the
// Any with setVal.getClass(), because the Any.Type._typeClass would be TypeClass.UNKNOWN.
// We try to get an XInterface of setVal and set an XInterface type.
- if (setVal instanceof XInterface)
+ if (setVal instanceof XInterface)
{
XInterface xint= UnoRuntime.queryInterface(XInterface.class, setVal);
if (xint != null)
@@ -698,7 +698,7 @@ XMultiPropertySet
}
catch (java.lang.NoSuchFieldException e)
{
- throw new WrappedTargetException("Field does not exist", this, e);
+ throw new WrappedTargetException("Field does not exist", this, e);
}
catch (java.lang.IllegalAccessException e)
{
@@ -706,11 +706,11 @@ XMultiPropertySet
}
return ret;
}
-
+
private boolean checkType(Object obj)
{
- if (obj == null
- || obj instanceof Boolean
+ if (obj == null
+ || obj instanceof Boolean
|| obj instanceof Character
|| obj instanceof Number
|| obj instanceof String
@@ -721,7 +721,7 @@ XMultiPropertySet
return true;
return false;
}
-
+
// Param object can be an Any or other object. If obj is null then the return value is null
private Object convert( Class cl, Object obj) throws com.sun.star.lang.IllegalArgumentException
{
@@ -782,17 +782,17 @@ XMultiPropertySet
throw new com.sun.star.lang.IllegalArgumentException("Could not convert the argument");
return retVal;
}
-
- /** Sets the value of a property. In this implementation property values are stored in member variables
+
+ /** Sets the value of a property. In this implementation property values are stored in member variables
* (see {@link #convertPropertyValue convertPropertyValue} Notification of property listeners
* does not occur in this method. By overriding this method one can take full control about how property values
- * are stored. But then, the {@link #convertPropertyValue convertPropertyValue} and
- * {@link #getPropertyValue(Property)} must be overridden too.
- *
- * A Property with the MAYBEVOID attribute set, is stored as null value. Therefore the member variable must be
- * an Object in order to make use of the property attribute. An exception is Any. The Any variable can be initially null, but
- * once it is set the reference will not become null again. If the value is to be set to
- * void then a new Any will be stored
+ * are stored. But then, the {@link #convertPropertyValue convertPropertyValue} and
+ * {@link #getPropertyValue(Property)} must be overridden too.
+ *
+ * A Property with the MAYBEVOID attribute set, is stored as null value. Therefore the member variable must be
+ * an Object in order to make use of the property attribute. An exception is Any. The Any variable can be initially null, but
+ * once it is set the reference will not become null again. If the value is to be set to
+ * void then a new Any will be stored
* with a valid type but without a value (i.e. Any.getObject returns null).
* If a property has the READONLY attribute set, and one of the setter methods, such as setPropertyValue, has been
* called, then this method is not going to be called.
@@ -823,14 +823,14 @@ XMultiPropertySet
throw new WrappedTargetException("PropertySet.setPropertyValueNoBroadcast", this, e);
}
}
- /** Retrieves the value of a property. This implementation presumes that the values are stored in member variables
- * of the furthest inheriting class (see {@link #convertPropertyValue convertPropertyValue}) and that the
- * variables are public. The property must have
- * been registered, for example by {@link #registerProperty(Property, Object)}. The identifyer Object argument
+ /** Retrieves the value of a property. This implementation presumes that the values are stored in member variables
+ * of the furthest inheriting class (see {@link #convertPropertyValue convertPropertyValue}) and that the
+ * variables are public. The property must have
+ * been registered, for example by {@link #registerProperty(Property, Object)}. The identifyer Object argument
* must have been a java.lang.String which was the name of the member variable holding the property value.
- * When properties are to be stored differently one has to override this method as well as
+ * When properties are to be stored differently one has to override this method as well as
* {@link #convertPropertyValue} and {@link #setPropertyValueNoBroadcast}. <br>
- * If a value is stored in a variable of a primitive type then this method returns an instance of the respective
+ * If a value is stored in a variable of a primitive type then this method returns an instance of the respective
* wrapper class (e.g. java.lang.Boolean).
* @param property The property for which the value is to be retrieved.
* @return The value of the property.
@@ -862,17 +862,17 @@ XMultiPropertySet
}
return ret;
}
-
+
/**
* This method fires events to XPropertyChangeListener,XVetoableChangeListener and
* XPropertiesChangeListener event sinks.
- * To distinguish what listeners are to be called the argument <em>bVetoable</em> is to be set to true if
+ * To distinguish what listeners are to be called the argument <em>bVetoable</em> is to be set to true if
* a XVetoableChangeListener is meant. For XPropertyChangeListener and XPropertiesChangeListener
- * it is to be set to false.
- *
- * @param properties Properties wich will be or have been affected.
- * @param newValues the new values of the properties.
- * @param oldValues the old values of the properties.
+ * it is to be set to false.
+ *
+ * @param properties Properties wich will be or have been affected.
+ * @param newValues the new values of the properties.
+ * @param oldValues the old values of the properties.
* @param bVetoable true means fire to VetoableChangeListener, false means fire to
* XPropertyChangedListener and XMultiPropertyChangedListener.
*/
@@ -894,7 +894,7 @@ XMultiPropertySet
if ((bVetoable && (properties[i].Attributes & PropertyAttribute.CONSTRAINED) > 0)
|| (!bVetoable && (properties[i].Attributes & PropertyAttribute.BOUND) > 0))
{
- arEvts[i]= new PropertyChangeEvent(this, properties[i].Name, false,
+ arEvts[i]= new PropertyChangeEvent(this, properties[i].Name, false,
properties[i].Handle, oldValues[i], newValues[i]);
nAffectedProps++;
}
@@ -923,8 +923,8 @@ XMultiPropertySet
// broadcast to all listeners with "" property name
if(bVetoable)
lc= listenerContainer.getContainer(XVetoableChangeListener.class);
- else
- lc= listenerContainer.getContainer(XPropertyChangeListener.class);
+ else
+ lc= listenerContainer.getContainer(XPropertyChangeListener.class);
if(lc != null)
{
Iterator it= lc.iterator();
@@ -942,7 +942,7 @@ XMultiPropertySet
// if nAffectedProps == 0 then there are no BOUND properties
if (!bVetoable && nAffectedProps > 0)
{
-
+
PropertyChangeEvent[] arReduced= new PropertyChangeEvent[nAffectedProps];
System.arraycopy(arEvts, 0, arReduced, 0, nAffectedProps);
InterfaceContainer lc= listenerContainer.getContainer(XPropertiesChangeListener.class);
@@ -957,10 +957,10 @@ XMultiPropertySet
}
}
}
- }
+ }
}
// XFastPropertySet--------------------------------------------------------------------------------
- public void setFastPropertyValue(int nHandle, Object aValue ) throws UnknownPropertyException,
+ public void setFastPropertyValue(int nHandle, Object aValue ) throws UnknownPropertyException,
PropertyVetoException, com.sun.star.lang.IllegalArgumentException, WrappedTargetException
{
Property prop= getPropertyByHandle(nHandle);
@@ -968,9 +968,9 @@ XMultiPropertySet
throw new UnknownPropertyException(" The property with handle : " + nHandle +" is unknown");
setPropertyValue(prop, aValue);
}
-
+
// XFastPropertySet --------------------------------------------------------------------------------
- public Object getFastPropertyValue(int nHandle ) throws UnknownPropertyException,
+ public Object getFastPropertyValue(int nHandle ) throws UnknownPropertyException,
WrappedTargetException
{
Property prop= getPropertyByHandle(nHandle);
@@ -983,8 +983,8 @@ XMultiPropertySet
public void addPropertiesChangeListener(String[] propNames, XPropertiesChangeListener listener)
{
listenerContainer.addInterface(XPropertiesChangeListener.class, listener);
- }
-
+ }
+
// XMultiPropertySet -----------------------------------------------------------------------------------
public void firePropertiesChangeEvent(String[] propNames, XPropertiesChangeListener listener)
{
@@ -1000,21 +1000,21 @@ XMultiPropertySet
if (prop != null)
{
Object value= null;
- try
+ try
{
value= getPropertyValue(prop);
- }
- catch(Exception e)
+ }
+ catch(Exception e)
{
continue;
}
- arEvents[eventCount]= new PropertyChangeEvent(this, prop.Name,
+ arEvents[eventCount]= new PropertyChangeEvent(this, prop.Name,
false, prop.Handle, value, value);
eventCount++;
}
}
}
-
+
// fire events from unsynchronized section so as to prevent deadlocks
if (eventCount > 0)
{
@@ -1028,19 +1028,19 @@ XMultiPropertySet
listener.propertiesChange(arEvents);
}
}
- // XMultiPropertySet -----------------------------------------------------------------------------------
- /** If a value for a property could not be retrieved then the respective element in the returned
+ // XMultiPropertySet -----------------------------------------------------------------------------------
+ /** If a value for a property could not be retrieved then the respective element in the returned
* array has the value null.
*/
public Object[] getPropertyValues(String[] propNames)
{
Object[] arValues= new Object[propNames.length];
- synchronized (this)
+ synchronized (this)
{
for (int i= 0; i < propNames.length; i++)
{
Object value= null;
- try
+ try
{
value= getPropertyValue(propNames[i]);
}
@@ -1052,19 +1052,19 @@ XMultiPropertySet
}
return arValues;
}
- // XMultiPropertySet -----------------------------------------------------------------------------------
+ // XMultiPropertySet -----------------------------------------------------------------------------------
public void removePropertiesChangeListener(XPropertiesChangeListener xPropertiesChangeListener)
{
listenerContainer.removeInterface(XPropertiesChangeListener.class, xPropertiesChangeListener);
}
- // XMultiPropertySet -----------------------------------------------------------------------------------
+ // XMultiPropertySet -----------------------------------------------------------------------------------
/** If the array of property names containes an unknown property then it will be ignored.
*/
public void setPropertyValues(String[] propNames, Object[] values) throws PropertyVetoException, com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
{
for (int i= 0; i < propNames.length; i++)
{
- try
+ try
{
setPropertyValue(propNames[i], values[i]);
}
@@ -1072,31 +1072,31 @@ XMultiPropertySet
{
continue;
}
-
+
}
}
-
+
private class PropertySetInfo implements XPropertySetInfo
{
public com.sun.star.beans.Property[] getProperties()
{
return PropertySet.this.getProperties();
}
-
+
public com.sun.star.beans.Property getPropertyByName(String name) throws UnknownPropertyException
{
return getProperty(name);
}
-
+
public boolean hasPropertyByName(String name)
{
return getProperty(name) != null;
}
-
+
}
}
-
-
-
-
+
+
+
+
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
index 5bf32f6cad0d..643cd43f1463 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
index 1747956949ec..a413ab43fc3b 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,28 +32,28 @@ import java.util.Vector;
/**
* Object representation and parsing of Uno Urls,
- * which allow to locate a named Uno object in a
- * different process. An Uno Url consists of the
- * specification of a connection, protocol and
+ * which allow to locate a named Uno object in a
+ * different process. An Uno Url consists of the
+ * specification of a connection, protocol and
* rootOid delimited with a ';'.
* The syntax of an Uno Url is
- *
+ *
* <code>
* [uno:]connection-type,parameters;protocol-name,parameters;objectname";
* </code>
- *
+ *
* An example Uno Url will look like this:
- *
+ *
* <code>
* socket,host=localhost,port=2002;urp;StarOffice.ServiceManager
* </code>
- *
+ *
* For more information about Uno Url please consult
* <a href="http://udk.openoffice.org/common/man/spec/uno-url.html">
* http://udk.openoffice.org/common/man/spec/uno-url.html</a>
- *
+ *
* Usage:
- *
+ *
* <code>
* UnoUrl url = UnoUrl.parseUnoUrl("socket,host=localhost,port=2002;urp;StarOffice.ServiceManager");
* </code>
@@ -121,7 +121,7 @@ public class UnoUrl {
/**
* Returns the name of the connection of this
* Uno Url. Encoded characters are not allowed.
- *
+ *
* @return The connection name as string.
*/
public String getConnection() {
@@ -131,7 +131,7 @@ public class UnoUrl {
/**
* Returns the name of the protocol of this
* Uno Url. Encoded characters are not allowed.
- *
+ *
* @return The protocol name as string.
*/
public String getProtocol() {
@@ -141,7 +141,7 @@ public class UnoUrl {
/**
* Return the object name. Encoded character are
* not allowed.
- *
+ *
* @return The object name as String.
*/
public String getRootOid() {
@@ -152,7 +152,7 @@ public class UnoUrl {
* Returns the protocol parameters as
* a Hashmap with key/value pairs. Encoded
* characters like '%41' are decoded.
- *
+ *
* @return a HashMap with key/value pairs for protocol parameters.
*/
public HashMap getProtocolParameters() {
@@ -163,7 +163,7 @@ public class UnoUrl {
* Returns the connection parameters as
* a Hashmap with key/value pairs. Encoded
* characters like '%41' are decoded.
- *
+ *
* @return a HashMap with key/value pairs for connection parameters.
*/
public HashMap getConnectionParameters() {
@@ -174,7 +174,7 @@ public class UnoUrl {
* Returns the raw specification of the protocol
* parameters. Encoded characters like '%41' are
* not decoded.
- *
+ *
* @return The uninterpreted protocol parameters as string.
*/
public String getProtocolParametersAsString() {
@@ -185,7 +185,7 @@ public class UnoUrl {
* Returns the raw specification of the connection
* parameters. Encoded characters like '%41' are
* not decoded.
- *
+ *
* @return The uninterpreted connection parameters as string.
*/
public String getConnectionParametersAsString() {
@@ -358,7 +358,7 @@ public class UnoUrl {
/**
* Parses the given Uno Url and returns
* an in memory object representation.
- *
+ *
* @param unoUrl The given uno URl as string.
* @return Object representation of class UnoUrl.
* @throws IllegalArgumentException if Url cannot be parsed.
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java b/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
index 2c3cc142f1a5..bda5a081b64a 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,10 +33,10 @@ import java.util.List;
import java.util.Collections;
import java.util.LinkedList;
-/** An XAdapter implementation that holds a weak reference (java.lang.ref.WeakReference)
- * to an object. Clients can register listener (com.sun.star.lang.XReference) which
- * are notified when the the object (the one which is kept weak) is being finalized. That
- * is, that object is being destroyed because there are not any hard references
+/** An XAdapter implementation that holds a weak reference (java.lang.ref.WeakReference)
+ * to an object. Clients can register listener (com.sun.star.lang.XReference) which
+ * are notified when the the object (the one which is kept weak) is being finalized. That
+ * is, that object is being destroyed because there are not any hard references
* to it.
*/
public class WeakAdapter implements XAdapter
@@ -46,7 +46,7 @@ public class WeakAdapter implements XAdapter
private WeakReference m_weakRef;
// contains XReference objects registered by addReference
private List m_xreferenceList;
-
+
/**
*@param component the object that is to be held weak
*/
@@ -55,14 +55,14 @@ public class WeakAdapter implements XAdapter
m_weakRef= new WeakReference(component);
m_xreferenceList= Collections.synchronizedList( new LinkedList());
}
-
+
/** Called by the XWeak implementation (WeakBase) when it is being finalized.
* It is only being called once.
- * The registererd XReference listeners are notified. On notification they are
- * to unregister themselves. The notification is thread-safe. However, it is possible
- * to add a listener during the notification process, which will never receive a
- * notification. To prevent this, one would have to synchronize this method with
- * the addReference method. But this can result in deadlocks in a multithreaded
+ * The registererd XReference listeners are notified. On notification they are
+ * to unregister themselves. The notification is thread-safe. However, it is possible
+ * to add a listener during the notification process, which will never receive a
+ * notification. To prevent this, one would have to synchronize this method with
+ * the addReference method. But this can result in deadlocks in a multithreaded
* environment.
*/
void referentDying()
@@ -74,7 +74,7 @@ public class WeakAdapter implements XAdapter
((XReference) references[i-1]).dispose();
}
}
-
+
/** Method of com.sun.star.uno.XAdapter. It is called to obtain a hard reference
* to the object which is kept weak by this instance.
* @return hard reference to the object
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
index cce414fcc2a9..ace0713ccdd7 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,14 +42,14 @@ import java.util.Hashtable;
public class WeakBase implements XWeak, XTypeProvider
{
private final boolean DEBUG= false;
-
+
// Contains all WeakAdapter which have been created in this class
// They have to be notified when this object dies
private WeakAdapter m_adapter;
-
+
protected static Map _mapImplementationIds= new Hashtable();
protected static Map _mapTypes= new Hashtable();
-
+
/** Method of XWeak. The returned XAdapter implementation can be used to keap
* a weak reference to this object.
* @return a com.sun.star.uno.XAdapter implementation.
@@ -60,7 +60,7 @@ public class WeakBase implements XWeak, XTypeProvider
m_adapter= new WeakAdapter(this);
return m_adapter;
}
-
+
/** Override of Object.finalize. When there are no references to this object anymore
* then the garbage collector calls this method. Thereby causing the adapter object
* to be notified. The adapter, in turn, notifies all listeners (com.sun.star.uno.XReference)
@@ -71,7 +71,7 @@ public class WeakBase implements XWeak, XTypeProvider
m_adapter.referentDying();
super.finalize();
}
-
+
/** Method of XTypeProvider. It returns an array of Type objects which represent
* all implemented UNO interfaces of this object.
* @return Type objects of all implemented interfaces.
@@ -95,7 +95,7 @@ public class WeakBase implements XWeak, XTypeProvider
// get the superclass the currentClass inherits from
currentClass= currentClass.getSuperclass();
} while (currentClass != null);
-
+
Type types[]= new Type[vec.size()];
for( int i= 0; i < types.length; i++)
types[i]= (Type) vec.elementAt(i);
@@ -104,11 +104,11 @@ public class WeakBase implements XWeak, XTypeProvider
}
return arTypes;
}
-
+
/** Method of XTypeProvider. It provides an identifier that represents the set of UNO
* interfaces implemented by this class. All instances of this class
* which run in the same Java Virtual Machine return the same array. (This only works as long
- * the ClassLoader preserves the class even if no instance exist.)
+ * the ClassLoader preserves the class even if no instance exist.)
*@return identifier as array of bytes
*/
public byte[] getImplementationId()