Ctrl+N keyboard shortcut on IntelliJ/Android Studio - java

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.

Related

Eclipse autocomplete showing the proposals without filling them

I have just installed the Eclipse IDE and I searched on the internet how to configure the autocomplete. I found a good method and after that I implemented it. But, now I'm very curious if the autocomplete can be set to show the proposals without filling them if I don't want to.
I thing your question is that when you press the shotcut of automatic complete,then it fill the code automatically without a confirmation
the reason is that the result of your attemp to complete is just only one,so there is a mechanism that when the result of the attemp to complete is just only one,then it will be automatically filled
but you can set up this mechanism in in the following way
windows---preferences---java---editor---contentassist---insert single proposals automatically
If you press CTRL + Space it should show the autocomplete and you just have to press enter for it to fill in.

In IntelliJ is there an easier way to set up the "Complete Current Statement" like eclipse?

I have used Eclipse for Java for the last few years and am trying out Intellij. I'm not using it permanently because it isn't as useful for quick programming (like how you can't just drag in files into the src folder) but for doing certain things, I think it will be faster for me.
I know there is Ctrl+Shift+Enter, but this is just annoying to press. Not because it is awkward to press, but because it takes so much time compared to just pressing enter like you can in Eclipse. I tried to rebind it to enter, but then it just doesn't work.
Is there a way to set up the Complete Current Statement so that it happens when I press enter?
Like, is there a way that I can bind it to Enter, but have it checked before the editor checks for enter as move to next line?
If you want only basic Code completion and not Type completion, use Ctrl+Space
IntelliJ and Android Studio are pretty highly customisable. You can rebind shortcuts too, I believe. Have you looked here? https://www.jetbrains.com/idea/help/configuring-keyboard-shortcuts.html
Also cheatsheet might be of use: https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf
And Android specific bindings: https://developer.android.com/sdk/installing/studio-tips.html

How can I prevent Alt key opening Dash Home while my Java app runs in Ubuntu?

I am learning Slick2D, which perfectly serves my purposes of 2D Java game programming. Unfortunately, I have a problem. I don't think it's Slick2D specific, since I think the same happens with Java Graphics 2D.
In Ubuntu (I'm using Ubuntu 12.04), pressing the Alt key shows the "Dash Home", the same as clicking on the top-left icon in the screen (Windows users, "Dash Home" is sort of "Start" menu).
When my application runs, Alt key still has this behavior and shows the Dash Home. When my game runs in windowed mode, that's not a big deal, since I can go to a paused state. However, when in fullscreen mode, it is a big problem because the system leaves fullscreen and switching between fullscreen and windowed is time consuming and, roughly speaking, ugly.
So, the question is: how can I prevent the Alt keypress to reach the OS, preventing Dash Home to open? In my code I handle keyPresses through the listener provided by Game2D and I don't call any superclass method, so, suposedly the keypress should not be informed to the OS. But... it is.
I am not attaching any code as I don't think this is related to Slick2D, but a general Java issue. Any idea?
Thanks!
Edit: The problem still persists. I have posted the whole source code and binaries of the project here. If it doesn't help to find a solution to this, it may serve as a basic tutorial about Java game programming to other people.
If you are not trying to post this java program to loads of people on Ubuntu computers then you could try this:
Open the System Settings application either by going to Session Indicator in Unity panel, or by searching for System Settings using the HUD.
Then go to Keyboard > Shortcuts > Launchers. You can redefine the HUD key with the Key to show the HUD option. Pressing Backspace will disable the HUD shortcut altogether.
If you set it to Alt manually, the setting distinguishes between the left and right Alt key. So if you want to maintain general behaviour and still use Alt combinations, this may be an alternate solution for you.
And just so you know I got this answer from this website: https://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key
I don't know of anyway to temporarily disable the Alt key features but if you don't mind this then I hope this helps

Linux or Sublime Text tab-style auto complete for Eclipse?

Is there a way to enable Sublime Text style tab-autocomplete in Eclipse. I've gotten very used to simply typing the first few letters of a variable name in Sublime, hitting tab to complete the variable name, and then moving on without thought. It's proving to be a tough muscle memory to break as I transition to Eclipse.
I know about CTRL + Space for bringing up the code completion menu for automatically generating certain attribute names and whatnot, but I'm more referring to that really quick completion of names while I type them.
Maybe a quick eclipse hack will work for you?
I have never used Sublime's autocomplete, but it sounds like Xcode has something similar. Just fill the "auto activation triggers" textbox with any/all characters that you'd want to toggle autocomplete.

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