Intellij Idea resource bundle + annotation in javadoc prompt - java

I started using Intellij Idea for some time after working for a few years in Eclipse and I'm missing few features in Idea. First one is about resource bundle prompt. When I'm editing java file and I have some string literal in my class when I move my mouse over this string Eclipse is showing a prompt with values that are defined in resources files (for all languages) for this literal string key. Another very similar feature is when I'm move my mouse over a static field imported form other class. In eclipse I can see all annotation for this field so I don't have to enter that other class to see it. In Idea this information is not present. Does similar features exists in Idea or in Idea plugins ?

Hold down the Ctrl key while hovering your mouse over the variable to see the value. The same thing works with resource bundles if there's only a single instance of the key in the bundle, however if you have translations IntelliJ shows "multiple implementations" on hover and requires you to click and pick the one you want to see. There are a few tickets open with JetBrains to fix this usability issue, however they haven't gone anywhere, for example: https://youtrack.jetbrains.com/issue/IDEA-76594

Related

Eclipse content assist without library

When I begin typing "butt" for "button", the content assist recommends a Button - that is right and I want it like this.
see example
But when I press enter, it inserts "java.awt.Button"
see example
How do I tell the assist to insert only "Button"?
Your Eclipse IDE may not be properly configured for JavaFX which could prevent autocomplete from finding JavaFX's classes. The solution is likely to update Eclipse IDE's access rules, otherwise you may be interested by this answer or this one. Read below for further details.
You already import JavaFX's Button whereas the autocomplete proposes AWT's Button (see the java.awt on the right of the proposal). To make sure AWT's Button is not mistaken for JavaFX's one its fully qualified name has to be use — hence java.awt.Button.
The real issue is that your content assist should also propose the javafx.scene.control.Button class, and that should be solved by configuring access rules as described in the first answer I linked.

Eclipse: Disable auto completion but keep showing suggestions

After a long period of creating apps with Android Studio I returned to Eclipse to program a pure Java application. Of course, I have noticed large differences in terms of auto completion between IntelliJ IDEA and Eclipse but IntelliJ is no alternative for me because of various reasons.
That is why I started to change the settings in Eclipse, inter alia, for the content assist. I want to have suggestions for variable names too, without having to write a dot first. As you can see in this image, I have changed the auto activation triggers to ._#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ as suggested in another thread on Stack Overflow.
The problem is, if I write short variable names like d it completes them automatically to something different (in this case DEFAULT_CURSOR) when I press the dot key. To avoid this, I have to choose the variable first, before pressing the dot key.
However, having to do it this way is a large waste of time. Is there a possibility to use the suggested variables or methods only when I have pressed the enter key, just like in IntelliJ?
Maybe there is an option to bind the dot key to the closing of the content assist?
No, Eclipse and IntelliJ are different and IntelliJ's level of auto completion is unique to itself. If you are comfortable with it, you should use it and then copy and paste to eclipse for windowbuilder. Also FYI there is a free alternative to windowbuilder for IntelliJ, you can read about it here: WindowBuilder equivalent for IntelliJ?

Not seeing superclasses in Eclipse new java class wizard

I'm trying to learn some Android and java programming in Eclipse. I can run sample projects and tutorials fine, but when I try to create a new java class with File->New->Class and press the Browse button to look for superclasses to use, nothing shows up in the "Matching items:" area, even when I delete the "java.lang.Object" default type. I should be seeing lots of class names there, shouldn't I?
The same lack of results happens when I try to add and interface or an enclosing type. I'm new to Eclipse and java. I suppose that I have some setting messed up? I'm running the most recent Eclipse on Linux:
Version: Indigo Service Release 1
Build id: 20110916-0149
I eventually realized that code completion was not working either. I checked the settings in 'Windows > Preferences > Java > Editor > Content Assist > Advanced' and they seemed OK. I then re-ran with 'eclipse -clean'. After I did that, code completion and the new class wizard are working.
Thanks
You have to type some characters and then it will start looking for classes that start with those characters. Also, check that you don't have any filters set that you don't expect. You will see a tiny upside-down triangle on the upper right, click on that and go to the filters dialog.
No. Every public and non final class could be your superclass. Proposing them all would force Eclipse to show thousands of classes, and would not really help you. You're supposed to know which class you want to extend. Just type its name, the beginning of its name, or the first letter of each of its words (ATM for AbstractTableModel, for example), and Eclipse will then show you matching classes.

Motodev won't lookup methods - can it be configured to do so?

I am using Motodev, an Eclipse-based development tool for Java ME / Motorola. The problem is when you type a line of code that has a method, such as:
super.
It doesnt give options of what methods it has available?
How do I configure it to do this?
Or I'm guessing the instructions for eclipse would work the same.
#android_king22 MOTODEV Studio should work just like Eclipse does. Pressing '.' or ctrl-space should bring up the list of suggestions. What context are you typing 'super'? Are you able to build your project (i.e. is the SDK path correct)?
Is there a folder inside your SDK called "platforms/android-X/sources"? This is a common workaround to a particularly ugly problem in Eclipse where it takes 20-30 seconds for auto-complete to work. If you do have this folder but no actual source inside, it could be preventing the auto-complete mechanism from working.
You must enable "Java Proposals" and "Java Type Proposals" in Preferences|Java|Editor|Content assist|Advanced
"super" calls a method in the superclass of whatever object you are currently using. If no method is available (or your current class is not a subclass), then it won't show anything. However, if there are methods available, it will automatically show (if you have Intellisense on).

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

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.

Categories

Resources