Class PropertySetMixin
A client will mix in this class by keeping a reference to an instance of
   this class, and forwarding all methods of (a subset of the interfaces)
   com.sun.star.beans.XPropertySet,
   com.sun.star.beans.XFastPropertySet, and
   com.sun.star.beans.XPropertyAccess to it.
Client code should not use the monitors associated with instances of this class, as they are used for internal purposes.
- Since:
- UDK 3.2
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA class used by clients ofPropertySetMixinwhen implementing UNO interface type attribute setter functions.
- 
Constructor SummaryConstructorsConstructorDescriptionPropertySetMixin(XComponentContext context, XInterface object, Type type, String[] absentOptional) The constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPropertyChangeListener(String propertyName, XPropertyChangeListener listener) Implementscom.sun.star.beans.XPropertySet.addPropertyChangeListener.voidaddVetoableChangeListener(String propertyName, XVetoableChangeListener listener) Implementscom.sun.star.beans.XPropertySet.addVetoableChangeListener.voiddispose()Marks this instance as being disposed.getFastPropertyValue(int handle) Implementscom.sun.star.beans.XFastPropertySet.getFastPropertyValue.Implementscom.sun.star.beans.XPropertySet.getPropertySetInfo.getPropertyValue(String propertyName) Implementscom.sun.star.beans.XPropertySet.getPropertyValue.Implementscom.sun.star.beans.XPropertyAccess.getPropertyValues.voidprepareSet(String propertyName, PropertySetMixin.BoundListeners bound) A simplified version ofprepareSet(String, Object, Object, PropertySetMixin.BoundListeners).voidprepareSet(String propertyName, Object oldValue, Object newValue, PropertySetMixin.BoundListeners bound) A method used by clients when implementing UNO interface type attribute setter functions.voidremovePropertyChangeListener(String propertyName, XPropertyChangeListener listener) Implementscom.sun.star.beans.XPropertySet.removePropertyChangeListener.voidremoveVetoableChangeListener(String propertyName, XVetoableChangeListener listener) Implementscom.sun.star.beans.XPropertySet.removeVetoableChangeListener.voidsetFastPropertyValue(int handle, Object value) Implementscom.sun.star.beans.XFastPropertySet.setFastPropertyValue.voidsetPropertyValue(String propertyName, Object value) Implementscom.sun.star.beans.XPropertySet.setPropertyValue.voidsetPropertyValues(PropertyValue[] props) Implementscom.sun.star.beans.XPropertyAccess.setPropertyValues.
- 
Constructor Details- 
PropertySetMixinpublic PropertySetMixin(XComponentContext context, XInterface object, Type type, String[] absentOptional) The constructor.- Parameters:
- context- the component context used by this instance; must not be null, and must supply the- com.sun.star.reflection.theCoreReflectionand- com.sun.star.reflection.theTypeDescriptionManagersingletons
- object- the client UNO object into which this instance is mixed in; must not be null, and must support the given- type
- type- the UNO interface type whose attributes are mapped to properties; must not be null, and must represent a UNO interface type
- absentOptional- a list of optional properties that are not present, and should thus not be visible via- com.sun.star.beans.XPropertySet.getPropertySetInfo,- com.sun.star.beans.XPropertySet.addPropertyChangeListener,- com.sun.star.beans.XPropertySet.removePropertyChangeListener,- com.sun.star.beans.XPropertySet.addVetoableChangeListener, and- com.sun.star.beans.XPropertySet.removeVetoableChangeListener; null is treated the same as an empty list; if non-null, the given array must not be modified after it is passed to this constructor. For consistency reasons, the given- absentOptionalshould only contain the names of attributes that represent optional properties that are not present (that is, the attribute getters and setters always throw a- com.sun.star.beans.UnknownPropertyException), and should contain each such name only once. If an optional property is not present (that is, the corresponding attribute getter and setter always throw a- com.sun.star.beans.UnknownPropertyException) but is not contained in the given- absentOptional, then it will be visible via- com.sun.star.beans.XPropertySet.getPropertySetInfoas a- com.sun.star.beans.Propertywith a set- com.sun.star.beans.PropertyAttribute.OPTIONAL. If the given- objectdoes not implement- com.sun.star.beans.XPropertySet, then the given- absentOptionalis effectively ignored and can be null or empty.
 
 
- 
- 
Method Details- 
prepareSetpublic void prepareSet(String propertyName, Object oldValue, Object newValue, PropertySetMixin.BoundListeners bound) throws PropertyVetoException A method used by clients when implementing UNO interface type attribute setter functions.First, this method checks whether this instance has already been disposed (see dispose()), and throws acom.sun.star.beans.DisposedExceptionif applicable. For a constrained attribute (whose setter can explicitly raisecom.sun.star.beans.PropertyVetoException), this method notifies anycom.sun.star.beans.XVetoableChangeListeners. For a bound attribute, this method modifies the passed-inboundso that it can afterwards be used to notify anycom.sun.star.beans.XPropertyChangeListeners. This method should be called before storing the new attribute value, andbound.notifyListeners()should be called exactly once after storing the new attribute value (in case the attribute is bound; otherwise, callingbound.notifyListeners()is ignored). Furthermore,bound.notifyListeners()and this method have to be called from the same thread.- Parameters:
- propertyName- the name of the property (which is the same as the name of the attribute that is going to be set)
- oldValue- the property value corresponding to the old attribute value. This is only used as- com.sun.star.beans.PropertyChangeEvent.OldValue, which is rather useless, anyway (see “Using the Observer Pattern” in OpenOffice.org Coding Guidelines). If the attribute that is going to be set is neither bound nor constrained, or if- com.sun.star.beans.PropertyChangeEvent.OldValueshould not be set,- Any.VOIDcan be used instead.
- newValue- the property value corresponding to the new attribute value. This is only used as- com.sun.star.beans.PropertyChangeEvent.NewValue, which is rather useless, anyway (see “Using the Observer Pattern” in OpenOffice.org Coding Guidelines), unless the attribute that is going to be set is constrained. If the attribute that is going to be set is neither bound nor constrained, or if it is only bound but- com.sun.star.beans.PropertyChangeEvent.NewValueshould not be set,- Any.VOIDcan be used instead.
- bound- a reference to a fresh- PropertySetMixin.BoundListenersinstance (which has not been passed to this method before, and on which- PropertySetMixin.BoundListeners.notifyListeners()has not yet been called); may only be null if the attribute that is going to be set is not bound
- Throws:
- PropertyVetoException- if a vetoable listener throws it.
 
