SWT/Jface In Action: Gui Design With Eclipse 3.0
暫譯: SWT/JFace 實戰:使用 Eclipse 3.0 進行 GUI 設計
Matthew Scarpino, Stephen Holder, Stanford Ng, Laurent Mihalkovic
買這商品的人也買了...
-
$680$537 -
$2,540$2,413 -
$1,920$1,824 -
$2,480$2,356 -
$560$476 -
$2,370$2,252 -
$780$616 -
$580$493 -
$1,230$1,169 -
$490$382 -
$2,370$2,252 -
$350$277 -
$720$612 -
$680$578 -
$890$703 -
$650$553 -
$480$408 -
$580$452 -
$650$507 -
$1,782Linux Device Drivers, 3/e (Paperback)
-
$1,235Advanced Graphics Programming Using OpenGL (Hardcover)
-
$1,127Interactive Computer Graphics: A Top-Down Approach using OpenGL, 4/e (美國版ISBN:0321321375 )
-
$820$697 -
$640$608 -
$560$437
相關主題
商品描述
Description:
SWT and JFace are Eclipse's graphical libraries. They enable you to build nimble and powerful Java GUIs--but this is only the beginning. With Draw2D and the Graphical Editing Framework, you can go beyond static applications and create full-featured editors. And with the Rich Client Platform, you can build customized workbenches whose capabilities far exceed those of traditional interfaces.
SWT/JFace in Action covers the territory, from simple widgets to complex graphics. It guides you through the process of developing Eclipse-based GUIs and shows how to build applications with features your users will love. The authors share their intimate knowledge of the subject with you in a friendly, readable style.
This book encourages you to learn through action. Each topic provides extensive code to show you how SWT/JFace works in practical applications. Not only do these examples help you understand the subject, they are a working set of programs you can reuse in your own interfaces.
Table of Contents:
preface xv
acknowledgments xvi
about this book xviii
about the authors xxiii
about the title xxiv
about the cover illustration xxv
1 Overview of SWT and JFace 1
1.1 What is SWT/JFace? 2
Building GUIs with SWT 3, Simplifying GUI development with JFace 3
1.2 Looking under the hood 4
The old standby: Swing 4, The newcomer: SWT/JFace 6, The SWT/Swing debate 9
1.3 SWT/JFace: licensing and platform support 9
The Common Public License 9, Platforms supported 9
1.4 The WidgetWindow 11
1.5 Summary 12
2 Getting started with SWT and JFace 13
2.1 Programming in SWT 14
The HelloSWT program 14, The Display class 16, The Shell class 18
2.2 Programming in SWT/JFace 20
Model-based adapters 20, The HelloSWT_JFace program 21, Coding in JFace and SWT/JFace 23, The ApplicationWindow class 23
2.3 Beginning the WidgetWindow application 24
2.4 Summary 26
3 Widgets: part 1 27
3.1 Introducing the Widget and Control classes 28
Understanding the Widget class 28, Working with Control objects 30
3.2 Labels 32
Styles and separators 33, Label methods 33
3.3 Involving the user with buttons 34
Causing action with push buttons and SWT.PUSH 34, Moving on with arrow buttons and SWT.ARROW 35, Changing state with toggle buttons and SWT.TOGGLE 35, Choosing with check buttons and SWT.CHECK 36, Making a single choice with radio buttons and SWT.RADIO 36
3.4 Containing components with Composites 38
Understanding the Composite class 39, Groups 40, SashForms 43, TabFolders 44
3.5 Updating WidgetWindow 45
Creating the Ch3_Composite class 45, Creating the WidgetWindow TabFolder 46
3.6 Summary 47
4 Working with events 48
4.1 Event processing in SWT 49
Using typed listeners and events 50, Adapters 54, Keyboard events 55, Customizing event processing with untyped events 58, An SWT listener/event application 60
4.2 Event processing in JFace 62
Understanding actions and contributions 63, Creating Action classes 65, Implementing contributions in an ApplicationWindow 66, Interfacing with contributions 69, Exploring the Action class 70
4.3 Updating the WidgetWindow 74
Building the chapter 4 Composite 74 n Adding Ch4_Composite to the WidgetWindow 75
4.4 Summary 77
5 More widgets 78
5.1 Editing text with SWT 79
The basic Text widget 79, The StyledText widget 82
5.2 JFace text support 88
Obtaining the JFace text packages 88, TextViewer and Document 89, A JFace example 91
5.3 The Combo widget 100
5.4 ToolBarManager 101
ControlContribution 102, Creating toolbars by hand 103
5.5 CoolBar 103
5.6 Slider 105
5.7 ProgressBar 106
5.8 ProgressIndicator 107
5.9 Summary 108
6 Layouts 109
6.1 The fill layout 110
6.2 The row layout 112
Customizing individual layout cells 114
6.3 The grid layout 116
GridData 117
6.4 The form layout 119
Using FormData 120, Specifying relations using, FormAttachment 120, Laying out controls using a form layout 122
6.5 Custom layouts 124
Calculating the layout?s size 125, Laying out the widgets 126, Updating WidgetWindow 128
6.6 Summary 132
7 Graphics 133
7.1 The graphic context 134
Creating a GC object 134, Drawing shapes on a Canvas 136, Painting and PaintEvents 138, Clipping and Canvas styles 139
7.2 Programming with colors 140
Color development with SWT 140, Additional color capability with JFace 144
7.3 Displaying text with fonts 145
Using fonts with SWT 145, Coding with fonts 148, Improved font management with JFace 150
7.4 Incorporating images in graphics 152
Allocating images 152, Coding graphics with images 154, Creating a bitmap with ImageData 155, Manipulating images with ImageData 159, Managing images with JFace 163
7.5 Updating the WidgetWindow 164
Building the chapter 7 composite 164, Adding Ch7_Composite to the WidgetWindow 165
7.6 Summary 166
8 Working with trees and lists 167
8.1 Viewers and the Viewer framework 168
Providers 170, Listeners 172, Filters and sorters 173
8.2 Trees 176
SWT trees 176, JFace TreeViewers 177
8.3 Using the List widget 180
SWT lists 180, JFace ListViewers 181
8.4 Updating WidgetWindow 182
8.5 Summary 189
9 Tables and menus 190
9.1 Tables 191
Understanding SWT tables 191, JFace TableViewers 194
9.2 Creating menus 200
Accelerator keys 201, Creating menus in SWT 201, Using JFace actions to add to menus 204
9.3 Updating WidgetWindow 205
9.4 Summary 211
10 Dialogs 212
10.1 SWT dialogs 213
ColorDialog 213, DirectoryDialog 214, FileDialog 215, FontDialog 216, MessageBox 216
10.2 JFace dialogs 218
Message dialogs 219, Error dialogs 220, Input dialogs 222, Progress monitor dialogs 224, Custom dialogs 228
10.3 Updating WidgetWindow 230
10.4 Summary 233
11 Wizards 234
11.1 Multipage dialogs 236
IDialogPage 236, IWizardPage 237, WizardPage 237
11.2 The wizard 239
IWizard 239, Wizard 240
11.3 Putting it all together 241
Wizard containers 241, WizardDialog 242
11.4 Combining wizards 243
WizardSelectionPage 243, IWizardNode 244
11.5 Persistent wizard data 244
DialogSettings 245
11.6 Updating WidgetWindow 246
11.7 Summary 252
12 Advanced features 253
12.1 Transferring data 254
The Transfer class 255, Drag-and-drop capability 256, Using the clipboard 261, The filesystem browser 262
12.2 Preferences 268
Preference pages 268, Field editors 270, Preference page containers 273, Persistent preferences 274
12.3 Label decorators 276
ILabelDecorator 276, DecoratingLabelProvider 277, An example 277
12.4 The Browser widget 280
12.5 Summary 283
13 Looking beyond SWT/JFace: the Rich Client Platform 284
13.1 Understanding RCP workbenches 285
Entering data with editors 285, Displaying information with views 287, Combining editors and views with perspectives 288
13.2 RCP: Looking under the hood 288
Creating and configuring an RCP project 288, Building the application class 290, Adding a WorkbenchAdvisor 291
13.3 Adding views and perspectives 294
Building views 294, Arranging workbench windows with a perspective 295, Executing an RCP application 296, Reviewing the RCP process 297
13.4 Populating forms with Eclipse Forms widgets 299
Using FormToolkit and the Eclipse Forms containers 299, Firing text-based events with Hyperlinks 302
13.5 Building a standalone RCP application 306
Exporting RCPExample to an application directory 306, Adding plug-ins to the application directory 307, Executing the application 308
13.6 Summary 308
appendix A Creating projects with SWT/JFace 311
appendix B OLE and ActiveX in SWT/JFace 324
appendix C Changeable GUIs with Draw2D 362
appendix D The Graphical Editing Framework (GEF) 388
index 461
商品描述(中文翻譯)
描述:
SWT 和 JFace 是 Eclipse 的圖形庫。它們使您能夠構建靈活且強大的 Java GUI——但這僅僅是開始。透過 Draw2D 和圖形編輯框架,您可以超越靜態應用程式,創建功能齊全的編輯器。使用 Rich Client Platform,您可以構建自定義工作台,其功能遠超傳統介面。
《SWT/JFace in Action》涵蓋了從簡單小部件到複雜圖形的範疇。它指導您開發基於 Eclipse 的 GUI 的過程,並展示如何構建用戶會喜愛的應用程式。作者以友好且易讀的風格與您分享他們對該主題的深入了解。
本書鼓勵您通過實踐來學習。每個主題提供了大量代碼,向您展示 SWT/JFace 在實際應用中的運作方式。這些範例不僅幫助您理解主題,還是一組可以在您自己的介面中重用的工作程式。
目錄:
前言 xv
致謝 xvi
關於本書 xviii
關於作者 xxiii
關於書名 xxiv
關於封面插圖 xxv
1 SWT 和 JFace 概述 1
1.1 SWT/JFace 是什麼? 2
使用 SWT 構建 GUI 3,使用 JFace 簡化 GUI 開發 3
1.2 內部運作 4
老牌選擇:Swing 4,新來者:SWT/JFace 6,SWT/Swing 辯論 9
1.3 SWT/JFace:授權和平台支持 9
公共許可證 9,支持的平台 9
1.4 WidgetWindow 11
1.5 總結 12
2 開始使用 SWT 和 JFace 13
2.1 在 SWT 中編程 14
HelloSWT 程式 14,Display 類 16,Shell 類 18
2.2 在 SWT/JFace 中編程 20
基於模型的適配器 20,HelloSWT_JFace 程式 21,在 JFace 和 SWT/JFace 中編碼 23,ApplicationWindow 類 23
2.3 開始 WidgetWindow 應用程式 24
2.4 總結 26
3 小部件:第一部分 27
3.1 介紹 Widget 和 Control 類 28
理解 Widget 類 28,處理 Control 物件 30
3.2 標籤 32
樣式和分隔符 33,標籤方法 33
3.3 使用按鈕讓用戶參與 34
使用按鈕和 SWT.PUSH 觸發動作 34,使用箭頭按鈕和 SWT.ARROW 繼續 35,使用切換按鈕和 SWT.TOGGLE 改變狀態 35,使用勾選按鈕和 SWT.CHECK 選擇 36,使用單選按鈕和 SWT.RADIO 進行單一選擇 36
3.4 使用 Composite 包含組件 38
理解 Composite 類 39,群組 40,SashForms 43,TabFolders 44
3.5 更新 WidgetWindow 45
創建 Ch3_Composite 類 45,創建 WidgetWindow TabFolder 46
3.6 總結 47
4 處理事件 48
4.1 在 SWT 中的事件處理 49
使用類型化監聽器和事件 50,適配器 54,鍵盤事件 55,自定義事件處理與非類型事件 58,一個 SWT 監聽器/事件應用程式 60
4.2 在 JFace 中的事件處理 62
理解動作和貢獻 63,創建 Action 類 65,在 ApplicationWindow 中實現貢獻 66,與貢獻接口 69,探索 Action 類 70
4.3 更新 WidgetWindow 74
構建第 4 章 Composite 74,將 Ch4_Composite 添加到 WidgetWindow 75
4.4 總結 77
5 更多小部件 78
5.1 使用 SWT 編輯文本 79
基本的 Text 小部件 79,StyledText 小部件 82
5.2 JFace 文本支持 88
獲取 JFace 文本包 88,TextViewer 和 Document 89,一個 JFace 範例 91
5.3 Combo 小部件 100
5.4 ToolBarManager 101
ControlContribution 102,手動創建工具列 103
5.5 CoolBar 103
5.6 Slider 105
5.7 ProgressBar 106
5.8 ProgressIndicator 107
5.9 總結 108
6 佈局 109
6.1 填充佈局 110
6.2 行佈局 112
自定義單個佈局單元 114
6.3 網格佈局 116
GridData 117
6.4 表單佈局 119
使用 FormData 120,使用 FormAttachment 指定關係 120,使用表單佈局佈置控制項 122
6.5 自定義佈局 124
計算佈局的大小 125,佈置小部件 126,更新 WidgetWindow 128
6.6 總結 132
7 圖形 133
7.1 圖形上下文 134
創建 GC 物件 134,在 Canvas 上繪製形狀 136,繪製和 PaintEvents 138,裁剪和 Canvas 樣式 139
7.2 使用顏色編程 140
使用 SWT 進行顏色開發 140,使用 JFace 增強顏色能力 144
7.3 使用字體顯示文本 145
使用 SWT 的字體 145,使用字體編碼 148,使用 JFace 改進字體管理 150
7.4 在圖形中整合圖像 152
分配圖像 152,使用圖像編碼圖形 154,使用 ImageData 創建位圖 155,使用 ImageData 操作圖像 159,使用 JFace 管理圖像 163
7.5 更新 WidgetWindow 164
構建第 7 章 Composite 164,將 Ch7_Composite 添加到 WidgetWindow 165
7.6 總結 166
8 處理樹和列表 167
8.1 查看器和查看器框架 168
提供者 170,監聽器 172,過濾器和排序器 173
8.2 樹 176
SWT 樹 176,JFace TreeViewers 177
8.3 使用 List 小部件 180
SWT 列表 180,JFace ListViewers 181
8.4 更新 WidgetWindow 182
8.5 總結 189
9 表格和菜單 190
9.1 表格 191
理解 SWT 表格 191,JFace TableViewers 194
9.2 創建菜單 200
加速鍵 201,在 SWT 中創建菜單 201,使用 JFace 動作添加到菜單 204
9.3 更新 WidgetWindow 205
9.4 總結 211
10 對話框 212
10.1 SWT 對話框 213
ColorDialog 213,DirectoryDialog 214,FileDialog 215,FontDialog 216,MessageBox 216
10.2 JFace 對話框 218
消息對話框 219,錯誤對話框 220,輸入對話框 222,進度監視器對話框 224,自定義對話框 228
10.3 更新 WidgetWindow 230
10.4 總結 233
11 向導 234
11.1 多頁對話框 236
IDialogPage 236,IWizardPage 237,WizardPage 237
11.2 向導 239
IWizard 239,Wizard 240
11.3 將所有內容整合 241
向導容器 241,WizardDialog 242
11.4 組合向導 243
WizardSelectionPage 243,IWizardNode 244
11.5 持久化向導數據 244
DialogSettings 245
11.6 更新 WidgetWindow 246
11.7 總結 252
12 進階功能 253
12.1 傳輸數據 254
Transfer 類 255,拖放能力 256,使用剪貼簿 261,檔案系統瀏覽器 262
12.2 偏好設定 268
偏好設定頁 268,欄位編輯器 270,偏好設定頁容器 273,持久化偏好設定 274
12.3 標籤裝飾器 276
ILabelDecorator 276,DecoratingLabelProvider 277,一個範例 277
12.4 瀏覽器小部件 280
12.5 總結 283
13 超越 SWT/JFace:Rich Client Platform 284
13.1 理解 RCP 工作台 285
使用編輯器輸入數據 285,使用視圖顯示信息 287,使用透視圖結合編輯器和視圖 288
13.2 RCP:內部運作 288
創建和配置 RCP 專案 288,構建應用程式類 290,添加 WorkbenchAdvisor 291
13.3 添加視圖和透視圖 294
構建視圖 294,使用透視圖排列工作台窗口 295,執行 RCP 應用程式 296,回顧 RCP 過程 297
13.4 使用 Eclipse Forms 小部件填充表單 299
使用 FormToolkit 和 Eclipse Forms 容器 299,使用超連結觸發基於文本的事件 302
13.5 構建獨立的 RCP 應用程式 306
將 RCPExample 匯出到應用程式目錄 306,將插件添加到應用程式目錄 307,執行應用程式 308
13.6 總結 308
附錄 A 使用 SWT/JFace 創建專案 311
附錄 B SWT/JFace 中的 OLE 和 ActiveX 324
附錄 C 使用 Draw2D 創建可變 GUI 362
附錄 D 圖形編輯框架 (GEF) 388
索引 461