Open Implementation (type hierarchy) functionality in NetBeans? - netbeans

When I have Java code like this:
someInterface.someMethod();
how do I get Netbeans to show me which classes have implementations of someMethod() (not the interface).
In Eclipse this is done with Ctrl+T, but pressing Ctrl+T on the method did nothing in Netbeans 6.5 and I can't where the type hierarchy functionality is in Netbeans 6.5.
Thanks.

I find that Ctrl+Alt+B works perfectly. :)

This functionality already exists in Netbeans: Alt+F7, check 'Find All Subtypes', and click OK. Thanks to tkellerer for pointing this out on the Netbeans forums
http://forums.netbeans.org/viewtopic.php?p=49638#49638
This is widely overlooked functionality in Netbeans, perhaps because there is no key binding for it, so I've changed my enhancement request to add a key binding for the sequence "Alt+F7, check 'Find All Subtypes', and click OK"?

To get a hierarchy similar to the type hierarchy in Eclipse, right click on the class name, select Navigate, and then Inspect Hierarchy. The keyboard shortcut for this is ALT+SHIFT+F12. By default, it shows you parents of the selected class or interface. However, you can view descendants by using the Filters at the bottom left side. I believe the Show Subtype Hierarchy filter (also toggled by using CTRL+B) is what you want.
This is accurate in NetBeans 6.7.1. I'm going to assume it is similar in 6.5.

It turns out that there is no comparable functionality in Netbeans. You can read about it here:
http://forums.netbeans.org/viewtopic.php?p=49355#49355
I've also filed an enhancement request here, which you can vote for:
http://www.netbeans.org/issues/show_bug.cgi?id=172830
If you want to see this added to Netbeans please vote for it.

Hey, someone has implemented a module to do this, and it works in Netbeans 6.5.1 - perfect for you. I'm hanging out to see an equivalent for 6.7.1. Maybe they should add it to 6.8!
http://wiki.netbeans.org/JavaGoToImplementation
Go To Implementation is built in for recent versions of NetBeans. Look in the Navigate context menu.

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.

What is the use of # Javadoc view in 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.

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 )

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.

class view in eclipse

In Eclipse, is there a way to have a Package Explorer like view that shows the classes without having to open the files individually.
I have this project where many classes are written in same files, and that makes navigating them so annoying. Is there some sort of ClassView in Eclipse that disregards file names.
Regards
This question is currently almost 2 years old, but for anyone ending up here through a Google search (like me):
Eclipse offers a "Java Browsing" perspective which is probably what you want. To see this, go to Window -> Open Perspective, and select Java Browsing.
You can use the Outline view.
Window > Show View > Other. Filter by the word 'Outline' (it's under General folder)
window->show view->outline was helpful for me as this was the only window missing in existing perspective.
Yes you can use F3 key if you're seeing this class, o you can use Ctrl+Shift+T shortcut to open 'Open Type' and write in it the name class
Okay, it's been asked a long time ago. You may be looking for the Breadcrumb. Searching for it and got this question. Suddenly I did it unknowingly and shared here. There is a button beside "Save", "Print" buttons; "Toggle Breadcrumb". :)