User Tools

Site Tools


05_developer_tutorials:02_extending_groimp:jedit-plugins

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
05_developer_tutorials:02_extending_groimp:jedit-plugins [2025/01/29 08:33] – removed - external edit (Unknown date) 127.0.0.105_developer_tutorials:02_extending_groimp:jedit-plugins [2025/01/29 08:33] (current) – ↷ Page moved from 05_developer_tutorials:jedit-plugins to 05_developer_tutorials:02_extending_groimp:jedit-plugins tim2
Line 1: Line 1:
 +===== JEdit plugins for GroIMP ======
  
 +The embedded text editor jEdit has some additional plugins not included in the GroIMP version.
 +
 +They can be downloaded on the jEdit [[http://www.jedit.org/|website]].
 +
 +==== Integration in GroIMP ====
 +
 +To include a jEdit plugin in GroIMP you need to: 
 +  - Download the plugin source code from the jEdit website.
 +  - Do some modification on the code (explained bellow).
 +  - Compile the plugin into a jar.
 +  - Move the jar into the jEdit repository (.de.grogra.ext.jedit/jars) in the GroIMP configuration repository (the default path is /home/.grogra.de-platform on linux, and \Users\<YOUR USR NAME>\.grogra.de-platform on Windows).
 +
 +To be integrated in GroIMP the jEdit plugins must be modified. Indeed the main component of jEdit, the View, inherits from ''javax.swing.JFrame'', whereas to be embedded in a GroIMP windows, it has been changed to inherit from a GroIMP class that inherit from ''javax.swing.JRootPane''.
 +
 +As the to classes cannot be casted on each other, the plugins, that interact with a ''javax.swing.JFrame'' must now interact with a ''javax.swing.JRootPane''.
 +
 +The two most common changes you will need to do are: 
 +  - Get a java.awt.Windows from a JFrame.
 +  - Get a JRootPane from a java.awt.Windows.
 +
 +For instance, in case 1:
 +''window = new JWindow(view);'' should be ''window = new JWindow(SwingUtilities.getWindowAncestor(view));''.
 +
 +And case 2: ''View view = (View) window.getOwner();'' should be 
 +''View view = (View) %%((JWindow) window. getOwner())%%.getRootPane();''.
 +
 +**To spot the where your should make changes in the code you can use Eclipse.**
 +Import the jEdit plugin's source code into the jEdit repository in GroIMP source code. Eclipse will find the casting errors.