NetBeans Plugin

If you think LogMX needs a new useful feature!
Post Reply
GIngleby
Posts: 3
Joined: Tue Aug 23, 2016 12:55 am

NetBeans Plugin

Post by GIngleby »

I'd really like a NetBeans plugin similar to the Eclipse/IntelliJ IDEA ones.

If the protocol was publicly documented I'd be willing to take a stab at creating one.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: NetBeans Plugin

Post by admin »

Hello,

Thank you for your idea and for your help! :)
It is not publicly documented at this time but we could easily do so: since the IDE plugin only has to use our tiny library "logmx-goto-source.jar" (included in the "lib" directory of LogMX), we will just have to make its Javadoc public. The protocol is very easy: the IDE plugin listens to a TCP socket and receives strings like:

Code: Select all

cmd="test|goto|preview" [method="<method>" file="<file>" line="-1|<line>"]
Only the "test" and "preview" commands (i.e. requests) expect an answer from the IDE:
  • the "ok" string for "test" command (used by LogMX configuration dialog),
  • the source code excerpt for "preview" command.
I will let you know when the documentation is released.

Xavier
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: NetBeans Plugin

Post by admin »

Hello,

Here is the documented API for the required library (<LogMXDir>/lib/logmx-goto-source.jar): http://logmx.com/dev/ide-plugins/api
For your convenience, here is also a downloadable version:
api.zip
(97.65 KiB) Downloaded 409 times
Please let me know if you have any question or trouble.

Xavier
GIngleby
Posts: 3
Joined: Tue Aug 23, 2016 12:55 am

Re: NetBeans Plugin

Post by GIngleby »

Thanks so much - I'll see what I can do.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: NetBeans Plugin

Post by admin »

Sorry, I forgot to give you the first steps:
  1. Create an implementation of PluginLogger in order to allow the plug-in to log messages using IDE log system
  2. Create an implementation of GotoSourceManager in order to allow the plug-in to get source file excerpts and to open source files in the IDE
  3. Write some code that can read/write a PluginConfig using the IDE persistence/settings mechanism
  4. When the plug-in is activated (i.e. when the IDE starts it) do something similar to:

    Code: Select all

                PluginConfig config = new PluginConfig(...);
                GotoSourceManager srcMgr = ...
                PluginLogger logger = ...
                SocketListener sockListener = SocketListener.getInstance(srcMgr, logger);
                sockListener.setConfig(config);
                sockListener.stop(); // just in case the IDE calls this code several times
                if (config.isEnabled()) {
                    sockListener.start();
                }
    
GIngleby
Posts: 3
Joined: Tue Aug 23, 2016 12:55 am

Re: NetBeans Plugin

Post by GIngleby »

Thanks - that made things super easy! I've posted my first creation on GitHub if you'd like to take a look at it. https://github.com/GIngleby16/LogMXNetBeans

It's not officially signed or published anywhere yet so you'll have to manually install it - instructions are in the WIKI.

If you want to create an official LightySoft branded plugin feel free to use my code as a starting point.

Let me know if there are an licensing concerns I need to address.

Thanks again for sharing this API. I can now jump to code in my preferred IDE! :D

-Graeme
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: NetBeans Plugin

Post by admin »

Amazing! Thanks!
We will study this repo in order to make an official plug-in to include in the next releases :D (if you are OK with that of course).

Please send me an e-mail at support@logmx.com (subject "NetBeans Plugin") so that you we can setup the way we make it official (like for example the contact info that you want to appear in the "about" section, if any).

Xavier
Post Reply