if(placeholderType < 0 || placeholderType > 4)
throw new TextException("The placeholder type must be one of the valid static members of com.sun.star.text.PlaceholderType.");
XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, textDocument.getXTextDocument());
Object textField = xMultiServiceFactory.createInstance(ITextFieldService.PLACEHOLDER_TEXTFIELD_ID);
XTextField xTextField = (XTextField)UnoRuntime.queryInterface(XTextField.class, textField);
XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xTextField);
// Grundeinstellung festlegen
xPropertySet.setPropertyValue("PlaceHolder", name);