Why the keyboard get locked sometimes when I use Netbeans on Linux? - netbeans

I am using Netbeans to develop a Ruby on Rails application. Unfortunately, I have a problem with it.
Sometimes the keyboard stop working and I can not input code in the text editor.
Also the keyboard short cut specific to netbeans stop working as well (such as ctrl + s)
Nevertheless, the Ubuntu keyboard short cut still work (alt + tab ...)
The only solution I found is to maximize/unmaximize the window of the text editor or switch tab.

This probably isn't a proper SO question, but have you tried switching from the community version of Java to the Sun version (or the other way around)?
https://help.ubuntu.com/community/Java

Related

Eclipse Luna : losing hotkeys and getting back with focus change

I have seen some questions about eclipse hotkeys, but not exactly like mine :
I have very weird behaviour with eclipse Luna :
I am typing some text in the editor window, and suddenly, all the hotkeys are not working anymore ( ctrl-s ctrl-z ctrl-f etc...).
Nevertheless,the keyboard is still working, I can enter some more text, use arrow keys : nothing tells I have lost the focus in the editor window.
I just click in a side view window to lose focus in the editor,
and click again in editor window to get the focus back, and that's it : the hotkeys are back.
I was using eclipse Keppler before Luna, there were not such a behaviour with Keppler.
As I am losing the hotkeys every minute, I really need to solve this problem : any idea ?
NOTE : I am using ubuntu 12.04 (gnome)
After one year I think I may have found how to fix it ...
I have a 12.04 precise with latest kernel (3.2.0-80-generic) and unity and with gnome compatibility settings enabled as well.
Compiz
I started to look at the Compiz Config Setting Manager
Disable The Workaround
As Eclipse is written in Java I found that maybe disabling fixes related to it could help.
From the CompizConfig Settings Manager go to Utility->Workarounds and disable:
Java Window Fix
Java Taskbar Fix
I actually have disable all the workaround and not just those. I restarted Eclipse and it seems now to work. (NOTE: I believe you may have Compiz running even if you don't use unity)
Result
I do not have to unfocus or refocus. It seems to work pretty well. Interleaving ctrl-s, ctrl-z and ctrl-f works fine. (but I just tested few minutes, the system is unstable so I opted for another solution, see below)
Final Solution for me
I login with gnome classic without 3D effect
Workaroud I actually use:
GDK_CORE_DEVICE_EVENTS=1 ./eclipse
I don't know how long would it be work.

Ubuntu loses text-editor focus from time to time

I have just upgraded from Ubuntu 10.04 to 12.04.3 LTS. An annoying thing I discovered is that, in eclipse and matlab, I cannot type text sometimes. The detailed phenomena are as follows:
Eclipse
Happens after using auto-completion (activated by customized shortcut alt+/), or switching from other windows, or pressing ctrl+z, etc.
Can use mouse to move cursor around, but keyboard does not respond.
Using alt-tab to switch back and forth can solve the problem.
And similar things are happening in matlab, whenever I hit tab . But gedit and browser are working fine. Wonder if anyone has encountered the same problem. Thanks.
Problem solved. It's really a conflict between out-of-date keyboard input methods and java programs in Ubuntu 12.04. See https://askubuntu.com/questions/365205/text-editors-in-eclipse-matlab-loses-focus-occasionally-after-upgrading-to-12-04.

Eclipse, Configuration of Editor

I need to switch to eclipse base on some errors in Netbeans with Android project.
But my problems is I like how Netbeans look and work and wonder how I can config some part of Eclipse to like more my Netbeans.
( I use eclipse 4.2.1 for Java and Android.)
The first part is, how can I config Eclipse to always show my the range of a method,
The Eclipse has same function but the range of a method is only show while I hover over the icon with the mouse. ( Also I want this to be square icons )
My other question is in netbeans while I has collaps a method I can
preview the method by hover over {...}, can I config Eclipse to do same?
I has identify a working way to show preview, you move the course to the first line on the collaps lines and then move mouse over the plus sign. But this is more work and take more time then uncollaps and collaps the lines. Is this exist a fast way to do the preview?
I'm using Eclipse for few years and I have never seen any options or ways to configure preview for collapsed code.
I prefer to use the keyboard instead of the mouse. It's much faster during development for me. I hope those keyboard shortcuts will be useful for you too:
Ctrl+9 - collapse 1 level for all blocks Edit: (PyDev specific)
Ctrl+0 - expand 1 level for all blocks Edit: (PyDev specific)
Ctrl+- - collapse current block
Ctrl++ - expand current block
For Mac use Cmd instead of Ctrl key.

Ctrl button doesn't work in Eclipse

I use Ubuntu (64 bit). I saw some discussions about Ctrl+Space, but in my case I can't do Ctrl+S, Ctrl+V, Ctrl+Z, Ctrl+Shift+F and, probably, something else (all these cases work fine in other programs, so it's not a keyboard problem). It doesn't work, then it does, then it doesn't again. Is there a way to fix that? Thanks in advance.
I am also using 64-bit Ubuntu (12.04 now, 11.10 before that) and Eclipse. I was having similar problems like what you are describing, until I realized that keyboard input method/layout settings actually matter in Ubuntu (while it does not in Mac OS or Windows) while using copy/paste. If you are using two keyboard layouts (e.g. I am using English and Bulgarian), Ctrl-C / Ctrl-V will not work with the non-English layout. If it does no work, double-check the current keyboard layout.
It took me awhile to figure that out - hope it would help you too.
I've solved the same problem rebuilding my workspace CTRL + B on Windows
Similar problem
Looks like there are some key combination which screw up with the focus in the eclipse editor. Try using the shortcut for Focus Return
Shift+Alt+f

