Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: awt ::

interface XItemList
Description
provides convenient access to the list of items in a list box

Methods' Summary
insertItem inserts a new item into the list  
insertItemText inserts an item which has only a text, but no image  
insertItemImage inserts an item which has only an image, but no text  
removeItem removes an item from the list  
removeAllItems removes all items from the list  
setItemText sets a new text for an existing item  
setItemImage sets a new image for an existing item  
setItemTextAndImage sets both a new position and text for an existing item  
setItemData associates an implementation dependend value with the given list item.  
getItemText retrieves the text of an existing item  
getItemImage retrieves the URL of the image of an existing item  
getItemTextAndImage retrieves both the text and the image URL of an existing item  
getItemData retrieves the implementation dependend value associated with the given list item.  
getAllItems retrieves the texts and images of all items in the list  
addItemListListener registers a listener which is notified about changes in the item list.  
removeItemListListener revokes a listener which is notified about changes in the item list.  
Attributes' Summary
ItemCount is the number of items in the list  
Methods' Details
insertItem
void
insertItem( [in] long  Position,
[in] string  ItemText,
[in] string  ItemImageURL )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
inserts a new item into the list
Parameter Position
the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
Parameter ItemText
the text of the item to be inserted.
Parameter ItemImageURL
the URL of the image to display for the item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
insertItemText
void
insertItemText( [in] long  Position,
[in] string  ItemText )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
inserts an item which has only a text, but no image
Parameter Position
the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
Parameter ItemText
the text of the item to be inserted.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
insertItemImage
void
insertItemImage( [in] long  Position,
[in] string  ItemImageURL )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
inserts an item which has only an image, but no text
Parameter Position
the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
Parameter ItemImageURL
the URL of the image to display for the item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
removeItem
void
removeItem( [in] long  Position )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
removes an item from the list
Parameter Position
the position of the item which should be removed. Must be greater or equal to 0, and lesser than ItemCount.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
removeAllItems
void
removeAllItems();

Description
removes all items from the list
setItemText
void
setItemText( [in] long  Position,
[in] string  ItemText )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
sets a new text for an existing item
Parameter Position
the position of the item whose text is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
Parameter ItemText
the new text of the item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
setItemImage
void
setItemImage( [in] long  Position,
[in] string  ItemImageURL )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
sets a new image for an existing item
Parameter Position
the position of the item whose image is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
Parameter ItemImageURL
the new URL of the image to display for the item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
setItemTextAndImage
void
setItemTextAndImage( [in] long  Position,
[in] string  ItemText,
[in] string  ItemImageURL )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
sets both a new position and text for an existing item
Parameter Position
the position of the item whose text and image is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
Parameter ItemText
the new text of the item
Parameter ItemImageURL
the new URL of the image to display for the item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
setItemData
void
setItemData( [in] long  Position,
[in] any  ItemData )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
associates an implementation dependend value with the given list item.

You can use this to store data for an item which does not interfere with the displayed text and image, but can be used by the client of the list box for an arbitrary purpose.

Parameter Position
the position of the item whose data value should be set. Must be greater or equal to 0, and lesser than ItemCount.
Parameter ItemData
the data to associate with the list item
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
See also
getItemData
getItemText
string
getItemText( [in] long  Position )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
retrieves the text of an existing item
Parameter Position
the position of the item whose text should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
getItemImage
string
getItemImage( [in] long  Position )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
retrieves the URL of the image of an existing item
Parameter Position
the position of the item whose image should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
getItemTextAndImage
::com::sun::star::beans::Pair< string, string >
getItemTextAndImage( [in] long  Position )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
retrieves both the text and the image URL of an existing item
Parameter Position
the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
getItemData
any
getItemData( [in] long  Position )
raises( ::com::sun::star::lang::IndexOutOfBoundsException );

Description
retrieves the implementation dependend value associated with the given list item.
Parameter Position
the position of the item whose data value should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.
Throws
::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid.
See also
setItemData, setItemData
getAllItems
sequence< ::com::sun::star::beans::Pair< string, string > >
getAllItems();

Description
retrieves the texts and images of all items in the list
addItemListListener
void
addItemListListener( [in] XItemListListener  Listener );

Description
registers a listener which is notified about changes in the item list.
removeItemListListener
void
removeItemListListener( [in] XItemListListener  Listener );

Description
revokes a listener which is notified about changes in the item list.
Attributes' Details
ItemCount
[ readonly ] long ItemCount;
Description
is the number of items in the list
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.