Eclipse, shortcut to create new Java class

被刻印的时光 ゝ 提交于 2019-11-29 00:11:33

问题


Is it possible to assign a shortcut to go automatically on New Java Class Dialog? At the very beginning of a project when I am creating a lot of classes, it's quite annoying have to go through the 'New..' wizard.

Here's the image of the dialog I want to reach.


回答1:


Select Window -> Preferences -> General -> Keys and search for New (Class). Click on Binding, press the keyboard shortcut you want, and click OK to configure the shortcut.




回答2:


Press alt+shift+n it will give you a context menu from where you can select new class,package,interface




回答3:


Ctrl+n will launch new wizard, there you can select the class/any to create new document.




回答4:


There's an icon (C icon) in the header toolbar for creating class! Its available by default Just click it!




回答5:


hit alt+shift+N and then click the respective first character for creating the respective file. For example, let's suppose you want to create a new java class:

  1. Hit alt+shift+N.
  2. Hit c (stands for creating java class).
  3. j (it will highlight the java package).

like this you can use shortcut keys as well as first character of the word what you want to create.

Hope this might help.




回答6:


You could use Ctrl+3 to open the "Quick Access" Wizard and type in "java class"




回答7:


on Mac alt(option)+command+N > displays a menu, scroll using arrow keys for appropriate selection and hit Enter.




回答8:


You can use the New Java Class wizard to create a Java class. It can be invoked in different ways:

  • By clicking on the File menu and selecting New → Class.
  • By right clicking in the package explorer and selecting New → Class.
  • By clicking on the class drop down button and selecting class.

The shortcuts for basic Eclipse file management actions are different between Mac and Windows/Linux environment.

Check it out:

Visit for more Eclipse shortcuts.



来源:https://stackoverflow.com/questions/19339769/eclipse-shortcut-to-create-new-java-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!