diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2004-12-23 10:48:08 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2004-12-23 10:48:08 +0000 |
commit | a63d7fc4d982ce7064e687f64adffba71c42612c (patch) | |
tree | 8b4925917cec72841af61f53c75d42e159778035 | |
parent | c6fefe04901a83cc96d86f1d41e79843e96e002e (diff) |
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
-rw-r--r-- | scripting/examples/java/HelloWorld/HelloWorld.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripting/examples/java/HelloWorld/HelloWorld.java b/scripting/examples/java/HelloWorld/HelloWorld.java new file mode 100644 index 000000000000..eaed56fc6063 --- /dev/null +++ b/scripting/examples/java/HelloWorld/HelloWorld.java @@ -0,0 +1,22 @@ +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 + +} |