Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Starting Eclipse plug-in development might be a bit overwhelming.</p> <p>The sort answer: I assume that you have create a new plug-in project with the "hello, world command" template. If not you can easily do it. It will help you to get started. In this sample project, eclipse created a simple menu contribution for you. I'm not going to go over the details, but essentially, you create a command (org.eclipse.ui.commands) and associate it with some location in the workbench like a menu or toolbar icon (org.eclipse.ui.menus). Then you need to create something that will handle this command like when it is executed (by user clicking on the menu). This is done by by handlers (org.eclipse.ui.handlers) and handlers are when you want your code to go into.</p> <ol> <li>Open the "plugin.xml" file in your plug-in and navigate to the "Extension" section</li> <li>Expand the "org.eclipse.ui.handlers" branch and select the only "(handler)" item.</li> <li>Click on the "class" link the right part of the editor and that will navigate you to the generated class.</li> <li>Your code goes to the "execute" method. This is what will be run when user executes the command. In your case if you want to ask for an input you can use an input dialog:</li> </ol> <p>Code:</p> <pre><code>public Object execute(ExecutionEvent event) throws ExecutionException { InputDialog dlg = new InputDialog( HandlerUtil.getActiveShellChecked(event), "Title", "Enter text", "Initial value", null); if (dlg.open() == Window.OK) { // User clicked OK; run perl String input = dlg.getValue(); // TODO:do something with value } return null; } </code></pre> <p>No to ask user for an input you will need to show a dialog. I suggest you go over this nice tutorial: <a href="http://www.vogella.de/articles/EclipseDialogs/article.html" rel="nofollow">http://www.vogella.de/articles/EclipseDialogs/article.html</a> which describes this in a great detail. </p> <p>The long answer is to look at <a href="http://www.vogella.de/articles/EclipsePlugIn/article.html" rel="nofollow">http://www.vogella.de/articles/EclipsePlugIn/article.html</a> and <a href="http://www.vogella.de/articles/EclipseCommands/article.html" rel="nofollow">http://www.vogella.de/articles/EclipseCommands/article.html</a> to see the basics behind Eclipse RPC and commands.</p> <p>Lastly, you will also need to look in here <a href="http://www.vogella.de/articles/EclipseJobs/article.html" rel="nofollow">http://www.vogella.de/articles/EclipseJobs/article.html</a> to understand how to run longer tasks like the perl script you are talking about. </p>
 

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