Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending Eclipse's JavaEditor (to act like Vim/change KeyListener)
    text
    copied!<h2>Introduction a.k.a. what do I intend to do</h2> <p><em>feel free to skip this part, no real information is comprised in here</em></p> <p>Because of the lack of a good, free (as in speech) <code>vim</code>-Mode for the otherwise excellent JavaEditor in Eclipse(3.4), I'm thinking about writing one. The available solutions are:</p> <ul> <li><a href="http://www.viplugin.com/viplugin/" rel="nofollow noreferrer">ViPlugin</a>: commercial and not good (e.g. no <code>vim</code> <code>text-objects</code>, such as <code>daW</code>)</li> <li><a href="http://vimplugin.org/" rel="nofollow noreferrer">VimPlugin</a>: new editor, not the power of the built in JavaEditor</li> <li>see <a href="https://stackoverflow.com/questions/597117/painless-integration-of-eclipse-with-vim">SO: <em>Painless</em> integration of Eclipse with Vim? </a>: nothing really good turned up</li> </ul> <p>(However feel free to mention <strong>other</strong> solutions than the ones above which could help me.)</p> <p>In my opinion, it's the wrong way of writing a completely new editor based on <a href="http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/editors/text/TextEditor.html" rel="nofollow noreferrer"><code>TextEditor</code></a>, because you will then loose the cool features the standard JavaEditor gives you for free (such as 'organize imports', 'refactor menu', ...).</p> <p>I'm thinking of a 'skin' to the normal JavaEditor which behaves like <code>vim</code>, everything else should be unchanged.</p> <h2>Now the questions</h2> <ul> <li>How can I detect if a <a href="http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IWorkbenchPart.html" rel="nofollow noreferrer"><code>IWorkbenchPart</code></a> given by <a href="http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartListener.html#partActivated(org.eclipse.ui.IWorkbenchPart)" rel="nofollow noreferrer"><code>IPartListener.partActivated()</code></a> is the JavaEditor?</li> <li>How can I then replace JavaEditor's <a href="http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/events/KeyListener.html" rel="nofollow noreferrer"><code>KeyListener</code></a>; something like the <a href="http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/ITextViewerExtension.html#prependVerifyKeyListener(org.eclipse.swt.custom.VerifyKeyListener)" rel="nofollow noreferrer"><code>ITextViewerExtension.prependVerifyKeyListener</code></a> is needed?</li> <li>Is this a good way to go on?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload