android - eclipse shortcuts and techniques Daquan

Ctrl + 1 Quick Fix (the most classic shortcut keys, it goes without saying)
Ctrl + D: Delete the current line
Ctrl + Alt + ↓ Copy the current line to the next line (Copy increase)
Ctrl + Alt + ↑ Copy the current line to the previous line ( replication increases)
the Alt + ↓ current line and the line of interaction locations below (particularly useful, omitted the first cut and then pasted)
the Alt + ↑ current line and the top line of interaction position (supra)
the Alt + before ← a page editor
Alt + → next edited page (of course, for the one above it)
Alt + the Enter shows the currently selected resource (engineering, or file or files) properties
Shift + Enter next line in the current row insert a blank line (this time in the current mouse any position of the line, not necessarily final)
the Shift + Ctrl + the Enter the current line insert a blank line (principle above article)
Ctrl + Q to last edited place positioning
Ctrl + L is positioned in a row (for the program more than 100 people there is the gospel)
Ctrl + M to maximize the current Edit or View (then vice versa)
Ctrl + / comments on the current line, press the cancel comment
Ctrl + O to quickly display OutLine
Ctrl + T to quickly display the current class inheritance structure of
Ctrl + W Close current Editer
the Ctrl + K reference Word quickly locate selected next
Ctrl + E to quickly display the drop-down list Editer current (if the current page is not displayed in bold font)
the Ctrl + / (keypad) all the current class code folding
Ctrl + × (keypad) Expand All codes in the current class
Ctrl + Space Code Assistant complete insert some code (but generally and input conflict may be modified hot-key input method, may be temporarily used Alt + / instead)
ctrl + Shift + E display Manager currently open Manager View all (you can choose to turn off, activation and other operations)
Ctrl + J forward incremental find (after pressing Ctrl + J, you enter each letter editors provides quick match to locate a word, if not, then at stutes line display is not found, when a search word is especially useful, this feature Idea Two years ago there was)
Ctrl + J reverse incremental find the Shift + (and on the same strip, just from the back check)
Ctrl + the Shift + F4 to close all open Editer
Ctrl + the Shift + the X-the currently selected text all uppercase
Ctrl + Shift + Y to all the currently selected text lowercase
Ctrl + Shift + F formatted current code
Ctrl + Shift + P matcher for targeting of (for example, {}) (when positioned behind the front from the cursor to the character matching inside, front to back, and vice versa)

below shortcut keys are commonly used in remodeling the inside, I would like to own And commonly tidy (Note: general reconstruction shortcuts are Alt + the beginning of the Shift)
Alt + the Shift + R to rename (my own favorite with a, especially variables and class Rename, than the method can save a lot of manual labor)
the Alt + the Shift + M extraction method (which is one of the most common methods reconstruct the inside, especially useful for a lot of clay in the code)
the Alt + C + modify the Shift function structure (more practical there are N function calls this method to modify a one-stop)
Alt + Shift + L extracting local variables (direct some magic number and character string extracting into a variable, especially when multiple calls)
alt the Shift + + Class F. The changes in the field variables local variables (more practical function)
the Alt + + the I combined the Shift variable (may say something wrong Inline)
the Alt + V + the Shift movement functions and variables (less commonly)
the Alt + the Shift reconstructed regret the Z + (the Undo)

editing
scope feature shortcuts
global Find and replace Ctrl + F
text editor to find a Ctrl + Shift + K
text editor to find next Ctrl + K
global undo Ctrl + Z (undo much you can press Ctrl + Y forward)
global copy Ctrl + C
global recovery on a select Alt + Shift + ↓
global cut Ctrl + X
global fast correction Ctrl1 + 1
global content assist Alt + /
global select all Ctrl + a
global delete delete
global context information Alt +?
+ The Shift + Alt?
Ctrl + the Shift + Space
the Java editor to display a tooltip description F2
the Java editor to select the Shift + package elements ↑ + Alt
the Java editor on one element selected Alt + Shift + ←
Under Java Editor select an element Alt + Shift + →
text editor, incremental find Ctrl + J
text editor incremental reverse lookup Ctrl + Shift + J
Global Ctrl + V to paste
the global Redo Ctrl + Y


