This question already has answers here:
Eclipse: Can you format code on save?
(4 answers)
Closed 8 years ago.
There was an add-on called Power Commands (Now productivity power tools) in visual studio to format the code on save.
I was so used to see my code format on save that I cannot change that habit. Is there a way to do that in Eclipse?
I can only assign one thing to Ctrl+S otherwise because if I assign Save & Format Code to the same keys, once I press the shortcut it will do neither but propose me what I want to do with the shortcut. Is there an add-on or a way to do it?
Go to
Window > Preferences
then to
Java > Editor > Save actions
and tick Perform the selected actions on save, then tick Format source code
You can also let eclipse perform Additional actions which you can freely configure.
Sure. You can do that in your eclipse workspace. Set your own custom save actions.
Here is what you need to do.
Navigate to Window --> Preferences, Search for Save in it. and enable the Perform Selected actions on Save checkbox.
Related
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?
This question already has answers here:
How to step back in Eclipse debugger?
(6 answers)
Closed 7 years ago.
Is it possible somehow do not "Next step" but "Next step in opposite order" while debugging. It means ask compiler/IDE to get back to program state that was in previous line? I'm too lazy to restart whole application in case when I missed something while debugging. Currently I'm interested in such feature in Java, Eclipse or Net-beans IDE, but also other programming languages are interesting.
I don't know a functionality like this exists, as an alternative in Eclipse you can use the functionality "Drop to frame" . This goes back to the beginning of the method which you are currently located in. It helps to understand what has been done so far. It unfortunetly does not undo what has been done when dropping to frame, so if you change non-local attributes these remain changed.
I have only experience in ECLIPSE and I could say that you could use this feature while debugging in Eclipse by simply selecting the execution line you want to be selecting the line in the Debug tab and then pressing the Drop To Frame button.
This question already has answers here:
How to tell Eclipse to show content assist automatically?
(2 answers)
Closed 8 years ago.
I recently downloaded and installed Eclipse Standard/ SDK, version: Kepler Service Release 2.
In the past, when using Eclipse, there has been an 'autocomplete' function available when typing, that would try to 'guess' what keywords and variable names you were typing- if it guessed the correct one, you just had to press 'tab' to get it to fill in automatically for you.
However, this autocomplete function doesn't seem to work with the current version of Eclipse that I'm using... and I can't seem to find a way to turn it on- I've tried Edit -> Word Completion, and Edit -> Content Assist, but neither of these options seem to make a difference.
Any suggestions?
Go to, Window >> Preferences >> Java >> Editor >> Content Assist >> Auto activation triggers for java, and enter .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ , this will trigger the auto activation for class names, methods, etc...
My answer here.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Any way to get IntelliJ-like autocompletion in Eclipse?
Is there a way to make Eclipse autocomplete work in a manner similar to one found in NetBeans? I lack completing to the next common part (i.e. type "me", I got suggestion Message, MessageArchive, MessageRouter so the 'tab' would complete to the "Message") and also auto suggesting on "." (or "enter") when there is subsequent possibility.
Tiny things but the lack of them is extremely frustrating…
Goto Window -> Preferences -> Java -> Editor -> Content Assits
In the column Auto activation triggers for Java column, enter this:
.qwertyuioplkjhgfdsazxcvbnm_QWERTYUIOPLKJHGFDSAZXCVBNM
Add any other keys you want. You're done.
You'll have the same effect as Netbeans
Try typing "me" and then pressing Ctrl + Space.
Well if the shortcut: Ctrl+Space doesn't fireup autocompletion, you will need to activate it in your Eclipse IDE.
To do that, go to: Window->Preferences->Java->Editor->ContentAssist and there you can set the parameters that you want.
[EDIT]: Here is a capture to help you with.
The auto complete functionality should be turned on by default. Eclipse pop up a auto complete box after pressing the "." or you can manually do this by pressing STRG + SPACE on PC or CMD + SPACE on a MAC
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
In Eclipse, how do I change perspectives after terminating a process?
Having Eclipse automatically switch to debug perspective while debugging is a great feature - is the opposite available? I'd like it to automatically return to Java perspective when terminating a debug session. A keyboard shortcut to return to Java perspective could be help as well.
By default, Ctrl-F8 is bound to switch between perspectives (but it can be rebound, if desired). Pressing it once will select the previous perspective.
For the keyboard shortcut to return to Java perspective:
Window - Preferences - Keys
Then search for perspectives, you will find an entry like Show perspective (Parameter: Java), bind to that the shortcut you'd like.