资源说明:Eclipse – 整合开发工具(基础篇)
Jacky Lee
2005/03/01
Eclipse.doc 第 1 页,共 1 页
目录
0.环境说明................................................................................................................................................................7
1.Eclipse简介............................................................................................................................................................8
1.1历史背景.....................................................................................................................................................8
1.2开放原始码软件.........................................................................................................................................8
1.3 Eclipse版本介绍.........................................................................................................................................8
1.4跨语言、跨平台.........................................................................................................................................9
2. Eclipse Platform..................................................................................................................................................10
2.1概观...........................................................................................................................................................10
2.2架构...........................................................................................................................................................10
2.3项目与资料夹...........................................................................................................................................10
2.4平台核心...................................................................................................................................................11
2.5工作区(workspace)....................................................................................................................................11
2.6工作台(workbench)...................................................................................................................................11
2.6.1视图(View).....................................................................................................................................12
2.6.2编辑器(Editor)................................................................................................................................14
2.6.3视景(Perspective)...........................................................................................................................16
2.7重新排列视图和编辑器...........................................................................................................................17
2.7.1放置游标........................................................................................................................................17
2.7.2重新排列视图................................................................................................................................18
2.7.3并列编辑器....................................................................................................................................18
2.7.4重新排列附加标签的视图............................................................................................................19
2.7.5最大化............................................................................................................................................19
2.8菜单和工具列...........................................................................................................................................20
2.8.1菜单................................................................................................................................................20
2.8.2图标和按钮....................................................................................................................................31
2.9视景...........................................................................................................................................................35
2.9.1新视景............................................................................................................................................35
2.9.2新窗口............................................................................................................................................37
2.9.3储存视景........................................................................................................................................37
2.9.4配置视景........................................................................................................................................39
2.10作业和标记.............................................................................................................................................40
2.10.1不相关的作业..............................................................................................................................40
2.10.2相关的作业..................................................................................................................................41
2.10.3开启档案......................................................................................................................................42
2.11书签.........................................................................................................................................................42
2.11.1新增和检视书签..........................................................................................................................42
Eclipse 中文教程.doc 第 2 页,共 221 页
2.11.2使用书签......................................................................................................................................44
2.11.3移除书签......................................................................................................................................44
2.12快速视图(Fast View)...............................................................................................................................46
2.12.1建立快速视图..............................................................................................................................46
2.12.2使用快速视图..............................................................................................................................46
2.13比较.........................................................................................................................................................47
2.13.1简单比较......................................................................................................................................48
2.13.2了解比较......................................................................................................................................49
2.13.3使用比较......................................................................................................................................49
2.14历史纪录.................................................................................................................................................51
2.15回应 UI...................................................................................................................................................52
3.喜好设定(Preferences).........................................................................................................................................55
3.1工作台(Workbench)..................................................................................................................................55
3.1.1外观(Appearance)...........................................................................................................................57
3.1.2功能(Capabilities)...........................................................................................................................58
3.1.3颜色和字型(Colors and Fonts)......................................................................................................59
3.1.4比较/修正(Compare/Patch)............................................................................................................61
3.1.5编辑器(Editors)..............................................................................................................................63
3.1.6档案关联(File Associations)..........................................................................................................64
3.1.7按键(Keys).....................................................................................................................................66
3.1.8标签装饰(Label Decorations)........................................................................................................72
3.1.9链接资源(Linked Resources).........................................................................................................72
3.1.10历史纪录(Local History)..............................................................................................................73
3.1.11视景..............................................................................................................................................74
3.1.12搜寻(Search).................................................................................................................................76
3.1.13启动和关闭(Startup and Shutdown)............................................................................................76
3.2 Ant.............................................................................................................................................................77
3.2.1 Ant 编辑器(Ant Editor).................................................................................................................78
3.2.2 Ant 执行时期(Ant Runtime).........................................................................................................79
3.3建置次序(Build Order).............................................................................................................................81
3.4说明(Help).................................................................................................................................................82
3.4.1说明服务器(Help Server)...............................................................................................................83
3.5自动更新(Install/Update)..........................................................................................................................84
3.6 Java............................................................................................................................................................84
3.6.1外观(Appearance)...........................................................................................................................85
3.6.2类别路径变量(Classpath variables)...............................................................................................86
3.6.3程序代码格式制作器(Code Formatter).........................................................................................86
3.6.4程序代码产生(Code generation)...................................................................................................88
Eclipse 中文教程.doc 第 3 页,共 221 页
3.6.5编译器(Compiler)...........................................................................................................................90
3.6.6 Java 编辑器(Java editor)...............................................................................................................94
3.6.7 JRE 安装(JRE installations)..........................................................................................................99
3.6.8 JUnit..............................................................................................................................................100
3.6.9新专案(New project)....................................................................................................................100
3.6.10组织汇入(Organize imports)......................................................................................................101
3.6.11「重构」喜好设定(Refactoring preferences).............................................................................102
3.6.12作业标示(Task Tags)..................................................................................................................102
3.7团队(Team)..............................................................................................................................................102
3.7.1 CVS..............................................................................................................................................103
3.7.2忽略的资源(Ignored Resources)..................................................................................................107
3.7.3档案内容(File Content)................................................................................................................107
4. Java程序开发....................................................................................................................................................108
4.1建立Java项目..........................................................................................................................................108
4.2建立Java类别..........................................................................................................................................110
4.3程序代码完成功能..................................................................................................................................111
4.3.1 Code Completion...........................................................................................................................111
4.3.2 Code Assist....................................................................................................................................111
4.4执行Java程序..........................................................................................................................................112
4.5 Java实时运算簿页面(Java Scrapbook Page)..........................................................................................114
4.6自订开发环境.........................................................................................................................................121
4.6.1程序代码格式..............................................................................................................................121
4.6.2程序代码产生模板......................................................................................................................122
4.6.3 Javadoc批注.................................................................................................................................124
4.7产生 getter 与 setter..............................................................................................................................128
4.8建立 JAR 档案......................................................................................................................................130
4.8.1建立新的 JAR 档案...................................................................................................................130
4.8.2设定进阶选项..............................................................................................................................132
4.8.3定义 JAR 檔的 manifest............................................................................................................133
4.8.4重新产生 JAR 檔.......................................................................................................................135
4.9.建立 Javadoc 文件................................................................................................................................137
4.9.1选取产生 Javadoc 用的类型......................................................................................................137
4.9.2为标准 doclet 配置 Javadoc 自变量........................................................................................138
4.9.3配置 Javadoc 自变量..................................................................................................................138
4.10工作集(Working Sets)...........................................................................................................................139
4.10.1新增工作集................................................................................................................................139
4.10.2隐藏「导览器」视图中的档案................................................................................................141
4.10.3显示「导览器」视图中的档案................................................................................................142
Eclipse 中文教程.doc 第 4 页,共 221 页
5.除错....................................................................................................................................................................144
5.1错误的程序.............................................................................................................................................144
5.2设定岔断点(Breakpoints).......................................................................................................................145
5.3逐步除错.................................................................................................................................................149
5.3.1 Step Into........................................................................................................................................149
5.3.2 Step Over......................................................................................................................................149
5.3.3 Step Return...................................................................................................................................149
5.3.4 Drop to Frame...............................................................................................................................149
5.3.5 Use Step Filters/Step Debug.........................................................................................................150
5.4继续执行.................................................................................................................................................151
5.5设定岔断点的Hit Count.........................................................................................................................153
5.6岔断点组态设定.....................................................................................................................................160
5.7监视点(Watchpoint)................................................................................................................................161
5.8方法岔断断点(Method Breakpoint)........................................................................................................164
5.9异常岔断点(Exception Breakpoint)........................................................................................................166
5.10 Java表示式及变更某些值....................................................................................................................168
6.重构(Refactoring)...............................................................................................................................................170
6.1重新命名.................................................................................................................................................170
6.1.1区域变量(Local Variable)............................................................................................................170
6.1.2字段(Field)...................................................................................................................................171
6.1.3方法(Method)...............................................................................................................................173
6.1.4类别(Class)或是接口(Interface)..................................................................................................174
6.1.5套件(Package)..............................................................................................................................176
6.2撷取(Extracting)......................................................................................................................................177
6.2.1撷取常数(Extracting a Constant).................................................................................................177
6.2.2撷取区域变量(Extracting a Local Variable)................................................................................180
6.2.3撷取方法(Extracting a Method)...................................................................................................182
6.3列入(Inlining)..........................................................................................................................................187
6.3.1列入常数(Inlining a Constant).....................................................................................................187
6.3.2列入区域变量(Inlining a Local Variable)....................................................................................189
6.3.3列入方法(Inlining a Method).......................................................................................................191
6.4变更方法签章(Signature).......................................................................................................................193
6.5移动Java元素(Moving Java Elements)...................................................................................................196
6.5.1字段(Field)...................................................................................................................................197
6.5.2 Static Members.............................................................................................................................198
6.6自行封装字段(Self Encapsulating a Field).............................................................................................200
7.要诀和技巧(Tips and Tricks).............................................................................................................................203
7.1编辑程序文件(Editing Source)...............................................................................................................203
Eclipse 中文教程.doc 第 5 页,共 221 页
7.2搜寻(Searching).......................................................................................................................................208
7.3程序代码导览和读取(Code navigation and reading).............................................................................209
7.4 Java视图(Java views)..............................................................................................................................212
7.5除错(Debugging).....................................................................................................................................214
7.6各种(Various)..........................................................................................................................................217
Eclipse 中文教程.doc 第 6 页,共 221 页
0.环境说明
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。