to view the
scope function shortcut key
global amplifying Ctrl + =
global reduction Ctrl + -


window
scope function shortcut keys
activated globally F12 editor
global switch editor Ctrl + Shift + W
an editor Ctrl + Shift + F6 globally
a view on a global Ctrl + Shift + F7
globally a perspective view FIG Ctrl + Shift + F8
globally an editor Ctrl + F6
globally a view Ctrl + F7
a perspective view of the global Ctrl + F8
text editor display rulers context menu Ctrl + W
global view showing a menu Ctrl + F10
global display system menu alt + -


navigation
scope function shortcut
Java editor Ctrl + F3 to open the structure of
the global open type Ctrl + Shift + T
global open type hierarchy F4
global open declaration F3
Global open external javadoc Shift + F2
global open resource Ctrl + Shift + R
global recession history Alt + ←
global forward history Alt + →
a Ctrl + globally,
globally a Ctrl +.
The Java Editor displays an outline Ctrl + O
global hierarchy in open type Ctrl + Shift + H
global go matching brace Ctrl + Shift + P
global go on a edit position the Ctrl + Q
the Java editor go to the previous member of the Ctrl + the Shift + ↑
the Java editor go to the next member of the Ctrl + Shift + ↓
text editor, go to line Ctrl + L


search
scope function shortcut key
global Ctrl + Shift + U appears in the document
the global open the search dialog Ctrl + H
declare global Ctrl + G workspace
references Ctrl + global workspace Shift + G


text editing
scope function shortcut
text editor rewritable switching Insert
the text editor rolling Ctrl + ↑
rolling Ctrl + ↓ the text editor


file
scope shortcut function
globally + X-save the Ctrl
the Ctrl + S
Ctrl + P global print
disabled globally Ctrl + F4
global save all Ctrl + Shift + S
global all closed Ctrl + Shift + F4
global properties Alt + Enter
global Ctrl + N new


project
scope shortcut function
globally Ctrl + B construct all


source code
scope function shortcuts
Java editor format Ctrl + the Shift + F
Java editor uncommented Ctrl + \
Java editor comments Ctrl + /
Java editor to add import Ctrl + the Shift + M
Java editor organize imports Ctrl + the Shift + O
Java editor using try / catch block surrounded is not provided, a very common, it is listed here, provided their recommendations.
You can also use Ctrl + 1 automatic correction.


Run
scope function shortcut key
global Step Return F7
global Step Over F6
Global Step into F5
global step into select Ctrl + F5
global debugger last start F11
globally continue F8
Global filter using single-step Shift + F5
global add / remove breakpoints Ctrl + Shift + B
Global + D show the Ctrl
the Ctrl + last start running the F11 global
global row Ctrl + R to run
global execution Ctrl + U


reconstructed
scope function shortcut
global revocation reconstructed Alt + Shift + Z
global extraction method Alt + Shift + M
global extracting local variable Alt + Shift + L
global inlining Alt + Shift + I
global motion Alt + Shift + V
global rename Alt + Shift + R
global redo Alt + Shift + Y


 

Code article:

 

1. Quick Jump in the source code:
Jump in eclipse even easier than VS.Net, by holding down the Ctrl key, and then point your mouse variable names, method names, class names, there will be a link, you can click on skip to define the office.

 

2. Real-time syntax checking:
edit right side of the area if there is a small red box, click on the line you can jump to the wrong; a small yellow box is a warning can be ignored, but it is best to check; if a function is not completed, to mention

 

Note wake yourself how to do? Add comments // TODO, on the right there will be a small blue square, prompting you here has not been completed. When the right side of a source code without any indication of how this document has been

 

finished.

 

3. automatically generate getter / setter methods:
only need to declare protected, private class member variables, and then find the class, right click and select "Source" in the Package Explore the "Generate Getters and

 

Setters”。

 

4.更改类名/变量名:
如果涉及到多处修改,不要直接在源码中更改,在Package Explore中找到要改名的类或变量,右键点击,选择“Refactor”“Rename”,

 

eclipse会自动搜索所有相关代码并替换,确保不会遗漏或改错。

 

5.匹配Try:
如果写的代码需要抛出或者捕捉异常,在JBuilder中,你需要首先引入这个异常类,然后再在写好的代码前后加try,catch或者在方法后面加

 

