Update ooo320-m1
[ooovba.git] / scripting / examples / java / HelloWorld / HelloWorld.java
blobeaed56fc6063e145e85365b35b0df9a5a6d98e83
1 import com.sun.star.script.provider.XScriptContext;
2 import com.sun.star.uno.UnoRuntime;
3 import com.sun.star.text.XTextDocument;
4 import com.sun.star.text.XTextRange;
5 import com.sun.star.text.XText;
6 /**
7 * HelloWorld class
9 */
10 public class HelloWorld {
11 public static void printHW(XScriptContext xSc) {
13 // getting the text document object
14 XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface(
15 XTextDocument.class, xSc.getDocument());
16 XText xText = xtextdocument.getText();
17 XTextRange xTextRange = xText.getEnd();
18 xTextRange.setString( "Hello World (in Java)" );
20 }// printHW