How to search a class in Java Library using Netbean IDE? - java

I have no idea, but would like to know whether it is possible or not to search in java libraray using netbean IDE. For example, I have heard ArrayList. And I want to find which package ArrayList belongs to. Is there any tool or plugins to search within Java Library for Netbean IDE?

CTRL+O
This shortcut triggers an action called interchangeably by the NetBeans documentation for Go to Type... and Go to type/file. The usage of this shortcut resembles the keyboard shortcut SHIFT+CTRL+T in Eclipse. Both IDE:s will search for a Java type/class as you type in the opened search field and provides a quick way to navigate to different types and classes. Thus in your case, instead of having to write down "ArrayList x;" in your code somewhere and hold down CTRL while you click on the variable type with your mouse (or any other "hack" provided in this thread now or in the future) just press CTRL+O and type in "arraylis" should be enough.
The shortcut may be changed if you go to your Tools menu item and then click Options. A window will pop up. Click on Keymap and find the action. Edit the shortcut.
You can find keyboard shortcut cards for different versions of Netbeans here.

Just type ArrayList + CTRL + SPACE Netbeans will suggest which package it belongs
But If that class isn't in classpath netbeans will suggest to create a new class with name ArrayList
for second of your question

You can press ctrl and then move mouse over the function and click.
You will move to the file where that function defination is provided.
So you can easily see return type .. parameter type
To search Library .. In netbean at the top right corner serach box is given.
There you can search library like google.

This might not be the best way to do that.
Just create an object for this class and press Ctrl + Shift + I. It will automatically import all the necessary classes. Hence you can check the package in the import statements.

Related

Ctrl+N keyboard shortcut on IntelliJ/Android Studio

I very often use Ctrl+N keyboard shortcut when working in Android Studio/IntelliJ, to open a given class by its prefix. Many times the popup window gets defocused when I type class name prefix and I start typing in the code area instead (and I am sure that this is a problem inside IntelliJ, as I am not touching my touchpad, etc.).
How can I fix this?
See this issue: Go to Class window loses focus during typing, there might be a workaround which would work for you.

How to view all implementors of a given interface in NetBeans for Java?

I'm trying to evaluate NetBeans, being a veteran Eclipse user. In Eclipse I could press F4, and I would a class hierarchy for a given class or Interface. For example - show me all the classes that implements InputStream.
It's also important it will show me this across all my dependencies and not just my code.
Try this, select the type e.g. "String", then click with the right mouse button -> Navigate -> Inspect Hierarchy. On the right side you will see a window called "Hierarchy" or maybe just a vertical text with "Hierarchy" which is a minimized window (click to open).
If opened you see a combobox with "Supertypes". Change this to subtypes, there you see all classes or interfaces implementing/extending your interfaces or extending your classes.
Try this,
ctrl + alt + click
this will list all implementations of same interface
The shortcut key "Alt+F12" works for me in NetBeans 8.0.2.
I believe "Inspect Hierarchy" is in existence since NetBeans 6.0
http://wiki.netbeans.org/Java_MembersAndHierarchyPopup
Select "Subtypes" and "Refresh".
NetBeans Type Hierarchy
UPDATE: This bug has been marked as fixed, so you should be able to use Find Usages for this.
Original post: You cannot do this without some sort of plugin or other program. The inability to find usages in libraries has been under discussion for 10 years and is currently listed as a Priority 1 enhancement, having no easy workaround. No planned fix date has been announced.
Right click on the Interface name
Go To > Implementations(s)
You can use "Find Usage" (select the name of the interface in your code and ALT+F7). In the popup, select "Find All Subtypes" and in the Scope, select "Open Projects".
That will show you all you all the classes that implement the interface in all your open projects.

Javascript : Jump to method definition using eclipse

In eclipse for java we have a feature to navigate to the method definition by "holding the CTRL key and move mouse cursor over the method name. Method name will become a hyper link. Simply click it to go to the method definition."
But we don't have a similar feature for jquery or backbone in eclipse.
Is there any plugin available for this feature.
Does anyone have any idea about this??
using shift+F3 takes you to the definition after placing the cursor on name

How to get the class name for Java SWT/JFace UI component which is currently highlighted by mouse cursor?

I need to get the name of class that represents the Java SWT/JFace UI component which is currently displayed and highlighted by mouse cursor.
For example, i wish to get something like "org.eclipse.swt.widgets.Table" when my cursor is pointing to any displayed SWT Table control, etc.
Tell me, is there a plugin for Eclipse IDE, or any another utility, which allows to do this?
In this way I want to simplify the process of writing UI-tests for Eclipse-RCP plugin project. Searching for class name and path manually anytime when this needed is very discouraging.
Get hold of the current display Display.getDefault() and call getCursorControl(), once you have the Control call control.getClass().getName().
Install SWT Spy: http://www.eclipse.org/swt/tools.php
SWT Spy is the correct tool to use. However, the mentioned page is not updated.
From Eclipse 4.7 SWT Spy is included in Eclipse PDE. So you can get it by downloading the Eclipse for RCP and RAP.
To launch SWT Spy, press: CTRL + ALT + SHIFT + F9
In case of doubts, please see: http://www.vogella.com/tutorials/EclipseCodeAccess/article.html#swt-spy

is there Eclipse useful Add On for AutoComplete function like xCode?

I've started up with developing Java.
However, These days I've started iPhone project and gave me lazy writing code;auto code generate functionality in xCode.
Are there any non-pay free edition add-on exist that does similar to xCode?
I mean, I do know Eclipse already has partial auto method look up when you put '.' (dot) token after class name which shows the list of methods.
thank you all.
The functionality is called content assist in Eclipse. It comes as default.
To trigger content assist, normally you have to click Ctrl+Space (Windows/Linux). But as you said, on Java it will be auto-activated when user press ..
You can however change this behavior. Go to Preferences -> Java -> Editor -> Content Assist and change the Auto activation triggers for Java.
For example to get the behavior of xCode, you could change it to ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
It comes by default with eclipse.
You need to press . then ctrl + spacebar
If ctrl + space doesn't work, you may try Alt + /
I used to think the autocompletion was slow, but it turns out you can make it instant. Go to Window / Preferences / Java / Editor / Content Assist / Auto-Activation and decrease Auto activation delay to zero.
I've been using Code Recommends. This is a very useful Eclipse plugin you must have.
One of my most favorite functionality is
Subwords Completion (you don't need to remember exactly the first letter of method's name, just type in other whatever letter you remember even they're inside).
It also offers many other functionality that may meet your need.

Categories

Resources