eclipse custom project plugin - eclipse

I have already read many articles but never succeeded to do what I need.
I would like to make a plugin for eclipse.
this plugin should add new wizard category to the 'File->New->Project',
this category should have 3 items under it, lets say 'X', 'Y', 'Z'.
when pressing each of them, no matter which,
a new 'Create a Java Project' window open.
after entering the 'name' for the project,
a new Folder needs to be create at the project manager at the same chosen 'name'.
this folder must have all other items inside, just like creating a new normal java project.
also should be a new package under the 'src' folder, package name is 'X' ('Y', or 'Z')..
and inside the package should be a java file (with my own default template), its name should be 'name'.jave.
is it possible to make such plugin to eclipse?
even not making the plugin with eclipse itself.
will really appreciate your answer,
Thanks!

Yes, it is possible. You will have to learn how to make Eclipse plugins though. Start with some basic tutorial like this or this. Then when you know the basics, you can look into the newWizard extension point that you want to use.
You can do this in any editor, even a text editor if you want. But you will have a huge advantage by doing this in Eclipse since there are editors and tools to help you out.
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_newWizards.html

Related

Mapping between resource file and model object in Eclipse plugin app

Please anyone help me understand and use IDE.openEditor(IWorkbenchPage, IFile).
I have a resource file (xml format), it contains my model objects. I'm writing a wizard to create it, save it into workspace, view it inside a tree view (I use CommonNavigator) and open it in an editor. I need to know the control flow of this all. How to map between resource file and model objects, how the navigator can show that objects and how to open editor that associated with my resource file.
I'm sorry, I'm a newbie in Eclipse field. I know I need too much, but please give me at least an idea.
Thanks a lot.
A great character once said... "You have much to learn young padawan".
Here's a great place to start your journey though the basics of Eclipse plug-in / RCP development...
http://www.vogella.com/eclipse.html
If you really want to get down and dirty into the bowels of Eclipse, you can use Eclipse itself to teach you the dirty details about what's really going on.
Figure out how to view Eclipse source code inside of Eclipse.
Set break points at interesting points in Eclipse source code that you want to know more about.
Use the 'Eclipse Application' run configuration to run an instance of Eclipse from within your main Eclipse.
Use your newly launched Eclipse to preform the tasks you want to mimic and hopefully, you'll hit one of your break points and see how the Eclipse developers did what you want to do.

Eclipse - New Project

I need to modify project creation in eclipse. I would like to add my own project creation. For example, when developer selectes File->New->Project, I want my option (i.e, XYZ Java Project) under to be available. Is this possible ? If yes, i am looking for some direction to begin with ?
Thanks.
To begin with you need to contribute your own Eclipse Plug in. Download Eclipse plugin developers IDE from this Location.
You can contribute a Custom Project Wizard through Extensions.
Define your Project Nature
For reference you can check this example Create a Custom Project in Eclipse – New Project Wizard: the Behavior
Hope this helps !!
Yes you can. A robust way to do this is to make an eclipse plugin so that it gets added to the menu. I was just looking into this myself a couple of days ago and this is what I found.
Here are some links:
O'Reilly
Better yet though, let me just show you an answer about this: https://stackoverflow.com/a/299316/879485
If you use Maven you can have a look at archetypes. Maven also has the ability to create Eclipse projects. With this you should have all the tools necessary to automate whatever project layout you need to have.

Play 2.0 with Eclipse 3.6, Scala template editing

I´m new to Play and Scala world, so I´m needing some help to figure out how can I edit the scala template files using Eclipse. I already installed scala ide 2.9 but when I try to edit the index.scala.html, the contents of the file aren´t editable...
Please can anyone help me?
I experienced this just recently, too, but lucky for you I made the full migration from IntelliJ to Eclipse.
There is some setting up you need to do with the Scala templates, but one of the easiest ways to get it done is following these steps:
Step 1: Add file extensions
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-51.xhtml
Be sure that your file extensions are properly added to the file associations.
Step 2:
Look at the associated editor. In the image above you'll see that the only associated editor with *.htm is Web Browser. So you'll need to hit the "Add..." button to add the Scala editor. Don't forget to set it as default :)
Step 3:
Right-click on your Scala template and be sure that you are choosing the right editor. You can also use this to switch between editors.
Hope this helps!

How to make a new Eclipse project template?

I am using a kind of framework where every time I make a new Java project. I have to arrange the files in the appropriate packages and reference the appropriate external JAR libraries. How do I make a new project template like in the New Project dialog under a new folder?
I've just done a bit of research on this for our own nefarious purposes, and found the answer.
You need to create an Eclipse plugin that uses the org.eclipse.ui.newWizards package. You can define your own category or use an existing one once you find the category ID. To create a new project wizard rather than a new resource wizard, you need to set the "project=true".
Also, your plugin must contain a class that implement org.eclipse.ui.INewWizard. Clicking on the class link from the plugin.xml editor will do the trick.
That class must do all the work in the performFinish override, and must return true to indicate that it actually did its thing and the wizard can close. This is where you create files, directories, set natures, and so forth.
You need to write an Eclipse plugin for that, and concentrate on New Project Wizard.
Writing Eclipse plugins is covered in Stack Overflow question How to write a plugin for Eclipse?.

Easy way to add a context action to Eclipse

I'm trying to add a very simple action to the context menu of Eclipse: clicking with right button over a folder object, this action should call an external tool (configured in the "External Tools") using the path of the folder as the only parameter.
I've found a tutorial on how to add a context menu, but it's more complex than what I need -- I don't really want to create a plugin, I don't even want to create classes to do what I want. My only purpose is to call an external tool.
How can I do it?
If you want to extend Eclipse with functionality such as editing context menu's, the only way to go is by writing a plug-in. However, this can be very light-weight and targeted to your needs, so the tutorial you found might be a good way to do it.
Check out StartExplorer. It's very handy. It's the equivalent of the IntelliJ "Neighborhood" plugin.
It comes with the basics of explore, command shell, open, and copy path for Windows, Mac and Linux. It also supports custom commands. And can be installed through a normal Eclipse repository.