Is there some plugin for eclipse which shows a minified outline of the source? - eclipse

E.g. Komodo IDE has this feature:
Can be really useful for getting an overview of a big file.
Anyone knows something similar for eclipse?

Yes its there. Look this overview-plugin. This plugin shows the overview of the current text editor in the Overview view. Also the tooltip shows the line under the cursor. Also note that you can control the zoom level in overview view.
Screen shots:

The general way of providing that kind of view (not exactly a minified view, but as useful) is through an outline.
For JSON, you would need an eclipse JSON plugin, which has a JSON outline dedicated view:

You can use the Quick Outline feature of many editors in Eclipse to get a pop-up, easily navigable outline of the file's contents. Use Ctrl+O (Command+O on Mac).
To bring up the "normal" persistent Outline View, open Quick Access with Ctrl+3 (Command+3 on Mac) then type outline and select it from the list.

Related

NetBeans link to line in source

I have quite a complicated code source and I have commented and split it as best I could and created a table of content. I would love to be able to simply click/ctrl + click on one of the lines in my table of content and automatically put my view to the line/link I specified. Is that possible in NetBeans?
You could use bookmarks which are supported by Netbeans. Under "Window / IDE Tools / Bookmarks" you can open the bookmark window which gives you an overview over all bookmarks which can be also renamed. From this window you can navigate via double-click to your bookmarks.
No exactly what you had in mind but a viable alternative.
(see also http://wiki.netbeans.org/EditorBookmarks72)

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.

How to wire up an editor to the location cursor icons?

I have built a graphical editor as an Eclipse plugin. Users may zoom into and pan about the graphical image.
I would like to employ the Back and Forward arrow icons in the Eclipse icon bar to step back and forth through the graphical image, in a similar manner to what is already possible in textual editors. All of my references go quiet on this subject
All clues or better references are most welcome.
M.
I think you need to define a RetargetAction
See an example at
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/rcp_actions.htm
(I haven't done this myself, but it sounds right...)
See also http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/guide/wrkAdv_retarget.htm