What is the use of # Javadoc view in eclipse - eclipse

I noticed #javadoc view in my eclipse. Could you please tell me what is the use of this and how to use it.

Eclipse actually does provide decent tools for creating your own JavaDoc, which is a good idea, as then others who have to use your code will have the ability to see what it does.
There is a keyboard shortcut for adding a block for a class or method (on Mac it's Command-Shift-J I think, but search Javadoc in the key mappings.
You can define templates for adding things like links, which are pretty important, that make creation of JavaDoc go very quickly
When you document in Eclipse, it is intelligent enough to point to existing docs, so say you make an interface, you document the methods in the interface, then inside each implementer, if you created them after the interface, you will get a block that points you back to the interface
When you have added your own, or other people on your team have, this view let's you see what that will look like, so it's got a dual purpose: for making it easier to read the markup of others' JavaDoc, and for previewing your own.

The view you are showing is the Eclipse # Javadoc view. The Javadoc view shows the Javadoc of the element selected in the Java editor or in a Java view.
To use it, simply open a Java file that contains Javadoc in the Java view (or use the Java perspective). Once you do so the Javadoc view will automatically populate.

Related

Eclipse "top level elements" changes to "Working sets" on change of perspective

When I close my perspective B, and open it again, even if the B perspective "top level elements" property was "Projects", it gets changed to "top level elements".
However please note that when I open up the perspective the very first time, the property was "Projects".
I am sorry if this question is very elementary but I am quite new to Eclipse development.
Does anyone know which class this property belongs to, so I can override it when the Perspective is opened?
I suspect it should belong Common Navigator Framework and specifically the CommonNavigator class?
P.S. What would be the correct way to know such things, i.e. where is such an action defined and what function is it bind to? Is there any direct way or does it need a person with full knowledge of the eclipse framework?
Well just closing and opening a normal Project Explorer view always seems to revert to Working Sets so it looks like the view does not persist this setting.
You can find out some things about what classes are used by using Eclipse plug-in spy. You can also look at the plugin definitions and the source code. Project Explorer is in the org.eclipse.ui.navigator.resources plugin.
It looks like org.eclipse.ui.internal.navigator.workingsets.WorkingSetsContentProvider deals with this setting but I don't see an obvious way to change it.

Smalltalk-style method browsing for eclipse Java?

I am using Eclipse (Indigo) for Java development. My personal, idiosyncratic style prefers to see Java methods one-at-a-time, instead and not as a region of a longer .java file.
I am looking for a preference, view, or plug-in that shows me a java method, and only that method, when I select the method name from a explorer or browser. For reference, here is a screen-shot of a typical Smalltalk browser (Cincom's VisualWorks). The "Method Code Area" shows on only one methods as opposed scrolling through all methods in the class.
The Java Browsing Perspective comes close to a Smalltalk browser. I customized it a little bit and found it very useful.
Enable 'Show Source of Selected Element Only' and you will see only the selected method.
On today's widescreens, you won't need the whole width for the method source, and projects and methods take some vertical space. So I decided to vary the original Smalltalk layout.
Make sure that Eclipse closes open files automatically, as you want to browse, not to open and close files.
One thing that is missing is the 'Protocol' view. Maybe the developers had something like that in mind while introducing the #category Javadoc tag, but the only thing you can do is to filter by category. I hope that some lucky day someone will develop a protocol view.

In an eclipse plugin: How can I programmatically highlight lines of codes in the java editor?

I am trying to develop an eclipse plugin that does some documentation check on java code and highlights some lines of code in the editor.
To achieve my goal, I DON'T want to create a new editor in eclipse, I simply want to extend the default java editor to draw a line under (or highlight) the methods that do not satisfy some set of predetermined requirements.
Do I need to create a PresentationReconciler? If yes, how do I make the JDT or workbench use my reconciler.
I have never done plugin development and this is my first attempt.
Several starting points for you:
Annotations are an UI feature of JFace's text editor that allows you to visually mark some places in an open editor.
Markers are a Workbench feature, more high-level. They are generic "objects that may be associated with Workbench resources", and they can display in several places: in text editors (as annotations) or in the Problems view, for example.
Depending on what you want to do, you would plug in your plug-in into extension points related to either of those.
The Eclipse Java editor is located in the org.eclipse.jdt.internal.ui.javaeditor.JavaEditor package.
The "internal" in the package name means that the Eclipse development team can change how the Java editor works with new revisions.
Try this help page: Juno Help on syntax highlighting
At the end of the page, it describes how to dynamically add a PresentationReconciler, which is used for syntax highlighting. See if that fits the problem that you want to solve.
I assume you already have a plugin project.
In your plugin.xml, open the tab Extensions, click Add..., search for org.eclipse.ui.editors, then you should see a template named Editor, which will produce a simple xml editor to experiment and play with. Also, you will be able to see the needed structure to define a custom editor.
Hope this helps...
I don't know if you still have a need for this, but you are going to want to use Annotations to keep track of what parts of the editor you need to highlight.
For actually doing the graphical effect of highlighting, you could do syntax highlighting via a PresentationReconciler, but I have no experience with that.
We used a technique we borrowed from http://editbox.sourceforge.net/, replacing the background image of the editor Shell. Its open source, so check it out. (Our code might also help -- its at https://github.com/IDE4edu/EclipseEditorOverlay )

Jface TreeViewer nodes Link with files

I writing an eclipse plugin to analyze files for some defects, I get the list of java files, their classes and methods in a jface tree view, I need to open the file in the editor when I double click on the file node of the tree view.
please help me with this.
thanks,
Shasinda
You should either use a common navigator framework with corresponding filters that already has the link and open function built-in for Eclipse Resources, however, is much trickier to set up - see the blog post series starting with http://cvalcarcel.wordpress.com/2009/07/08/writing-an-eclipse-plug-in-part-1-what-im-going-to-do/
Alternatively, you could add a double click listener that opens an editor (or checks existing editors of the current workbenchpage) by looking the open editors. For the basic idea, see the corresponding Eclipse FAQ entry.
Use IDE.openEditor to open the editor.

How to add views to Show In menu for particular file types

I use an older plugin called Veloeclipse for editing Velocity templates in Eclipse. There's been no development on this since 2009, which isn't a problem because it's mainly just for syntax highlighting and format validation. The really annoying thing about it, however, is that when I try to do Show In to view the current Velocity template within my Package Explorer or Project Explorer, the only available option is Properties. That's not really useful. I really need to be able to get to the file in one of the regular explorer views.
So I have sort of two questions:
Is there a way to configure this without having to monkey with any code? A configuration file or something? I've grepped through my Eclipse installation and haven't seen anything, but I'm hoping that there's something I'm missing.
So assuming that the answer to my first question is no, how do I go about modifying the plugin code so that it will show more than the Properties view in the Show In menu? Most of what I found on the plugin development wiki comes from the other direction: how to make your view or perspective appear in the Show In menu.
Any help with this would be hugely appreciated!
Try to check the plugin source code. it might do something different than other editors. What I mean is that the show in menu item that you have there is not the usual extension point but a hard coded context menu option.