a63d7fc4d9
2004/11/23 17:28:06 toconnor 1.1.2.1: #i36937# clean up structure of Java examples
22 lines
623 B
Java
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
|
|
|
|
}
|