office-gobmx/scripting/examples/java/HelloWorld/HelloWorld.java
Vladimir Glazounov a63d7fc4d9 INTEGRATION: CWS scriptingf9 (1.1.2); FILE ADDED
2004/11/23 17:28:06 toconnor 1.1.2.1: #i36937# clean up structure of Java examples
2004-12-23 10:48:08 +00:00

22 lines
623 B
Java

import com.sun.star.script.provider.XScriptContext;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
/**
* HelloWorld class
*
*/
public class HelloWorld {
public static void printHW(XScriptContext xSc) {
// getting the text document object
XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, xSc.getDocument());
XText xText = xtextdocument.getText();
XTextRange xTextRange = xText.getEnd();
xTextRange.setString( "Hello World (in Java)" );
}// printHW
}