throws,在eclipse里完全不必要这样,只需要写好代码,然后按ctrl + 1,这时会出来提示,提示你是throw还是catch这个异常,选择你需要

 

的,按下enter就可以了。

 

6.快速书写循环代码:
在写循环或者选择条件的语句时,先写出关键字如if、while,然后按alt + /自己去看有什么好处吧。接下来会出来提示代码,按下tab可以在

 

框框中跳,按下确定跳出代码提示。

 


热键篇:
ctrl + D:删除行

 

ctrl + M:当前窗口的最大化或最小化

 

ctrl + L:跳到指定的行

 

ctrl + 1:代码纠错提示

 

alt + /:代码辅助提示

 

F11:运行上次运行的程序

 

Ctrl+E 会弹出下拉列表列出打开文件的名称,用户可以利用上下方向键选择要查看的文件或者敲入文件名,这样就会切换到相应的文件。

 

Alt+Left 和 Alt+Right,利用Alt+左右方向键的方式,可以在打开文件中进行切换,就像用户使用浏览器时一样。

 

Ctrl+Shift+E,当用户使用Ctrl+Shift+E时,会弹出一个窗口列出打开文件的名称,用户可以利用上下方向键选择要查看的文件。

 

Ctrl+F6,会弹出一个列表列出打开文件的名称,不要松开Ctrl键,列表会一直打开。用户可以利用上下方向键或者利用Ctrl+Shift+F6选择要

 

查看的文件。

 

Ctrl+Shift+R,会打开资源对话框,键入要查看的文件名,回车就会切换到相应的文件。

 

Alt+F,利用历史纪录也可以达到切换的目的。当使用Alt+F打开文件菜单时,输入历史纪录中的数值就可以了。

 

Template:Alt + /
修改处:Window->Preference->Workbench->Keys->Command->Edit->Content Assist。
个人习惯:Shift+SPACE(空白)。
简易说明:编辑程序代码时,打sysout +Template启动键,就会自动出现:System.out.println(); 。
设定Template的格式:窗口->喜好设定->Java->编辑器->模板。

 

程序代码自动排版:Ctrl+Shift+F
修改处:窗口->喜好设定->工作台->按键->程序代码->格式。
个人习惯:Alt+Z。
自动排版设定:窗口->喜好设定->Java->程序代码格式制作程序。
样式页面->将插入tab(而非空格键)以内缩,该选项取消勾选,下面空格数目填4,这样在自动编排时会以空格4作缩排。

 


快速执行程序:Ctrl + F11
个人习惯:ALT+X
修改处:窗口->喜好设定->工作台->按键->执行->启动前一次的启动作业。
简易说明:第一次执行时,它会询问您执行模式,
设置好后,以后只要按这个热键,它就会快速执行。
..我觉得很顺手^___^

 


自动汇入所需要的类别:Ctrl+Shift+O
简易说明:
假设我们没有Import任何类别时,当我们在程序里打入:
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
此时Eclipse会警示说没有汇入类别,这时我们只要按下Ctrl+Shift+O,它就会自动帮我们Import类别。

 


查看使用类别的原始码:Ctrl+鼠标左键点击
简易说明:可以看到您所使用类别的原始码。
将选取的文字批注起来:Ctrl+/
简易说明:Debug时很方便。
修改处:窗口->喜好设定->工作台->按键->程序代码->批注

 


将选取的文字取消批注:Ctrl+简易说明:同上。
修改处:窗口->喜好设定->工作台->按键->程序代码->取消批注

 


视图切换:Ctrl+F8
个人习惯:Alt+S。
修改处:窗口->喜好设定->工作台->按键->窗口->下一个视景。
简易说明:可以方便我们快速切换编辑、除错等视景。
3.0里Ctrl+Alt+H可以看到调用当前member的方法,而且可以一层一层上去.
Ctrl+O可以快速切到其他方法.

 

密技篇:

 

一套Eclipse可同时切换,英文、繁体、简体显示:
1.首先要先安装完中文化包。
2.在桌面的快捷方式后面加上参数即可,
英文-> -nl "zh_US" ;繁体-> -nl "zh_TW" ;简体-> -nl "zh_CN"。(其它语系以此类推)

 