- 
prepareSetA simplified version ofprepareSet(String, Object, Object, PropertySetMixin.BoundListeners).This method is useful for attributes that are not constrained. - Parameters:
- propertyName- the name of the property (which is the same as the name of the attribute that is going to be set)
- bound- a reference to a fresh- PropertySetMixin.BoundListenersinstance (which has not been passed to this method before, and on which- PropertySetMixin.BoundListeners.notifyListeners()has not yet been called); may only be null if the attribute that is going to be set is not bound
 
- 
disposepublic void dispose()Marks this instance as being disposed.See com.sun.star.lang.XComponentfor the general concept of disposing UNO objects. On the first call to this method, all registered listeners (com.sun.star.beans.XPropertyChangeListeners andcom.sun.star.beans.XVetoableChangeListeners) are notified of the disposing source. Any subsequent calls to this method are ignored.
- 
getPropertySetInfoImplementscom.sun.star.beans.XPropertySet.getPropertySetInfo.- Returns:
- See com.sun.star.beans.XPropertySet
 
- 
setPropertyValuepublic void setPropertyValue(String propertyName, Object value) throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.setPropertyValue.- Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- value- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- PropertyVetoException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
- IllegalArgumentException
 
- 
getPropertyValuepublic Object getPropertyValue(String propertyName) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.getPropertyValue.- Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- Returns:
- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
 
- 
addPropertyChangeListenerpublic void addPropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.addPropertyChangeListener.If a listener is added more than once, it will receive all relevant notifications multiple times. - Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- listener- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
 
- 
removePropertyChangeListenerpublic void removePropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.removePropertyChangeListener.- Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- listener- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
 
- 
addVetoableChangeListenerpublic void addVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.addVetoableChangeListener.If a listener is added more than once, it will receive all relevant notifications multiple times. - Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- listener- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
 
- 
removeVetoableChangeListenerpublic void removeVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XPropertySet.removeVetoableChangeListener.- Parameters:
- propertyName- See com.sun.star.beans.XPropertySet
- listener- See com.sun.star.beans.XPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertySet
- WrappedTargetException- See com.sun.star.beans.XPropertySet
 
- 
setFastPropertyValuepublic void setFastPropertyValue(int handle, Object value) throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException Implementscom.sun.star.beans.XFastPropertySet.setFastPropertyValue.- Parameters:
- handle- See com.sun.star.beans.XFastPropertySet
- value- See com.sun.star.beans.XFastPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XFastPropertySet
- PropertyVetoException- See com.sun.star.beans.XFastPropertySet
- WrappedTargetException- See com.sun.star.beans.XFastPropertySet
- IllegalArgumentException
 
- 
getFastPropertyValuepublic Object getFastPropertyValue(int handle) throws UnknownPropertyException, WrappedTargetException Implementscom.sun.star.beans.XFastPropertySet.getFastPropertyValue.- Parameters:
- handle- See com.sun.star.beans.XFastPropertySet
- Returns:
- See com.sun.star.beans.XFastPropertySet
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XFastPropertySet
- WrappedTargetException- See com.sun.star.beans.XFastPropertySet
 
- 
getPropertyValuesImplementscom.sun.star.beans.XPropertyAccess.getPropertyValues.- Returns:
- See com.sun.star.beans.XPropertyAccess
 
- 
setPropertyValuespublic void setPropertyValues(PropertyValue[] props) throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException Implementscom.sun.star.beans.XPropertyAccess.setPropertyValues.- Parameters:
- props- See com.sun.star.beans.XPropertyAccess
- Throws:
- UnknownPropertyException- See com.sun.star.beans.XPropertyAccess
- PropertyVetoException- See com.sun.star.beans.XPropertyAccess
- WrappedTargetException- See com.sun.star.beans.XPropertyAccess
- IllegalArgumentException
 
 
-