Top > OOo > Ext > MRI > Documentation > Methods

Methods Edit

methods-window.png

Looking at Method Informations Edit

An example of methods information is shown like a list below.

Method Name       Arguments                     Return Type     Exceptions
getName           ()                            string 
supportsService   ( [in] string ServiceName )   boolean    

getName is called with no arguments and returns string type value. And supportsService method needs a string type argument and its type of returned value is boolean.

You can invoke a method by double clicking the line that it is indicated. But some methods need one or more arguments and it is difficult to pass arguments from MRI to methods . Therefore many methods can not be called. But few important methods can be called from current version of MRI.

You want to open IDL Reference written about a method you want to see, click the line (don't have to select hole line only carret position is used to get which method is selected) and push ref button.

Calling Special Methods Edit

getByIndex Edit

Sometimes objects are collected into com.sun.star.container.XIndexContainer and we can get an element from it using com.sun.star.container.XIndexAccess interface. When you call getByIndex method through MRI, MRI calls getCount method to get the number of items in the XIndexContainer and let user select an index you want to get a value before invoking getByIndex method.

Select an item listed in the dialog is shown when you call getByIndex method of the target. MRI uses selected item as the argument to invoke getByIndex method. If a container with no element, empty listbox is shown.

getByName Edit

com.sun.star.container.XNameContainer is used to manage elements and getByName method availabled from com.sun.star.container.XNameAccess is used to get an element from its container. MRI calls getElementNames method to make user select a name of element. Select an item listed in the listbox on the dialog. MRI uses the selected item to call getByName method. If no elements are there in a container, empty listbox is shown.

Calling Methods with Arguments Edit

MRI can call a method that needs only numerical, string or boolean type arguments. For example, these methods can be called.

getCellByPosition( [in] long nColumn, [in] long nRow )
setName( [in] string aName )
goRight( [in] short nCount, [in] boolean bExpand )

But these methods can not be called because arguments are structs or interfaces.

insertDocumentFromURL( [in] string aURL, [in] [].beans.PropertyValue aOptions )
findAll( [in] .util.XSearchDescriptor xDesc )

When you call a method taking only numerical, string or boolean type arguments, the dialog box is shown and input arguments. The arguments are separated by commas if two or more arguments are needed. You have to keep the number of arguments and order of arguments that is displayed on the input dialog. You can not include "," (comma) in a string type value.

methods-input.png

You can open your IDL Reference to push the Ref. button on the dialog.


Attach file: filemethods-window.png 306 download [Information] filemethods-input.png 309 download [Information]

Reload   New Lower page making Edit Freeze Diff Upload Copy Rename   Front page List of pages Search Recent changes Backup   Help   RSS of recent changes