summaryrefslogtreecommitdiffstats
path: root/scripting/examples/javascript
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-02-10 15:09:29 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-02-10 15:09:29 +0000
commitd97aa7d8090058b43b15099903da1667f62cec36 (patch)
treea87dd1f1de7b9fa28470ecffb5fb539ac464c0a9 /scripting/examples/javascript
parentINTEGRATION: CWS scriptingf3 (1.1.2); FILE ADDED (diff)
downloadcore-d97aa7d8090058b43b15099903da1667f62cec36.tar.gz
core-d97aa7d8090058b43b15099903da1667f62cec36.zip
INTEGRATION: CWS scriptingf3 (1.1.2); FILE ADDED
2004/01/22 10:55:43 dfoster 1.1.2.1: #i23683# Add examples scripts in all languages
Diffstat (limited to 'scripting/examples/javascript')
-rw-r--r--scripting/examples/javascript/HelloWorld/helloworld.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripting/examples/javascript/HelloWorld/helloworld.js b/scripting/examples/javascript/HelloWorld/helloworld.js
new file mode 100644
index 000000000000..5fb8de33e2a4
--- /dev/null
+++ b/scripting/examples/javascript/HelloWorld/helloworld.js
@@ -0,0 +1,11 @@
+// Hello World in JavaScript
+importClass(Packages.com.sun.star.uno.UnoRuntime);
+importClass(Packages.com.sun.star.text.XTextDocument);
+importClass(Packages.com.sun.star.text.XText);
+importClass(Packages.com.sun.star.text.XTextRange);
+
+oDoc = XSCRIPTCONTEXT.getDocument();
+xTextDoc = UnoRuntime.queryInterface(XTextDocument,oDoc);
+xText = xTextDoc.getText();
+xTextRange = xText.getEnd();
+xTextRange.setString( "Hello World (in JavaScript)" );