Arquivo da tag: Eclipse

IntelliJ IDEA and Eclipse Shortcuts

After around seven years of exclusively using Eclipse for Java development I recently got the chance to work on a project where IntelliJ IDEA is the standard editor. All of a sudden my tried and tested Eclipse keyboard shortcuts didn’t work any more. I’m still in the process of learning the IntelliJ Shortcuts but here are my favourites up to now (with equivalent Eclipse shortcuts).  This may be of help to anyone else switching over from Eclipse to IntelliJ.  Of course, there is an IntelliJ Plugin available which makes IntelliJ IDEA behave like Eclipse (same shortcuts and compiler behaviour) but why do that?

In the table below, in some cases, the shortcuts do not map 1:1 but they achieve the same effect.

Eclipse IntelliJ IDEA Description
F4 ctrl+h show the type hierarchy
ctrl+alt+g ctrl+alt+F7 find usages
ctrl+shift+u ctrl+f7 finds the usages in the same file
alt+shift+r shift+F6 rename
ctrl+shift+r ctrl+shift+N find file / open resource
ctrl+shift+x, j ctrl+shift+F10 run (java program)
ctrl+shift+o ctrl+alt+o organize imports
ctrl+o ctrl+F12 show current file structure / outline
ctrl+shift+m ctrl+alt+V create local variable refactoring
syso ctrl+space sout ctrj+j System.out.println(“”)
alt + up/down ctrl + shift + up/down move lines
ctrl + d ctrl + y delete current line
??? alt + h show subversion history
ctrl + h ctrl + shift + f search (find in path)
“semi” set in window-> preferences ctrl + shift + enter if I want to add the semi-colon at the end of a statement
ctrl + 1 or ctrl + shift + l ctrl + alt + v introduce local variable
alt + shift + s alt + insert generate getters / setters
ctrl + shift + f ctrl + alt + l format code
ctrl + y ctrl + shift + z redo
ctrl + shift + c ctrl + / comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y)
ctrl + alt + h ctrl + alt + h (same!) show call hierarchy
none ? ctrl + alt + f7 to jump to one of the callers of a method
ctrl + shift + i alt + f8 evaluate expression (in debugger)
F3 ctrl + b go to declaration (e.g. go to method)
ctrl + l ctrl + g go to line

 

One other thing I didn’t realise at first is that the ‘Scroll to Source’ button in IntelliJ IDEA is basically the same as the ‘Link with Editor’ button in Eclipse.

Como pegar os atalhos do Eclipse para o IntelliJ no Mac

1 – Pegue esse arquivo xml (Eclipse no Mac):

https://github.com/thatha/IntelliJ-IDEA-Eclipse-on-Mac-Keymap/blob/master/Eclipse%20on%20Mac.xml

2 – Salve o arquivo para este diretório:

~/Library/Preferences/IntelliJIdea11/keymaps/

Nota – este diretório pode variar dependendo do seu sistema/versão do IntelliJ. De acordo com este link:

http://www.jetbrains.com/idea/webhelp/configuring-keyboard-shortcuts.html

Ele deve ser da forma: Preferências ~/Library/.IntelliJ IDEA/keymaps/

Cavar em volta e você vai encontrá-lo!

3 – Abra o IntelliJ, navegue até Preferências (cmd + ,). Em Configurações do IDE> Keymap, selecionar “Eclipse on Mac” dos Keymaps lista suspensa.

Configurar o Archetype do VRaptor com Hibernate no Eclipse

Resumo sobre archetypes: 

Pré-requisitos:
– Maven instalado
– Jar do archetype no M2_REPO (ver link no final para mais detalhes sobre repositórios)
Quando for criar o projeto selecione o archetype “vraptor-hibernate-archetype”, caso não exista ainda crie clicando no botão “Add Archetype”, então preencher os seguintes campos:
Archetype Group Id : br.com.caelum.vraptor.archetypes
Archetype Artifact Id: vraptor-hibernate-archetype
Archetype Version: 0.0.1

Repository URL: https://github.com/huogerac/vraptor-hibernate-archetype/downloads

Quando clicar em “OK” irá aparecer o seu novo archetype.

Ativar o Autocomplete de Jquery no Eclipse IDE

É muito simples basta seguir esses passo,

1) Instale o plugin da seguinte ID JSDT Integração jQuery 1.5.0:
org.eclipselabs.jsdt.jquery_feature.feature.group

1

2) Vá para Project Explorer -> Recursos de JavaScript:

2

3) Clique com o botão direito sobre ele e vá para propriedades.

4) Selecione “Add JavaScript library”:

3

5) Selecione “jQuery Library”:

4

6) Você vai ter a conclusão do código da seguinte forma:

5

Pronto.