Validate Autocomplete in Eclipse

Coming from Visual Studio and starting a project in Java, I realized I couldn't cope with having to press ctrl+space to have the autocomplete panel show up. An easy workaround was to set all keyboard characters to be trigger characters for autocompletion.
My only problem is that, when presented with autocomplete suggestions, a single press on the space bar will write the first proposition. In situations where I'm happy with the suggestions, that's just fine. In situations where I actually want to use what I wrote down initially, I have to press 'escape' first to remove the autocomplete panel before I can press 'space' safely.
Netbeans doesn't use the space bar as a validating key for autocompletion (only 'enter' does that) and I like that behavior. Any way to replicate it in Eclipse?
Thanks in advance for your answers!
EDIT: I should have mentioned I'm using Eclipse on the Mac.
Guillaume
I have the same problem with Eclipse Indigo on Windows XP actually. Coming from intellij idea, I also felt the need to set the whole keyboard to trigger auto-complete.
A quick proof that SPACE key does accept suggestions : type inte on a new line. If the auto-complete menu shows, press SPACE. It goes for Integer.
If anyone knows how to set the SPACE key to "ignore suggestions", it would be great, because the escape key on my keyboard is also too far away :)
Thanks
Edit : actually the best would be to have only the ENTER key validating, because ';' and '(' also seem to validate
I just tried to reproduce your behavior, but couldn't. Here is the configuration I have (and the steps I have done to reproduce):
I have installed Indigo (current version of Eclipse, version number 3.7).
I did not change any configuration there, this is what is the default:
Under Window > Preferences > Java > Editor > Content Assist, I have the following settings:
Completion inserts (instead of overwrite)
Insert single proposal automatically (which is ok most of the time)
not insert common prefix automatically
I have a simple class, go down to a method, and do the following steps:
Enter this.no and wait some time. Sometimes I have to press CTRL + SPACE, sometimes not.
Proposal pops up which includes notify and notifyAll.
I press SPACE and a space is inserted in the text, the autocomplete suggestions are closed without inserting anything.
I do not know if older versions of eclipse have the same behavior.