Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: beans ::

interface XPropertySet
Description
provides information about and access to the properties from an implementation.

There are three types of properties:

  • bound properties
  • constrained properties
  • free properties

You can listen to changes of bound properties with the XPropertyChangeListener and you can veto changes of constrained properties with the XVetoableChangeListener.

To implement inaccurate name access, you must support the interface XExactName.

See also
XExactName
Developers Guide
FirstSteps - Using Services - Using Properties
ProUNO - Properties

Methods' Summary
getPropertySetInfo  
setPropertyValue sets the value of the property with the specified name.  
getPropertyValue  
addPropertyChangeListener adds an XPropertyChangeListener to the specified property.  
removePropertyChangeListener removes an XPropertyChangeListener from the listener list.  
addVetoableChangeListener adds an XVetoableChangeListener to the specified property with the name PropertyName.  
removeVetoableChangeListener removes an XVetoableChangeListener from the listener list.  
Methods' Details
getPropertySetInfo
XPropertySetInfo
getPropertySetInfo();

Returns
the XPropertySetInfo interface, which describes all properties of the object which supplies this interface.
Returns
NULL if the implementation cannot or will not provide information about the properties; otherwise the interface XPropertySetInfo is returned.
setPropertyValue
void
setPropertyValue( [in] string  aPropertyName,
[in] any  aValue )
raises( UnknownPropertyException,
PropertyVetoException,
::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::WrappedTargetException );

Description
sets the value of the property with the specified name.

If it is a bound property the value will be changed before the change event is fired. If it is a constrained property a vetoable event is fired before the property value can be changed.

Throws
com::sun::star::beans::PropertyVetoException if the property is read-only or vetoable and one of the listeners throws this exception because of an unaccepted new value.
getPropertyValue
any
getPropertyValue( [in] string  PropertyName )
raises( UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException );

Returns
the value of the property with the specified name.
Parameter PropertyName
This parameter specifies the name of the property.
Throws
UnknownPropertyException if the property does not exist.
Throws
com::sun::star::lang::WrappedTargetException if the implementation has an internal reason for the exception. In this case the original exception is wrapped into that ::com::sun::star::lang::WrappedTargetException.
addPropertyChangeListener
void
addPropertyChangeListener( [in] string  aPropertyName,
[in] XPropertyChangeListener  xListener )
raises( UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException );

Description
adds an XPropertyChangeListener to the specified property.

An empty name ("") registers the listener to all bound properties. If the property is not bound, the behavior is not specified.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

See also
removePropertyChangeListener
removePropertyChangeListener
void
removePropertyChangeListener( [in] string  aPropertyName,
[in] XPropertyChangeListener  aListener )
raises( UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException );

Description
removes an XPropertyChangeListener from the listener list.

It is a "noop" if the listener is not registered.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

See also
addPropertyChangeListener
addVetoableChangeListener
void
addVetoableChangeListener( [in] string  PropertyName,
[in] XVetoableChangeListener  aListener )
raises( UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException );

Description
adds an XVetoableChangeListener to the specified property with the name PropertyName.

An empty name ("") registers the listener to all constrained properties. If the property is not constrained, the behavior is not specified.

See also
removeVetoableChangeListener
removeVetoableChangeListener
void
removeVetoableChangeListener( [in] string  PropertyName,
[in] XVetoableChangeListener  aListener )
raises( UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException );

Description
removes an XVetoableChangeListener from the listener list.

It is a "noop" if the listener is not registered.

See also
addVetoableChangeListener
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.