IssueZilla 10518: Add BeanShell support
This commit is contained in:
@@ -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
|
||||
|
@@ -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"/>
|
||||
|
@@ -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();
|
@@ -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
|
||||
|
Reference in New Issue
Block a user