Make Custom Project template in Eclipse IDE - eclipse

I have been using Eclipse IDE for a long time. Its a really great IDE for Java/C/C++ (and other languages with its THOUSANDS of plugins). Every once in a while, I get the need for creating a Javax interface. To do this normally, I would setup the new java project then add what I need. But, wouldn't it be nice if I could just make a template project to automatically include the code for the files. How would I go about doing this? It it even possible? The Eclipse CDT can make a new project type. So can the Google ADT and Google App engine. So I would imagine it is possible. But how?

You must write your Eclipse plug-in that implements org.eclipse.ui.newWizards extension point. You can extend an existing "New Java Project" wizard, and provide your custom project layout implementation (see the API).

Regarding java projects you might be familiar with maven. Maven offers of project template mechanism called archetypes. I never created an own archetype but the explanation to do this (Guide to Creating Archetypes) does not seems to be so complicated.
So although this is not a special eclipse solution it might be helpful for you. Together with the m2eclipse plugin it also works nice together with eclipse.

Related

AEM error on real time

Is there a way to configure AEM into an IDE like IntelliJ,Eclipse...
So that the IDE shows the errors on my project before I compile it even if I put it outside the source folder like for example the components created.
If possible both the .java and .jsp
I'm not entirely sure what you mean by outside the source folder, but have you taken a look at adobe's documentation?
They have instructions for IntelliJ + AEM with Maven. It also instruct on jsp support as well. It's for 5.6.1 but it should be valid for 6.x as well.
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/howto-develop-aem-projects-with-intellij.html
Here's one for Eclipse
https://helpx.adobe.com/experience-manager/using/creating-aem-project-using-eclipse.html
They also have a more generic set of instruction
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-apache-maven.html#How-To%20Work%20with%20JSPs
Yes, you can maintain CRX data(AEM folders like /etc, /apps, /content, etc) in an IDE like eclipse. This will help you iron out all the compilation errors using features of IDE. Make use of this eclipse plugin called vaultclipse. You can install it from eclipse marketplace.
There is also another plugin called AEM plugin, details on how to use it here.

How do I begin using an Eclipse plug-in after downloading it from the Eclipse marketplace?

In this case, the plug-in is Zest. I have downloaded "Eclipse for java developers(Juno)". I understand it has something to do with manifest.mf dependencies. But I have no idea what they are. I am new to Eclipse and Java programming. The Zest tutorial mentions Eclipse for RCP development. Can it not be used in other versions?
There are two kinds of plug-ins downloadable from the Eclipse Marketplace: plug-ins that contribute new functionality to Eclipse, and plug-ins that provide a programmable framework. Zest is one of the latter.
To use such a framework (similar to other Java libraries), you have to have a Java project that has the corresponding jars (and their dependencies as well!) on their classpath.
The simplest way to achieve this is to create a plug-in project in Eclipse, and add the Zest jars as a direct dependency and also adds SWT and possibly JFace as indirect dependencies). In that case, you can use the Zest API in your project and create the corresponding graph visualizations.
In case of Zest, it is also possible to create a simple Java project (unrelated to Eclipse), as the code base does not use any Eclipse-specific functionality, on the other hand, it depends on SWT and JFace, so you have to add the corresponding dependencies as well. For details, see the wiki entry of JFace to get an idea how to manage it. If you want to use Zest, follow the same steps, but also copy the Zest and Draw2d jars as well.
I hope, this solution is clear enough - if not, feel free to ask further questions.

Using Eclipse with HTML5 Boilerplate

I just got my new computer and I'm going to learn an IDE fresh. Everyone suggests Eclipse; therefore, I'll go with that. I downloaded Java EE for I may use it later for java programming also. I don't mind the bloat.
What I want to achieve is that every time I create a new website project that HTML5 Boilerplate also gets created as a template to the project. Anyone know how to achieve this?
Also any additional plugins for web dev or anything to do helpful with web development ideas with eclipse would be most appreciated.
If you are using Java EE eventually, I think the best strategy would be creating a Maven archetype. This way once you have your baseline project definition, you can archetype it and create all your subsequent projects from that.
Apache - Guide to creating archetypes
If you don't have Maven yet, you can get it here.
And the Maven Eclipse plugin can be installed from the update site: http://download.eclipse.org/technology/m2e/releases
Finally, since you are new to Eclipse, you can install plugins from Help > Install New Software. Best of luck! I know that's probably a lot to take in.

Eclipse project structure ANT and MAVEN

I am trying to set up a project, but feel completely overwhelmed with lack of knowledge. In university we used netbeans which resolved project structure gently for us. As community leans towards eclipse I am trying to migrate there, but feel myself like a penguin not able to fly. I can't understand project structure where and what has to be added, do I have to define ANT or MAVEN manually in eclipse can they be integrated? Where to go ? Apache manuals are so complicated, why is that I can program in Java , but don't know the fundamentals, soo depressed, please anyone guide me. I find pieces on web, but seems can't build full picture in my head.
You have a couple of options. Basically, eclipse uses a workspace, which contains one .metadata directory used by the plugins and all of the project folders. Projects can then be things like java projects, PDE projects, PHP projects, etc.
There is maven integration in eclipse which I would use, http://www.eclipse.org/m2e/ It was part of Indigo, which released June 2011.
Set up your java projects in your workspace, and then use m2e to mavenize them, or use m2e to generate the java projects into your workspace.
maven provides a facility to create a new project with the required structure based on the type of project (jar, war, etc.).
You can do this or achieve it directly from Eclipse as suggested by Paul Webster, by installing the m2e plugin.
This structure can then be easily built using maven, as well as developed in Eclipse.

Can't access class in Eclipse plugin from a Java Project

In abstract, my problem is the following: I want to access a class contained in an Eclipse plugin from a Java Project. Is it possible? I've included that class in the "Exported Packages" of the plugin, which supposedly are "all the packages that this plug-in exposes to clients." Can my Java project be a "client" or only other plugins can be clients?
More concretely, I've encountered this problems when using XText. I built an editor for a language, and programs written with this language are stored in a text based format that follows the grammar defined with XText.
I want my users to be able to write Java programs that load and manipulate those xtext-based files. For that, they need to access all the classes that XText generated in the plugin project. However, I haven't been able to use those classes: in an Eclipse instance that is running the plugin with my editor, those classes are not visible.
How can I access them? The only solution I've found is to export my plugin as a jar and then include it in the Build Path of the Java project, in the other Eclipse instance, but this doesn't sound elegant.
Another way of looking at this problem is the following: I want a certain class to be available to any Java project built in an Eclipse instance where a certain plugin is loaded. How can I do it?
Thanks for your help.
PS. I'm launching the second Eclipse instance (the one where the plugin is loaded) from within the first Eclipse instance.
Once you generate your XText support, you need to make sure every package is exported from the Runtime tab by editing your MANIFEST.MF.
Then once you deploy your plugins into an eclipse, that eclipse environment will be able to see those classes.
But that would only help other plugin developers. Java apps can see classes that exist on the classpath (if you add the plugin jars, for example) but as most eclipse plugins depend on the eclipse lifecycle to work, it's unlikely that their java programs would run. That's not always the case (you can use JFace without a running eclipse) but only for plugins specifically designed that way.
If your plugin is installed, you can create a java project and add the plugin jar as an external jar, using *ECLIPSE_HOME* variable. If your plugin is a project in the workspace, you can depend on it (from the java build path) just like another java project. But since it's a plugin, that probably won't help them run.