Hi James,

On Tue, Aug 02, 2005 at 10:37:59 -0400, James Black wrote:

> I am curious if it is possible in my Java program to set a cell to be a
> select box of some sort, so that the user will have one of 4 choices to
> make, and I don't have to rely on their ability to spell correctly.

It is possible, though it lacks some documentation.. use the
sheet::TableValidation service, see
http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/TableValidation.html

and the part of the Developers Guide it is referring for how to obtain
the Validation object as a property of the CellRange. At the
TableValidation set the Type property to ValidationType::LIST, and at
the XSheetCondition interface call setFormula1() with a string object
consisting of either a range ``A1:A4'' or a named range ``name'' or
a string list ``"value1";"value2";"value3";"value4"'', the single quotes
here of course are only present to illustrate the entire formula
string's boundaries and are not part of the formula string itself..
Then apply the Validation object as property to the CellRange's property
set as lined out in the Developers Guide's sample.

Btw, for questions regarding API usage we've setup a separate mailing
list, [email protected], where many API programmers are subscribed,
better to use that instead of the core dev list here.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter bedevilled I18N transpositionizer.
 GnuPG key 0x293C05FD:  997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to