像我2.1.2中文化后,我在我桌面的Eclipse快捷方式加入参数-n1 "zh_US"。
"C:\Program Files\eclipse\eclipse.exe" -n "zh_US"
接口就会变回英文语系噜。

 

利用Eclipse,在Word编辑文书时可不必将程序代码重新编排:
将Eclipse程序编辑区的程序代码整个复制下来(Ctrl+C),直接贴(Ctrl+V)到Word或WordPad上,您将会发现在Word里的程序代码格式,跟

 

Eclipse所设定的完全一样,包括字型、缩排、关键词颜色。我曾试过JBuilder、GEL、NetBeans...使用复制贴上时,只有缩排格式一样,字型

 

、颜色等都不会改变。

 


外挂篇:

 

外挂安装:将外挂包下载回来后,将其解压缩后,您会发现features、plugins这2个数据夹,将里面的东西都复制或移动到Eclipse的features

 

、plugins数据夹内后,重新启动Eclipse即可。

 

让Eclipse可以像JBuilderX一样使用拖拉方式建构GUI的外挂:
1.Jigloo SWT/Swing GUI Builder :
http://cloudgarden.com/jigloo/index.html
下载此版本:Jigloo plugin for Eclipse (using Java 1.4 or 1.5)
安装后即可由档案->新建->其它->GUI Form选取要建构的GUI类型。

 

2.Eclipse Visual Editor Project:
http://www.eclipse.org/vep/
点选下方Download Page,再点选Latest Release 0.5.0进入下载。
除了VE-runtime-0.5.0.zip要下载外,以下这2个也要:
EMF build 1.1.1: (build page) (download zip)
GEF Build 2.1.2: (build page) (download zip)

 

我只测试过Eclipse 2.1.2版本,使用上是OK的!

 

3.0版本以上的使用者,请下载:

 

Eclipse build I20040324:
1.0.0 Stream Integration Build I20040325 Thu, 25 Mar 2004 -- 12:09 (-0500)
1.0.0 Stream Nightly Build N20040323a Tue, 23 Mar 2004 -- 13:53 (-0500)
注意:3.0以上版本,仅build I20040324可正常使用。
安装成功后,即可由新建->Java->AWT与Swing里选择所要建构的GUI类型开始进行设计。VE必须配合着对应版本,才能正常使用,否则即使安装

 

成功,使用上仍会有问题。

 


使用Eclipse来开发JSP程序:
外挂名称:lomboz(下载页面)
http://forge.objectweb.org/project/showfiles.php?group_id=97
请选择适合自己版本的lomboz下载,lomboz.212.p1.zip表示2.1.2版,lomboz.3m7.zip表示M7版本....以此类推。lomboz安装以及设置教学:

 

Eclipse开发JSP-教学文件

 

Java转exe篇:
实现方式:Eclipse搭配JSmooth(免费)。
1.先由Eclipse制作包含Manifest的JAR。
制作教学

 

2.使用JSmooth将做好的JAR包装成EXE。
JSmooth下载页面:
http://jsmooth.sourceforge.net/index.php

 

3.制作完成的exe文件,可在有装置JRE的Windows上执行。

 


Eclipse-Java编辑器最佳设定:
编辑器字型设定:工作台->字型->Java编辑器文字字型。
(建议设定Courier New -regular 10)

编辑器相关设定:窗口->喜好设定->Java->编辑器
外观:显示行号、强调对称显示的方括号、强调显示现行行、显示打印边距,将其勾选,Tab宽度设4,打印编距字段设80。
程序代码协助:采预设即可。
语法:可设定关键词、字符串等等的显示颜色。
附注:采预设即可。
输入:全部字段都勾选。
浮动说明:采预设即可。
导览:采预设即可。
使自动排版排出来的效果,最符合Java设计惯例的设定:
自动排版设定:窗口->喜好设定->Java->程序代码制作格式。
换行:全部不勾选。
分行:行长度上限设:80。
样式:只将强制转型后插入空白勾选。
内缩空格数目:设为4。

转载于:https://www.cnblogs.com/bill-joy/archive/2012/03/05/2380974.html

Guess you like

Origin blog.csdn.net/weixin_34343308/article/details/94048913