<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 1910: JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/</link><description>Recent changes to 1910: JavaMacros plugin</description><atom:link href="https://sourceforge.net/p/jedit/plugin-bugs/1910/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 26 May 2020 05:29:18 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/jedit/plugin-bugs/1910/feed.rss" rel="self" type="application/rss+xml"/><item><title>#1910 JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/?limit=25#0bc6/650c/75a6/f1c3</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks. I got it.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ruanjiaxing</dc:creator><pubDate>Tue, 26 May 2020 05:29:18 -0000</pubDate><guid>https://sourceforge.net07e45d451819b891dd409ddf4c1439700844a512</guid></item><item><title>#1910 JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/?limit=25#0bc6/650c/75a6</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Probably not. The idea of a macro is something small, quick, and not very complicated. If you need more than that, as in multiple classes in a jar file, then you probably need a plugin, which is packaged in a jar file.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dale Anson</dc:creator><pubDate>Mon, 25 May 2020 18:30:44 -0000</pubDate><guid>https://sourceforge.netd67b9f51f78c855a4f0fea59f99847a280736517</guid></item><item><title>#1910 JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/?limit=25#0bc6/650c</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you. Your example worked. Could you extend the plugin so it would run a jar file and not just a .class file? I found .class file is a bit inconvenient. I also don't understand why the author didn't start with jar file from the beginning but chose .class file instead.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ruanjiaxing</dc:creator><pubDate>Mon, 25 May 2020 16:08:18 -0000</pubDate><guid>https://sourceforge.net27160582f98417d04c6c921da26ce33a26890842</guid></item><item><title>#1910 JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/?limit=25#eaa5</link><description>&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;assigned_to&lt;/strong&gt;: Dale Anson&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Group&lt;/strong&gt;:  --&amp;gt; &lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dale Anson</dc:creator><pubDate>Sun, 24 May 2020 19:41:34 -0000</pubDate><guid>https://sourceforge.netf9f987deef0dc62bfe7ee454bd25599f303ce645</guid></item><item><title>#1910 JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/?limit=25#0bc6</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Well, you're right, the documentation is poor. However, the plugin does work as advertised, but it's a little unusual. Here's a working example, more or less from the JavaMacro code itself, which would have been in the javadoc if the javadoc had actually been included with the plugin:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;macros&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javamacros.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.gjt.sp.jedit.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.gjt.sp.jedit.textarea.JEditTextArea&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hello_World&lt;/span&gt; &lt;span class="n"&gt;implements&lt;/span&gt; &lt;span class="n"&gt;MacroClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;Buffer&lt;/span&gt; &lt;span class="nb"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;View&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Macros&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Macro&lt;/span&gt; &lt;span class="n"&gt;macro&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;JEditTextArea&lt;/span&gt; &lt;span class="n"&gt;textArea&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;throws&lt;/span&gt; &lt;span class="ne"&gt;Exception&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Macros&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Hello World!"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Put this in a directory named "macros". Compile it like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;javac&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cp&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;JavaMacros&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;jedit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt; &lt;span class="n"&gt;macros&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Hello_World&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Copy the resulting .class file to your jEdit settings directory/macros. &lt;/p&gt;
&lt;p&gt;Now the unusual part, the JavaMacros.jar file needs to be added to the classpath that you use to start jEdit. I start jEdit from a shell script, so my start up line looks like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Xmx620m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Xms512m&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ANTIALIAS_ALL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="s"&gt;"-Djedit.home=$JEDIT_HOME"&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cp&lt;/span&gt; &lt;span class="o"&gt;~/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jedit&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;jars&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;JavaMacros&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt; &lt;span class="s"&gt;"$JEDIT_HOME/jedit.jar"&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;reuseview&lt;/span&gt; &lt;span class="s"&gt;"$@"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So restart jEdit with the JavaMacros.jar in the classpath, and you should see "Hello World" in the Macros menu, and clicking it show a message box saying "Hello World". &lt;/p&gt;
&lt;p&gt;The plugin code does need some updating, the build file doesn't work out of the box anymore and as you mentioned, the documentation is poor and the javadoc is missing altogether. I'll see if I can find time to fix those issues. I'd like to see if there is a way so that the JavaMacros.jar doesn't have to be included in jEdit's start up classpath for the macros to work, that's a significant barrier to user adoption of this plugin.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dale Anson</dc:creator><pubDate>Sun, 24 May 2020 19:41:07 -0000</pubDate><guid>https://sourceforge.net2fd60a429fa967644665306234d3bef506a4bafe</guid></item><item><title>JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Said plugin's document is very poor. They said the Java doc will contains more information about how to write macro using Java and compiled to class bytecode and run this .class as JEdit macro. But the Jar file JavaMacros.jar contains no Java doc at all. I have no idea how to use it and it seemed the plugin is no longer updated. Please consider updating it or just remove it and clearly state that bytecode .class file currently can't be run as JEdit macro and you can't write JEdit macro in Java so other people know that it is currently impossible and they would have a look to implement an actual working solution. Thanks.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ruanjiaxing</dc:creator><pubDate>Sun, 24 May 2020 14:30:12 -0000</pubDate><guid>https://sourceforge.netb2869a40beb034a20cd368b9b275c335f2be4499</guid></item><item><title>JavaMacros plugin</title><link>https://sourceforge.net/p/jedit/plugin-bugs/1910/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Ticket 1910 has been modified: JavaMacros plugin&lt;br/&gt;
Edited By: Dale Anson (daleanson)&lt;br/&gt;
Owner updated: None =&amp;gt; u'daleanson'&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ruanjiaxing</dc:creator><pubDate>Sun, 24 May 2020 14:30:12 -0000</pubDate><guid>https://sourceforge.netdb730ce784a74ff555197383b5fb2e2c6b5d13b1</guid></item></channel></rss>