Eclipse Plugin :java Editor - eclipse-plugin

I want to extend the functionality of the java editor.
Instead of creating a custom editor, I want to just expand the functionality of
Java editor.
Where do I start?
Kindly provide some insight into this.

Two examples to look at are the AspectJ editor (for AJDT) and the Groovy editor (for Groovy-Eclipse). Both do exact;y what you are describing. They provide sub-classes of the Java editor specifically for their language. It's not a simple task and before you begin, you should have a deep understanding of how the Eclipse plugin architecture works.
The source code for AJDT is available here:
http://git.eclipse.org/c/ajdt/org.eclipse.ajdt.git/tree/org.eclipse.ajdt.ui/src/org/eclipse/ajdt/internal/ui
The source code for groovy-eclipse is here:
https://github.com/groovy/groovy-eclipse
Finally, you should have a good read of this article about the eclipse editor framework:
http://www.vogella.com/articles/EclipseEditors/article.html

Related

How to build EMOF models in IntelliJ and generate code from them?

What is the best way to build models in IntelliJ, in the style of Eclipse EMF ?
Is there an equivalent of Eclipse EMF in IntelliJ ?
And is there something that adheres to standards such as EMOF in the same way that EMF Ecore is aligned to it ?
I found a plugin that seems to help with that here, but I am wondering if there are other/better options.
Checkout the Working with Diagrams docs. JetBrains provides UML modeling and supports both forward and reverse engineering. Although this is not EMF, it appears to be IntelliJ's equivalent in terms of functionality.
Note this feature is exclusive to the IJ Ultimate Edition.

Eclipse Plugin Developement: Including JDT functionality in my own editor

I am making a eclipse plugin. I began with the default MultiPageEditor wizard and implemented the specific functionality that I wanted. Now, I wanted to get features like Java syntax highlighting, error detection etc. that comes with the standard JDT plugin, in the custom editor that I have written.
Questions:
1. Is this even feasible ?
2. If yes, what will be quickest way to achieve this.
Why not just sub-class the JavaEditor or the CompilationUnitEditor and add it as a page to your MultiPageEditor?

Can I configure IntelliJ Idea to recognize custom code folding regions designation?

I like c# #region...#endregion facility a lot (some people say that's a bad habit but let's not discuss that). I miss it a lot when coding other languages. The obvious way to "add" it to other languages is to use special-formed comments the editor would understand. I've managed to set up Kate to support //#region...//#endregion for Java/Scala code, alike feature is not a problem to achieve with NetBeans (here is how). Can I do this with IntelliJ Idea 11?
This feature is planned for IDEA 11.1 that will be released in late Q1, 2012:
IntelliJ IDEA 11.1 will support custom folding using NetBeans and
Visual Studio style comments.
Meanwhile this feature is implemented in IntelliJ IDEA and described here:
http://www.jetbrains.com/idea/webhelp/folding-custom-regions-with-line-comments.html
You can define code regions using two styles:
VisualStudio style
#region Description
Your code goes here...
#endregion
NetBeans style
// <editor-fold desc="Description">
Your code goes here...
// </editor-fold>
But it is recommended to not mix up the two styles in one file. IntelliJ IDEA will recognize the first folding comment encountered, and will assume this as a style chosen for the code.

Develop a plugin editor for eclipse

I have a question for you. My teacher proposed a couple of thesis to me. Basically to develop a plugin for eclipse. There are 2 options:
1)An editor for A-SPL language with syntax highlighting, auto completation of the cose, errors detection and so on........to help people that need to use S-APL
2)An editor to help people to design GUI in S-APL......something like a framework where you can drag widgets and there is a kind of automatic completation of the code....
The thesis should last 4 months......i should not implement everything but make a kind of prototype that maybe in the future someone will finish and make properly work.
I never did something like this so i would like to know if it is difficult, which skills are needed, which languages i should know to create eclipse plugins (for example i know java and python) and so on......to figure out if it is something i can do.
I'd suggest to look into the Xtext (for a textual editor) and Graphiti (for a graphical editor) projects.
You'll need Java for Eclipse plugins.
You need to read a book / the eclipse plugin wiki about Eclipse architecture as it's critical to know the paradigms in use.
There's an example XML plugin editor that you can create from the 'New Plugin' wizard which would be a good starting point for the first option.
good luck. :)

How to create an Eclipse editor plugin with syntax checking and coloring as fast as possible?

I'm working on a project that requires me to create a series of editors for languages that are quite different. The syntaxes are defined by us.
I'm looking for a solution for this.
Is there a shortcut to take in this problem?
You could use XText:
a framework for development of textual domain specific languages (DSLs).
Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
Alternatives to XText are Rascal or Spoofax, both less popular than XText but interesting for they support more general context-free grammars, among other things. Nice to check out.
If you are looking for a more low level, programmable solution, then Eclipse's IDE Meta-tooling platform is a good choice (IMP).
What IMP gives you is API to connect your existing parsers to Eclipse without much hassle. You need to implement an IParseController interface, to call your parser and ITokenIterator to produce tokens and some other interface to assign fonts to each kind of token.
The aforementioned Rascal and Spoofax are both build on top of IMP.
Not mentioned is DLTK (proposed also in Tutorial regarding the development of a custom Eclipse editor)
There are Ruby, bash that are implemented with it.