Kaydet (Commit) 0b9fda25 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

fdo#46102: Fix Java script examples after gbuild'ification

...they contained no class files anymore, due to missing gb_Jar_set_packageroot
calls.  However, those calls only work for subdirectories, i.e., the example
.java files need to be put into a package (I chose
org.libreoffice.example.java_scripts) for all of them).  This in turn required
adaption of the parcel-descriptor.xml files; not sure what the logicalname
entries there are good for if anything -- the macro names at "Tools - Macros -
Run Macro..." now unfortunately(?) contain the fully qualified paths for the
HelloWorld, HighlightText, and MemoryUpdate examples.  There are additional
examples at scripting/examples/java/ that apparently do not get packaged (but I
adapted them anyway).
üst dd6c4f4d
...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,HelloWorld,\ ...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,HelloWorld,\
scripting/examples/java/HelloWorld/HelloWorld \ scripting/examples/java/HelloWorld/HelloWorld \
)) ))
$(eval $(call gb_Jar_set_packageroot,HelloWorld,org))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,Highlight,\ ...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,Highlight,\
scripting/examples/java/Highlight/HighlightText \ scripting/examples/java/Highlight/HighlightText \
)) ))
$(eval $(call gb_Jar_set_packageroot,Highlight,org))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,MemoryUsage,\ ...@@ -39,4 +39,6 @@ $(eval $(call gb_Jar_add_sourcefiles,MemoryUsage,\
scripting/examples/java/MemoryUsage/MemoryUsage \ scripting/examples/java/MemoryUsage/MemoryUsage \
)) ))
$(eval $(call gb_Jar_set_packageroot,MemoryUsage,org))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
package org.libreoffice.example.java_scripts;
import com.sun.star.script.provider.XScriptContext; import com.sun.star.script.provider.XScriptContext;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextDocument;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Prints "Helo World". Prints "Helo World".
</description> </description>
</locale> </locale>
<functionname value="HelloWorld.printHW"/> <functionname value="org.libreoffice.example.java_scripts.HelloWorld.printHW"/>
<logicalname value="HelloWorld.printHW"/> <logicalname value="HelloWorld.printHW"/>
<languagedepprops> <languagedepprops>
<prop name="classpath" value="HelloWorld.jar"/> <prop name="classpath" value="HelloWorld.jar"/>
......
package org.libreoffice.example.java_scripts;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.script.provider.XScriptContext; import com.sun.star.script.provider.XScriptContext;
import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiComponentFactory;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Text highlighting Text highlighting
</description> </description>
</locale> </locale>
<functionname value="HighlightText.showForm"/> <functionname value="org.libreoffice.example.java_scripts.HighlightText.showForm"/>
<logicalname value="HighlightText.showForm"/> <logicalname value="HighlightText.showForm"/>
<languagedepprops> <languagedepprops>
<prop name="classpath" value="Highlight.jar"/> <prop name="classpath" value="Highlight.jar"/>
......
package org.libreoffice.example.java_scripts;
import java.util.Random; import java.util.Random;
import java.util.Date; import java.util.Date;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Text highlighting Text highlighting
</description> </description>
</locale> </locale>
<functionname value="MemoryUsage.updateMemoryUsage"/> <functionname value="org.libreoffice.example.java_scripts.MemoryUsage.updateMemoryUsage"/>
<logicalname value="MemoryUtils.MemUsage"/> <logicalname value="MemoryUtils.MemUsage"/>
<languagedepprops> <languagedepprops>
<prop name="classpath" value="MemoryUsage.jar"/> <prop name="classpath" value="MemoryUsage.jar"/>
......
package org.libreoffice.example.java_scripts;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.XComponentContext; import com.sun.star.uno.XComponentContext;
......
package org.libreoffice.example.java_scripts;
public class NewsGroup public class NewsGroup
{ {
......
package org.libreoffice.example.java_scripts;
//import com.sun.star.frame.XComponentLoader; //import com.sun.star.frame.XComponentLoader;
import java.io.*; import java.io.*;
import com.sun.star.lang.XComponent; import com.sun.star.lang.XComponent;
......
package org.libreoffice.example.java_scripts;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
......
package org.libreoffice.example.java_scripts;
import javax.mail.*; import javax.mail.*;
import javax.mail.internet.*; import javax.mail.internet.*;
import com.msoft.mail.provider.nntp.NNTPTransport; import com.msoft.mail.provider.nntp.NNTPTransport;
......
package org.libreoffice.example.java_scripts;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
......
package org.libreoffice.example.java_scripts;
import java.io.*; import java.io.*;
import java.util.Vector; import java.util.Vector;
......
package org.libreoffice.example.java_scripts;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.io.IOException; import java.io.IOException;
......
package org.libreoffice.example.java_scripts;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.JPanel; import javax.swing.JPanel;
......
package org.libreoffice.example.java_scripts;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.io.InputStream; import java.io.InputStream;
......
package org.libreoffice.example.java_scripts;
import java.io.InputStream; import java.io.InputStream;
import drafts.com.sun.star.script.framework.runtime.XScriptContext; import drafts.com.sun.star.script.framework.runtime.XScriptContext;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<description>Script that starts debuggers for JavaScript and BeanShell <description>Script that starts debuggers for JavaScript and BeanShell
</description> </description>
</locale> </locale>
<logicalname value="_$DebugRunner.Debug" /> <logicalname value="org.libreoffice.example.java_scripts._$DebugRunner.Debug" />
<functionname value="DebugRunner.go" /> <functionname value="DebugRunner.go" />
<languagedepprops> <languagedepprops>
<prop name="classpath" value="debugger.jar"/> <prop name="classpath" value="debugger.jar"/>
......
package org.libreoffice.example.java_scripts;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.*; import javax.swing.tree.*;
import javax.swing.table.*; import javax.swing.table.*;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Prototype Script Selector GUI for StarOffice Prototype Script Selector GUI for StarOffice
</description> </description>
</locale> </locale>
<functionname value="ScriptSelector.showOrganizer"/> <functionname value="org.libreoffice.example.java_scripts.ScriptSelector.showOrganizer"/>
<logicalname value="ScriptSelector.showOrganizer"/> <logicalname value="ScriptSelector.showOrganizer"/>
<languagedepprops> <languagedepprops>
<prop name="classpath" value="selector.jar"/> <prop name="classpath" value="selector.jar"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment