(incubating) | The Free and Open Productivity Suite
Announcing Apache OpenOffice 3.4

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous

Content for OpenOffice.org version 3.3.

:: com :: sun :: star :: text ::

interface XDependentTextField
Base Interfaces
XDependentTextFieldXTextFieldXTextContent
      ┗ ::com::sun::star::lang::XComponent

XTextField
(referenced interface's summary:)
is the base interface for all text fields.
Description
makes it possible to attach this TextField to a TextFieldMaster.

Methods' Summary
attachTextFieldMaster method must be called to attach the TextFieldMaster to this TextField.  
getTextFieldMaster  
Methods' Details
attachTextFieldMaster
void
attachTextFieldMaster( [in] ::com::sun::star::beans::XPropertySet  xFieldMaster )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
method must be called to attach the TextFieldMaster to this TextField.

A TextFieldMaster can only be assigned once.

Example
Create and insert a user field (with a UserField):
 // Create a fieldmaster for our newly created User Text field, and access it's
 // XPropertySet interface
 XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface( 
 XPropertySet.class, mxDocFactory.createInstance(
 "com.sun.star.text.FieldMaster.User"));
 // Set the name and value of the FieldMaster
 xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
 xMasterPropSet.setPropertyValue ("Value", new Integer(42));
 // Attach the field master to the user field
 xUserField.attachTextFieldMaster (xMasterPropSet);
 // Move the cursor to the end of the document
 mxDocCursor.gotoEnd(false);
 // insert a paragraph break using the XSimpleText interface
 mxDocText.insertControlCharacter(
 mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
 // Insert the user field at the end of the document
 mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);
 
getTextFieldMaster
::com::sun::star::beans::XPropertySet
getTextFieldMaster();

Returns
the previously attached TextFieldMaster
Top of Page

Apache Feather

Copyright & License | Privacy | Contact Us

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

Apache OpenOffice is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.