Skip to content

Develop own OpenJUMP PlugIn with Eclipse

8. November 2012

The initial side where I started

http://sourceforge.net/apps/mediawiki/jump-pilot/index.php?title=How_to_use_and_make_own_Plugins (cached)

This link on the side didn’t help, so I searched for another tutorial on how to set up OpenJUMP in Eclipse…

Setup OpenJUMP in Eclipse

http://www.youtube.com/watch?v=cDAs04QEuzU (cached)

Additionals for the video:

– download older version ‘openjump-src-1.4.2’

–> http://sourceforge.net/projects/jump-pilot/files/OpenJUMP/

–> http://sourceforge.net/projects/jump-pilot/files/OpenJUMP/1.4.2/openjump-src-1.4.2.zip/download
– the text that the tutor enters to ‘Run Configuration’

-plug-in-directory lib/ext
-properties ./scripts/workbench-properties.xml

-Dorg.xml.sax.driver=org.apache.xerces.parser.SAXParser
-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
-Dlog4j.configuration=file:./etc/log4j.xml
-Duser.language=ml

(leaf out the last line, as it is the language of the tutor)

Making a first HelloWorldPlugIn

…still using information on this side!

!Make sure the filename ends with ‘PlugIn’…with a majuscel ‘I’…it is case sensitive!!!

The described instructions can be applied without any additions!!!

Running the first PlugIn

…still on this side!

Version 1 works easily.

Exporting a *.jar file has to be done this way…(!Before you have to create the new ‘Extension file, as described’!)

right click on folder ‘Helloi18n/src’ … ‘Export…’ … ‘Java/Jar file’ … only export all ‘src’ resources … select destination … ‘Finish’

now you only have to put this *.jar file into the plugin folder of OpenJUMP –‘> for me: /home/klammer/osm/bin/openjump-bin-1.4.1/lib/ext

Version 2 is also simple, but you have to made more editing!

It is a note to have OpenJUMP as seperate project…I did so as described above!!!

–> the workbench-properties.xml looks in my case this way:

<workbench>
 <plug-in>tudresden.klammer.HelloWorldPlugIn</plug-in> 
</workbench>

…and has to be stored in the project of the HelloWorldPlugIn

–> I already have a run entry…cause I followed the descriptions above…so I have to change this one …ergo … change the ‘Run Configurations’ again

!!!it is necessary to remove the ‘Program arguments’ that I have added before…replace them with the new one…which are for me:

-properties /home/klammer/Software/WebGen-WPS/wps-eclipse-workspace/Helloi18n/workbench-properties.xml

-> that points to the properties file stored in the PlugIn project

-plug-in-directory /home/klammer/Software/WebGen-WPS/wps-eclipse-workspace/OpenJUMP/lib/ext

-> that points to the OpenJUMP set up in Eclipse (as described above)

–> Point 5 is described very complicated but is not so

…just go to the ‘classpath’ tab of the ‘Run Configuration’ … click on ‘Bootstrap Entries’ and add all jar files of the OpenJUMP project ‘lib’ folder

…and click on ‘user entries’ and add the Plugin project

Thats it…click on run…and you should find a new menu called ‘View’ containing the menuitem ‘HelloWorldPlugIn’!!!

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: