IssueZilla 10518: Add BeanShell support

This commit is contained in:
Tomas O'Connor
2003-01-16 16:59:11 +00:00
parent 7e83a71ea3
commit fa40dc57cd
4 changed files with 46 additions and 7 deletions

View File

@@ -16,5 +16,8 @@ PROP_OfficeDirectory=Office Installation Directory
HINT_OfficeDirectory=Path to directory where Office is installed
Templates/OfficeScripting/Parcel=Parcel Recipe
Templates/OfficeScripting/EmptyScript=Empty Script
Templates/OfficeScripting/EmptyScript/Empty.java=Java Script
Templates/OfficeScripting/EmptyScript/Empty.bsh=BeanShell Script
Menu/Help/office-scripting.url=&Office Scripting Framework Site

View File

@@ -3,6 +3,7 @@
<filesystem>
<folder name="Templates">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/>
<folder name="OfficeScripting">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/>
<folder name="Parcel">
@@ -13,9 +14,21 @@
<attr name="templateWizardIterator" newvalue="org.openoffice.netbeans.modules.office.wizard.ParcelContentsIterator"/>
<folder name="Contents">
<file name="parcel-descriptor.xml" url="templates/EmptyParcelDescriptor.xml_"/>
<file name="Empty.java" url="templates/Empty.java_"/>
<!-- file name="Empty.java" url="templates/Empty.java_"/ -->
</folder>
</folder>
<folder name="EmptyScript">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/>
<file name="Empty.java" url="templates/Empty.java_">
<attr name="template" boolvalue="true"/>
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/>
<attr name="templateWizardIterator" newvalue="org.openoffice.netbeans.modules.office.wizard.JavaScriptIterator"/>
</file>
<file name="Empty.bsh" url="templates/Empty.bsh_">
<attr name="template" boolvalue="true"/>
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/>
</file>
</folder>
</folder>
<attr boolvalue="true" name="Ant/OfficeScripting"/>
<attr boolvalue="true" name="OfficeScripting/Other"/>

View File

@@ -0,0 +1,24 @@
// If using XComponentContext need to uncomment import directive below:
// import com.sun.star.uno.XComponentContext;
// If using XDesktop need to uncomment import directive below:
// import com.sun.star.frame.XDesktop;
// If using XComponent need to uncomment import directive below:
// import com.sun.star.frame.XModel;
import drafts.com.sun.star.script.framework.XScriptContext;
/* Use the XScriptContext variable "context" to access the document for
which this script was invoked. This variable will be initialised
automatically by the Scripting Framework when the script is invoked.
Methods available are:
context.getDocument() returns XModel
context.getDesktop() returns XDesktop
context.getComponentContext() returns XComponentContext
*/
// Uncomment to get the current document model
// xmodel = context.getDocument();

View File

@@ -1,15 +1,14 @@
// If using XMultiServiceFactory need to uncomment import directive below:
//import com.sun.star.lang.XMultiServiceFactory;
// If using XComponentContext need to uncomment import directive below:
// import com.sun.star.uno.XComponentContext;
// If using XDesktop need to uncomment import directive below:
//import com.sun.star.frame.XDesktop;
// import com.sun.star.frame.XDesktop;
// If using XComponent need to uncomment import directive below:
//import com.sun.star.lang.XComponent;
// import com.sun.star.frame.XModel;
import drafts.com.sun.star.script.framework.XScriptContext;
public class Empty {
public void doMethod(XScriptContext xSc) {
@@ -17,7 +16,7 @@ public class Empty {
/* Methods available from XScriptContext:
xSc.getDocument() returns XModel
xSc.getDesktop() returns XDesktop
xSc.getMultiComponentFactory() returns XMultiComponentFactory
xSc.getComponentContext() returns XComponentContext
*/
// Uncomment to get the current document as a component